Python equivalent of `globus gcp create mapped`
globus gcp create mapped creates a new collection for use with GCP but without needing GCP to be already running. There is seemingly no way to do this in globus_sdk==4.1.0 that I have found.
If I look at how the CLI does it, it apparently calls some deprecated API.
There is a similar method called TransferClient.create_shared_endpoint available, but this seems to require a "host_endpoint", which isn't what I want:
result = globus_sdk.TransferClient(
app=app
).create_shared_endpoint(data=dict(
display_name="XXX",
)
)
{
"code": "BadRequest",
"message": "invalid host_endpoint, cannot be empty string, null, or missing",
"request_id": "XXXXXXXX",
"resource": "/shared_endpoint"
}
If I try to bypass the abstractions and hit the API directly, it still doesn't work for me:
result = globus_sdk.TransferClient(
app=app
).post(
"/v0.10/endpoint",
data=dict(
display_name="XXX",
)
)
{
"code": "NotSupported",
"message": "GCSv4 is no longer supported. Contact your sysadmin.",
"request_id": "XXXXXXXX",
"resource": "/endpoint"
}
What should I do here?
Update. This does work, but it feels like a hack:
result = globus_sdk.TransferClient(
app=app
).post("/v0.10/endpoint", data=dict(
display_name="XXX",
DATA_TYPE="endpoint",
is_globus_connect=True,
)
)
Hi there! Sorry about the delay -- getting you a reply was on the docket but got a little bit lost.
I need to check with the Transfer API maintainers to ask them what they want us to direct users towards in the SDK here. It's possible that we'll simply un-deprecate the POST /v0.10/endpoint method, since I think that's the only option that works today.
For some broader context, there are two other codepaths which are related to this:
- What GCP itself calls on startup. This uses an API explicitly flagged as "private" -- it's not for general use and my understanding is that we don't support users calling it themselves or document its usage.
- GCSv4 Creation. This is a completely dead feature -- fully deprecated and removed from the service. But, notably, it used the same
POST /v0.10/endpointpath which GCP Mapped Collections use.
We are committed to maintaining support for globus gcp create mapped, so I don't think you're in any particular danger of things breaking in the short term if you integrate in the way that you are doing now. But it's possible that there is or will be a new way of doing this, and we'll have to update the CLI and provide docs/guidance for doing the equivalent in the SDK.