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)¶
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.
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
- property config_dir: str¶
config_dirfor 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'] ¶
- 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
GlobusConnectPersonalOwnerInfoobject. The result may have an
usernameset (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
Noneif the data is missing or cannot be parsed.
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.
auth_client (globus_sdk.AuthClient) – An AuthClient to use to lookup the full identity information for the GCP owner
Getting a username:
>>> from globus_sdk import LocalGlobusConnectPersonal >>> local_gcp = LocalGlobusConnectPersonal() >>> local_gcp.get_owner_info() GlobusConnectPersonalOwnerInfo(firstname.lastname@example.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
>>> local_gcp = LocalGlobusConnectPersonal() >>> info = local_gcp.get_owner_info() >>> has_username = info.username is not None
- property endpoint_id: Optional[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.
This attribute is not checked for accuracy. It is possible for a user to modify the files used by GCP to list a different
>>> 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
- class globus_sdk.GlobusConnectPersonalOwnerInfo(*, config_dn: str)¶
Information about the owner of the local Globus Connect Personal endpoint.
Users should never create these objects directly, but instead rely upon
The info object contains ether
username. Parsing an info object from local data cannot guarantee that the
usernamevalue will be found. Whichever one is present will be set and the other attribute will be