Skip to content

Commit

Permalink
Update GraphQL client.
Browse files Browse the repository at this point in the history
  • Loading branch information
Barkin Simsek committed Jun 22, 2023
1 parent e99b400 commit 59ebe6e
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.5.1 (2023-06-22)

- Regenerate graph client for new module library APIs.


# 0.5.0 (2023-04-18)

- Support HTTP over Unix domain socket via optional `unixEndpoint` argument.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Mujin Controller Python Client is Licensed under the Apache License, Version 2.0

## For developers

### How to re-generate `controllergraphclient.py`
### How to re-generate `webstackgraphclient.py`

First, set up a virtualenv to install required pip packages:

Expand All @@ -46,10 +46,10 @@ virtualenv .ve
./.ve/bin/pip install .
```

Then, use `mujin_webstackclientpy_generategraphclient.py` to generate the content of the `controllergraphclient.py` file.
Then, use `mujin_webstackclientpy_generategraphclient.py` to generate the content of the `webstackgraphclient.py` file.

```bash
./.ve/bin/python devbin/mujin_webstackclientpy_generategraphclient.py --url http://controller123 > python/mujinwebstackclient/controllergraphclient.py
./.ve/bin/python devbin/mujin_webstackclientpy_generategraphclient.py --url http://controller123 > python/mujinwebstackclient/webstackgraphclient.py
```

## Troubleshooting
Expand Down
2 changes: 1 addition & 1 deletion python/mujinwebstackclient/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.5.0'
__version__ = '0.5.1'

# Do not forget to update CHANGELOG.md

60 changes: 54 additions & 6 deletions python/mujinwebstackclient/webstackgraphclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# DO NOT EDIT, THIS FILE WAS AUTO-GENERATED
# GENERATED BY: mujin_webstackclientpy_generategraphclient.py
# GENERATED AGAINST: mujinwebstack/2.2.61.e3cf6b7364a631ceee0c6c0b6085ea2252d3d178-dirty
# GENERATED AGAINST: mujinwebstack/2.3.41.c8be3d03b5264805d3bb9123d01c7c8d0c8c0460
#

from .webstackgraphclientutils import GraphClientBase
Expand Down Expand Up @@ -997,11 +997,37 @@ def GetUntypedModelProcessorState(self, bodyId, environmentId, resolveReferences
return self._CallSimpleGraphAPI('query', operationName='GetUntypedModelProcessorState', parameterNameTypeValues=parameterNameTypeValues, returnType='Any', fields=fields, timeout=timeout)

def GetUntypedSchema(self, schemaId, fields=None, timeout=None):
"""Get untyped JSON schema by the schema ID.
Args:
schemaId (str): ID of the schema.
fields (list or dict, optional): Specifies a subset of fields to return.
timeout (float, optional): Number of seconds to wait for response.
Returns:
Any:
"""
parameterNameTypeValues = [
('schemaId', 'String!', schemaId),
]
return self._CallSimpleGraphAPI('query', operationName='GetUntypedSchema', parameterNameTypeValues=parameterNameTypeValues, returnType='Any', fields=fields, timeout=timeout)

def GetVisionTaskModuleByVisionTaskType(self, visionTaskType, fields=None, timeout=None):
"""Get vision task module by vision task type.
Args:
visionTaskType (str):
fields (list or dict, optional): Specifies a subset of fields to return.
timeout (float, optional): Number of seconds to wait for response.
Returns:
VisionTaskModule:
"""
parameterNameTypeValues = [
('visionTaskType', 'String!', visionTaskType),
]
return self._CallSimpleGraphAPI('query', operationName='GetVisionTaskModuleByVisionTaskType', parameterNameTypeValues=parameterNameTypeValues, returnType='VisionTaskModule', fields=fields, timeout=timeout)

def IsAttachedSensorMoveable(self, attachedSensorName, bodyName, environmentId, fields=None, timeout=None):
"""Check and see if attached sensor is moveable on a robot
Expand Down Expand Up @@ -1588,6 +1614,22 @@ def ListTools(self, bodyId, environmentId, options=None, resolveReferences=None,
]
return self._CallSimpleGraphAPI('query', operationName='ListTools', parameterNameTypeValues=parameterNameTypeValues, returnType='ListToolsReturnValue', fields=fields, timeout=timeout)

def ListVisionTaskModules(self, options=None, fields=None, timeout=None):
"""List vision task modules.
Args:
options (ListOptionsInput, optional): Optional list query parameters, used to filter returned results.
fields (list or dict, optional): Specifies a subset of fields to return.
timeout (float, optional): Number of seconds to wait for response.
Returns:
ListVisionTaskModulesReturnValue:
"""
parameterNameTypeValues = [
('options', 'ListOptionsInput', options),
]
return self._CallSimpleGraphAPI('query', operationName='ListVisionTaskModules', parameterNameTypeValues=parameterNameTypeValues, returnType='ListVisionTaskModulesReturnValue', fields=fields, timeout=timeout)

def Ping(self, host, size=None, ttl=None, fields=None, timeout=None):
"""Ping a remote host.
Expand Down Expand Up @@ -3184,7 +3226,7 @@ def GetLatestDetectionResultImages(self, options=None, parameters=None, fields=N
timeout (float, optional): Number of seconds to wait for response.
Returns:
[MujinImage]:
[MujinImage]: Holds data related to a captured images.
"""
parameterNameTypeValues = [
('options', 'VisionManagerOptionsInput', options),
Expand Down Expand Up @@ -4066,7 +4108,7 @@ def SnapImages(self, parameters=None, fields=None, timeout=None):
timeout (float, optional): Number of seconds to wait for response.
Returns:
[MujinImage]:
[MujinImage]: Holds data related to a captured images.
"""
parameterNameTypeValues = [
('parameters', 'Any', parameters),
Expand Down Expand Up @@ -4121,14 +4163,15 @@ def SyncConfigurationsToRemote(self, configurationIds, remoteUrl, ignoreUploadFa
]
return self._CallSimpleGraphAPI('mutation', operationName='SyncConfigurationsToRemote', parameterNameTypeValues=parameterNameTypeValues, returnType='SyncConfigurationsToRemoteReturnValue', fields=fields, timeout=timeout)

def SyncEnvironments(self, environmentIds, remoteUrl, addKeywords=None, fileNamePatterns=None, ignoreDownloadFailures=None, remotePassword=None, remoteUsername=None, fields=None, timeout=None):
def SyncEnvironments(self, environmentIds, remoteUrl, addKeywords=None, downloadReferenceObjects=None, fileNamePatterns=None, ignoreDownloadFailures=None, remotePassword=None, remoteUsername=None, fields=None, timeout=None):
"""Sync environments from remote webstack.
Args:
environmentIds ([String]): List of environment IDs to download.
remoteUrl (str): URL to remote webstack, e.g. "http://username:password@controller123".
addKeywords ([String], optional): If set, add keywords to the modified environments.
downloadReferenceObjects (bool, optional): If set to true, download objects referenced in bodies.
fileNamePatterns ([String], optional): List of regular expression patterns to determine what files to sync inside each environment.
ignoreDownloadFailures (bool, optional): If set to true, ignores download failures.
remotePassword (str, optional): Optional credential to use when authenticating with remote webstack, if credentials are not given in remoteUrl already.
Expand All @@ -4143,20 +4186,22 @@ def SyncEnvironments(self, environmentIds, remoteUrl, addKeywords=None, fileName
('environmentIds', '[String!]!', environmentIds),
('remoteUrl', 'String!', remoteUrl),
('addKeywords', '[String!]', addKeywords),
('downloadReferenceObjects', 'Boolean', downloadReferenceObjects),
('fileNamePatterns', '[String!]', fileNamePatterns),
('ignoreDownloadFailures', 'Boolean', ignoreDownloadFailures),
('remotePassword', 'String', remotePassword),
('remoteUsername', 'String', remoteUsername),
]
return self._CallSimpleGraphAPI('mutation', operationName='SyncEnvironments', parameterNameTypeValues=parameterNameTypeValues, returnType='SyncEnvironmentsFromRemoteReturnValue', fields=fields, timeout=timeout)

def SyncEnvironmentsFromRemote(self, environmentIds, remoteUrl, addKeywords=None, fileNamePatterns=None, ignoreDownloadFailures=None, remotePassword=None, remoteUsername=None, fields=None, timeout=None):
def SyncEnvironmentsFromRemote(self, environmentIds, remoteUrl, addKeywords=None, downloadReferenceObjects=None, fileNamePatterns=None, ignoreDownloadFailures=None, remotePassword=None, remoteUsername=None, fields=None, timeout=None):
"""Sync environments from remote webstack.
Args:
environmentIds ([String]): List of environment IDs to download.
remoteUrl (str): URL to remote webstack, e.g. "http://username:password@controller123".
addKeywords ([String], optional): If set, add keywords to the modified environments.
downloadReferenceObjects (bool, optional): If set to true, download objects referenced in bodies.
fileNamePatterns ([String], optional): List of regular expression patterns to determine what files to sync inside each environment.
ignoreDownloadFailures (bool, optional): If set to true, ignores download failures.
remotePassword (str, optional): Optional credential to use when authenticating with remote webstack, if credentials are not given in remoteUrl already.
Expand All @@ -4171,14 +4216,15 @@ def SyncEnvironmentsFromRemote(self, environmentIds, remoteUrl, addKeywords=None
('environmentIds', '[String!]!', environmentIds),
('remoteUrl', 'String!', remoteUrl),
('addKeywords', '[String!]', addKeywords),
('downloadReferenceObjects', 'Boolean', downloadReferenceObjects),
('fileNamePatterns', '[String!]', fileNamePatterns),
('ignoreDownloadFailures', 'Boolean', ignoreDownloadFailures),
('remotePassword', 'String', remotePassword),
('remoteUsername', 'String', remoteUsername),
]
return self._CallSimpleGraphAPI('mutation', operationName='SyncEnvironmentsFromRemote', parameterNameTypeValues=parameterNameTypeValues, returnType='SyncEnvironmentsFromRemoteReturnValue', fields=fields, timeout=timeout)

def SyncEnvironmentsToRemote(self, environmentIds, remoteUrl, addKeywords=None, fileNamePatterns=None, ignoreUploadFailures=None, remotePassword=None, remoteUsername=None, fields=None, timeout=None):
def SyncEnvironmentsToRemote(self, environmentIds, remoteUrl, addKeywords=None, fileNamePatterns=None, ignoreUploadFailures=None, remotePassword=None, remoteUsername=None, uploadReferenceObjects=None, fields=None, timeout=None):
"""Sync environments to remote webstack.
Args:
Expand All @@ -4189,6 +4235,7 @@ def SyncEnvironmentsToRemote(self, environmentIds, remoteUrl, addKeywords=None,
ignoreUploadFailures (bool, optional): If set to true, ignores upload failures.
remotePassword (str, optional): Optional credential to use when authenticating with remote webstack, if credentials are not given in remoteUrl already.
remoteUsername (str, optional): Optional credential to use when authenticating with remote webstack, if credentials are not given in remoteUrl already.
uploadReferenceObjects (bool, optional): If set to true, upload objects referenced in bodies.
fields (list or dict, optional): Specifies a subset of fields to return.
timeout (float, optional): Number of seconds to wait for response.
Expand All @@ -4203,6 +4250,7 @@ def SyncEnvironmentsToRemote(self, environmentIds, remoteUrl, addKeywords=None,
('ignoreUploadFailures', 'Boolean', ignoreUploadFailures),
('remotePassword', 'String', remotePassword),
('remoteUsername', 'String', remoteUsername),
('uploadReferenceObjects', 'Boolean', uploadReferenceObjects),
]
return self._CallSimpleGraphAPI('mutation', operationName='SyncEnvironmentsToRemote', parameterNameTypeValues=parameterNameTypeValues, returnType='SyncEnvironmentsToRemoteReturnValue', fields=fields, timeout=timeout)

Expand Down

0 comments on commit 59ebe6e

Please sign in to comment.