Handling Collections vs Endpoints
Within the Globus ecosystem, Endpoints and Collections are very closely related, but distinct, entities. While some applications are able to make them appear similar or even identical for some cases, when interacting via the CLI it becomes important to distinguish them.
In Globus Connect Personal, the ID of the endpoint is used for management and data transfer. However, for Globus Connect Server, the Endpoint and Collection are distinct entities. The Endpoint is used for some operations like collection listing, but the Collection is used for many management capabilities and data transfers.
For a more full explanation of these terms, see the v5 terminology documentation.
Different Object Types
Which command do you use for which type of object?
- Globus Connect Personal
-
Manage with
globus endpoint
commands.
Under Globus Connect Personal, the Endpoint and the Collection are the same object.
If 5e025a81-899c-4d57-b351-db824e114e3e
is the ID of a Globus Connect Personal,
the following command should be used to display it:
globus endpoint show 5e025a81-899c-4d57-b351-db824e114e3e
And this command would set the description
globus endpoint update 5e025a81-899c-4d57-b351-db824e114e3e \
--description "Foo"
- Globus Connect Server Endpoint
-
Limited management capabilities.
Under Globus Connect Server, the Endpoint and the Collection are
distinct. However, for full management of a Globus Connect Server
Endpoint, you must use the globus-connect-server
command from the Endpoint
itself.
If 5e025a81-899c-4d57-b351-db824e114e3e
is the ID of a Globus Connect Server,
the following command should be used to display it:
globus endpoint show 5e025a81-899c-4d57-b351-db824e114e3e
However, the Globus CLI does not support modifying the Endpoint in this case.
- Mapped or Guest Collection
-
Manage with
globus collection
commands.
Under Globus Connect Server, the Endpoint and the Collection are distinct. Management of the Collection objects is supported by the Globus CLI.
If 5e025a81-899c-4d57-b351-db824e114e3e
is the ID of a Mapped Collection or Guest Collection,
the following command should be used to display it:
globus collection show 5e025a81-899c-4d57-b351-db824e114e3e
And this command would set the description
globus collection update 5e025a81-899c-4d57-b351-db824e114e3e \
--description "Foo"
Inspecting Entity Type
You can always retrieve the entity_type
field from an endpoint or collection
by using globus api
command with the --jmespath
option like so:
globus api transfer GET /endpoint/${OBJECT_ID} --jmespath 'entity_type'
This command makes direct use of Globus Transfer API to fetch the object and extract the field which describes the type of object.
Globus CLI Handling of Endpoint vs Collection
For a CLI user, you may not know if an object is a v5 Endpoint, a v4 Endpoint, or a Collection. And, unfortunately, that information is necessary for the correct execution of Globus CLI commands.
Collections under Globus Connect Server require that the user logs in
against the Endpoint which hosts the collections in order to perform management
functions. That is, collection update
, collection list
, and similar
operations require authentication against the Endpoint.
For this reason, these operations are not supported by the equivalent
globus endpoint
commands.
In the best case, you know that you are using a collection, not an endpoint, and can run the appropriate command. As in:
$ globus collection update 83567b16-478d-4ead-a486-645bab0b07dc \
--description 'My Mapped Collection'
code: success
However, there are two interesting scenarios to discuss…
Using an endpoint
command on a collection
The endpoint
and collection
commands understand that
globus endpoint update
is analogous to globus collection update
. Therefore,
when a command is used, but against the wrong type of object, an appropriate
error message will be shown.
For example, if a collection ID with globus endpoint update
, the following
error message appears:
$ globus endpoint update 83567b16-478d-4ead-a486-645bab0b07dc \
--description 'My Mapped Collection'
Expected 83567b16-478d-4ead-a486-645bab0b07dc to be an endpoint ID.
Instead, found it was of type 'Mapped Collection'.
Please run the following command instead:
globus collection update 83567b16-478d-4ead-a486-645bab0b07dc
This message tells us that the ID 83567b16-478d-4ead-a486-645bab0b07dc
refers to
a collection, and therefore needs to be updated with the globus collection update
command.
The same holds in reverse. If globus collection update
is used with an
endpoint ID, a similar error will be shown.
Required Logins
globus collection update
may, or may not, succeed depending on whether or not
the user has already logged in to the Endpoint which hosts the Collection. This
only needs to be done once per-login-per-endpoint, but the first time a command
is run which interacts with an endpoint, it will fail.
In the case that the Endpoint has not been used, any command which uses it will return a new error, instructing the user to login to the Endpoint. For example:
$ globus collection update 83567b16-478d-4ead-a486-645bab0b07dc \
--description 'My Mapped Collection'
MissingLoginError: Missing login for 60ffc8ad-7227-4d9b-885e-19bdb16e52fa, please run
globus login --gcs 60ffc8ad-7227-4d9b-885e-19bdb16e52fa
In this case, the new login is needed, after which the collection update
will
succeed:
$ globus login --gcs 60ffc8ad-7227-4d9b-885e-19bdb16e52fa
... # a prompt for login will be shown, and the user logs in
You have successfully logged in to the Globus CLI!
You can check your primary identity with
globus whoami
For information on which of your identities are in session use
globus session show
Logout of the Globus CLI with
globus logout
# now run the update
$ globus collection update 83567b16-478d-4ead-a486-645bab0b07dc \
--description 'My Mapped Collection'
code: success