Local Endpoints

Unlike SDK functionality for accessing Globus APIs, the locally available Globus Endpoints require special treatment. These accesses are not authenticated via Globus Auth, and may rely upon the state of the local filesystem, running processes, and the permissions of local users.

Globus Connect Server

There are no SDK methods for accessing an installation of Globus Connect Server.

Globus Connect Personal

Globus Connect Personal endpoints belonging to the current user may be accessed via instances of the following class:

class globus_sdk.LocalGlobusConnectPersonal(*, config_dir: Optional[str] = None)[source]

A LocalGlobusConnectPersonal object represents the available SDK methods for inspecting and controlling a running Globus Connect Personal installation.

These objects do not inherit from BaseClient and do not provide methods for interacting with any Globus Service APIs.

Parameters

config_dir (str, optional) – Path to a non-default configuration directory. On Linux, this is the same as the value passed to Globus Connect Personal’s -dir flag (i.e. the default value is ~/.globusonline).

property config_dir: str

The config_dir for this endpoint.

If no directory was given during initialization, this will be computed based on the current platform and environment.

get_owner_info() Optional['globus_sdk.GlobusConnectPersonalOwnerInfo'][source]
get_owner_info(auth_client: None) Optional['globus_sdk.GlobusConnectPersonalOwnerInfo']
get_owner_info(auth_client: globus_sdk.AuthClient) Optional[Dict[str, Any]]

Look up the local GCP information, returning a GlobusConnectPersonalOwnerInfo object. The result may have an id or username set (depending on the underlying data).

If you pass an AuthClient, this method will return a dict from the Get Identities API instead of the info object. This can fail (e.g. with network errors if there is no connectivity), so passing this value should be coupled with additional error handling.

In either case, the result may be None if the data is missing or cannot be parsed.

Note

The data returned by this method is not checked for accuracy. It is possible for a user to modify the files used by GCP to list a different user.

Parameters

auth_client (globus_sdk.AuthClient) – An AuthClient to use to lookup the full identity information for the GCP owner

Examples

Getting a username:

>>> from globus_sdk import LocalGlobusConnectPersonal
>>> local_gcp = LocalGlobusConnectPersonal()
>>> local_gcp.get_owner_info()
GlobusConnectPersonalOwnerInfo(username='foo@globusid.org')

or you may get back an ID:

>>> local_gcp = LocalGlobusConnectPersonal()
>>> local_gcp.get_owner_info()
GlobusConnectPersonalOwnerInfo(id='7deda7cc-077b-11ec-a137-67523ecffd4b')

Check the result easily by looking to see if these values are None:

>>> local_gcp = LocalGlobusConnectPersonal()
>>> info = local_gcp.get_owner_info()
>>> has_username = info.username is not None
property endpoint_id: Optional[str]
Type

str

The endpoint ID of the local Globus Connect Personal endpoint installation.

This value is loaded whenever it is first accessed, but saved after that.

Note

This attribute is not checked for accuracy. It is possible for a user to modify the files used by GCP to list a different endpoint_id.

Usage:

>>> from globus_sdk import TransferClient, LocalGlobusConnectPersonal
>>> local_ep = LocalGlobusConnectPersonal()
>>> ep_id = local_ep.endpoint_id
>>> tc = TransferClient(...)  # needs auth details
>>> for f in tc.operation_ls(ep_id):
>>>     print("Local file: ", f["name"])

You can also reset the value, causing it to load again on next access, with del local_ep.endpoint_id

class globus_sdk.GlobusConnectPersonalOwnerInfo(*, config_dn: str)[source]

Information about the owner of the local Globus Connect Personal endpoint.

Users should never create these objects directly, but instead rely upon LocalGlobusConnectPersonal.get_owner_info().

The info object contains ether id or username. Parsing an info object from local data cannot guarantee that the id or username value will be found. Whichever one is present will be set and the other attribute will be None.

Variables
  • id (str or None) – The Globus Auth ID of the endpoint owner

  • username (str or None) – The Globus Auth Username of the endpoint owner

Parameters

config_dn (str) – A DN value from GCP configuration, which will be parsed into username or ID