Globus Compute¶
The standard way to interact with the Globus Compute service is through the Globus Compute SDK, a separate, specialized toolkit that offers enhanced functionality for Globus Compute. Under the hood, the Globus Compute SDK uses the following clients to interact with the Globus Compute API. Advanced users may choose to work directly with these clients for custom implementations.
The canonical ComputeClient
is a subclass of ComputeClientV2
,
which supports version 2 of the Globus Compute API. When feasible, new projects
should use ComputeClientV3
, which supports version 3 and includes the
latest API features and improvements.
- class globus_sdk.ComputeClient(*, environment=None, base_url=None, app=None, app_scopes=None, authorizer=None, app_name=None, transport_params=None)[source]¶
Bases:
ComputeClientV2
Canonical client for the Globus Compute API, with support exclusively for API version 2.
Methods
- class globus_sdk.ComputeClientV2(*, environment=None, base_url=None, app=None, app_scopes=None, authorizer=None, app_name=None, transport_params=None)[source]¶
Bases:
BaseClient
Client for the Globus Compute API, version 2.
Methods
- scopes¶
Various scopes are available as attributes of this object. For example, access the
all
scope with>>> ComputeClient.scopes.all
Supported Scopes
all
- get_version(service=None)[source]¶
Get the current version of the API and other services.
- Parameters:
service (str | None) – Service for which to get version information.
- Return type:
See Get Version in the API documentation for details.
- get_result_amqp_url()[source]¶
Generate new credentials (in the form of a connection URL) for connecting to the AMQP service.
See Get Result AMQP URL in the API documentation for details.
- Return type:
- register_endpoint(data)[source]¶
Register a new endpoint.
- Parameters:
- Return type:
See Register Endpoint in the API documentation for details.
- get_endpoint(endpoint_id)[source]¶
Get information about a registered endpoint.
See Get Endpoint in the API documentation for details.
- get_endpoint_status(endpoint_id)[source]¶
Get the status of a registered endpoint.
See Get Endpoint Status in the API documentation for details.
- get_endpoints()[source]¶
Get a list of registered endpoints associated with the authenticated user.
See Get Endpoints in the API documentation for details.
- Return type:
- delete_endpoint(endpoint_id)[source]¶
Delete a registered endpoint.
See Delete Endpoint in the API documentation for details.
- lock_endpoint(endpoint_id)[source]¶
Temporarily block registration requests for the endpoint.
See Lock Endpoint in the API documentation for details.
- register_function(function_data)[source]¶
Register a new function.
See Register Function in the API documentation for details.
- get_function(function_id)[source]¶
Get information about a registered function.
- Parameters:
- Return type:
See Get Function in the API documentation for details.
- delete_function(function_id)[source]¶
Delete a registered function.
- Parameters:
- Return type:
See Delete Function in the API documentation for details.
- get_task(task_id)[source]¶
Get information about a task.
- Parameters:
- Return type:
See Get Task in the API documentation for details.
- get_task_batch(task_ids)[source]¶
Get information about a batch of tasks.
See Get Task Batch in the API documentation for details.
- get_task_group(task_group_id)[source]¶
Get a list of task IDs associated with a task group.
- Parameters:
- Return type:
See Get Task Group Tasks in the API documentation for details.
- submit(data)[source]¶
Submit a batch of tasks to a Globus Compute endpoint.
- Parameters:
- Return type:
See Submit Batch in the API documentation for details.
- class globus_sdk.ComputeClientV3(*, environment=None, base_url=None, app=None, app_scopes=None, authorizer=None, app_name=None, transport_params=None)[source]¶
Bases:
BaseClient
Client for the Globus Compute API, version 3.
Methods
- scopes¶
Various scopes are available as attributes of this object. For example, access the
all
scope with>>> ComputeClient.scopes.all
Supported Scopes
all
- register_endpoint(data)[source]¶
Register a new endpoint.
- Parameters:
- Return type:
See Register Endpoint in the API documentation for details.
- update_endpoint(endpoint_id, data)[source]¶
Update an endpoint.
- Parameters:
- Return type:
See Update Endpoint in the API documentation for details.
- lock_endpoint(endpoint_id)[source]¶
Temporarily block registration requests for the endpoint.
See Lock Endpoint in the API documentation for details.
- get_endpoint_allowlist(endpoint_id)[source]¶
Get a list of IDs for functions allowed to run on an endpoint.
See Get Endpoint Allowlist in the API documentation for details.
- submit(endpoint_id, data)[source]¶
Submit a batch of tasks to a Globus Compute endpoint.
- Parameters:
- Return type:
See Submit Batch in the API documentation for details.
Client Errors¶
When an error occurs, a ComputeClient
will raise a ComputeAPIError
.
- class globus_sdk.ComputeAPIError(r, *args, **kwargs)[source]¶
Bases:
GlobusAPIError