1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
.. _services:
Service Clients
===============
.. currentmodule:: globus_sdk
The Globus SDK provides a client class for every public Globus API.
Each client object takes authentication credentials via
:ref:`GlobusAuthorizers <globus_authorizers>`.
Once instantiated, a Client gives you high-level interface to make API calls,
without needing to know Globus API endpoints or their various parameters.
For example, you could use the :class:`TransferClient` to list your task history
very simply:
.. code-block:: python
from globus_sdk import TransferClient, AccessTokenAuthorizer
# you must have a valid transfer token for this to work
tc = TransferClient(authorizer=AccessTokenAuthorizer("TRANSFER_TOKEN_STRING"))
print("My Last 25 Tasks:")
# `filter` to get Delete Tasks (default is just Transfer Tasks)
for task in tc.task_list(limit=25, filter="type:TRANSFER,DELETE"):
print(task["task_id"], task["type"], task["status"])
.. note:: Multi-Thread and Multi-Process Safety
Each Globus SDK client class holds a networking session object to interact
with the Globus API. Using a previously created service client object after
forking or between multiple threads should be considered unsafe. In
multi-processing applications, it is recommended to create service client
objects after process forking and to ensure that there is only one service
client instance created per process.
.. toctree::
:caption: Service Clients
:maxdepth: 1
auth
compute
flows
groups
search
timers
transfer
gcs
|