Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.d/20260217_134541_aaschaer_transfer_api_v2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Bugfixes

* `globus api transfer` no longer prepends `/v0.10/` to `/v2/` paths
4 changes: 3 additions & 1 deletion src/globus_cli/commands/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@ def _execute_service_command(
if path.startswith("/"):
path = path[1:]
path = f"/v2/{path}"
if isinstance(client, globus_sdk.TransferClient) and not path.startswith("/v0.10/"):
if isinstance(client, globus_sdk.TransferClient) and not (
path.startswith(("/v0.10/", "/v2/"))
):
if path.startswith("/"):
path = path[1:]
path = f"/v0.10/{path}"
Expand Down
14 changes: 14 additions & 0 deletions tests/functional/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,20 @@ def test_api_command_get(run_line, service_name, add_gcs_login, is_error_respons
assert result.output == '{"foo": "bar"}\n'


def test_api_transfer_v2_command(run_line):
load_response(
RegisteredResponse(
service="transfer",
status=200,
path="/v2/foo",
json={"foo": "bar"},
)
)

result = run_line(["globus", "api", "transfer", "get", "/v2/foo"])
assert result.output == '{"foo": "bar"}\n'


def test_api_groups_v2_path_stripping(run_line):
load_response(
RegisteredResponse(
Expand Down