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:

GlobusHTTPResponse

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:

GlobusHTTPResponse

register_endpoint(data)[source]

Register a new endpoint.

Parameters:

data (dict[str, Any]) – An endpoint registration document.

Return type:

GlobusHTTPResponse

See Register Endpoint in the API documentation for details.

get_endpoint(endpoint_id)[source]

Get information about a registered endpoint.

Parameters:

endpoint_id (UUID | str) – The ID of the Globus Compute endpoint.

Return type:

GlobusHTTPResponse

See Get Endpoint in the API documentation for details.

get_endpoint_status(endpoint_id)[source]

Get the status of a registered endpoint.

Parameters:

endpoint_id (UUID | str) – The ID of the Globus Compute endpoint.

Return type:

GlobusHTTPResponse

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:

GlobusHTTPResponse

delete_endpoint(endpoint_id)[source]

Delete a registered endpoint.

Parameters:

endpoint_id (UUID | str) – The ID of the Globus Compute endpoint.

Return type:

GlobusHTTPResponse

See Delete Endpoint in the API documentation for details.

lock_endpoint(endpoint_id)[source]

Temporarily block registration requests for the endpoint.

Parameters:

endpoint_id (UUID | str) – The ID of the Globus Compute endpoint.

Return type:

GlobusHTTPResponse

See Lock Endpoint in the API documentation for details.

register_function(function_data)[source]

Register a new function.

Parameters:

function_data (dict[str, Any]) – A function registration document.

Return type:

GlobusHTTPResponse

See Register Function in the API documentation for details.

get_function(function_id)[source]

Get information about a registered function.

Parameters:

function_id (UUID | str) – The ID of the function.

Return type:

GlobusHTTPResponse

See Get Function in the API documentation for details.

delete_function(function_id)[source]

Delete a registered function.

Parameters:

function_id (UUID | str) – The ID of the function.

Return type:

GlobusHTTPResponse

See Delete Function in the API documentation for details.

get_task(task_id)[source]

Get information about a task.

Parameters:

task_id (UUID | str) – The ID of the task.

Return type:

GlobusHTTPResponse

See Get Task in the API documentation for details.

get_task_batch(task_ids)[source]

Get information about a batch of tasks.

Parameters:

task_ids (UUID | str | Iterable[UUID | str]) – The IDs of the tasks.

Return type:

GlobusHTTPResponse

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:

task_group_id (UUID | str) – The ID of the task group.

Return type:

GlobusHTTPResponse

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:

data (dict[str, Any]) – The task batch document.

Return type:

GlobusHTTPResponse

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:

data (dict[str, Any]) – An endpoint registration document.

Return type:

GlobusHTTPResponse

See Register Endpoint in the API documentation for details.

update_endpoint(endpoint_id, data)[source]

Update an endpoint.

Parameters:
  • endpoint_id (UUID | str) – The ID of the endpoint.

  • data (dict[str, Any]) – An endpoint update document.

Return type:

GlobusHTTPResponse

See Update Endpoint in the API documentation for details.

lock_endpoint(endpoint_id)[source]

Temporarily block registration requests for the endpoint.

Parameters:

endpoint_id (UUID | str) – The ID of the Globus Compute endpoint.

Return type:

GlobusHTTPResponse

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.

Parameters:

endpoint_id (UUID | str) – The ID of the Globus Compute endpoint.

Return type:

GlobusHTTPResponse

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:
  • endpoint_id (UUID | str) – The ID of the Globus Compute endpoint.

  • data (dict[str, Any]) – The task batch document.

Return type:

GlobusHTTPResponse

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