Skip to content

Use new spaceUsage endpoint in place of deprecated spaceStatus#17

Merged
murrayju merged 2 commits into
mainfrom
murrayju/use-usage-endpoint
May 22, 2026
Merged

Use new spaceUsage endpoint in place of deprecated spaceStatus#17
murrayju merged 2 commits into
mainfrom
murrayju/use-usage-endpoint

Conversation

@murrayju
Copy link
Copy Markdown
Member

@murrayju murrayju commented May 22, 2026

Updates the CLI to call the new GET /spaces/{space_id}/usage endpoint introduced in timescale/ghost-api#16, replacing the now-deprecated GET /spaces/{space_id}/status endpoint. Also renames the internal helper to match.

Changes

  • openapi.yaml — synced from ghost-api to pick up the new spaceUsage operation. The deprecated spaceStatus operation remains as an alias.
  • internal/api/{client,types}.go, internal/api/mock/mock_client.go — regenerated via go generate ./....
  • internal/common/{status.go → usage.go} — file renamed; FetchStatusFetchUsage, Status struct → Usage. Now calls SpaceUsageWithResponse and reads *api.SpaceUsage.
  • internal/cmd/usage.go, internal/mcp/usage.go — updated callers and local variable names.
  • internal/cmd/usage_test.go — mock expectations and test case names updated.

Verification

./check passes.

Copy link
Copy Markdown
Member

@nathanjcochran nathanjcochran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broadly LGTM, though I think there a few more internal things we should rename as well

Comment thread internal/common/status.go Outdated
@murrayju murrayju merged commit 3673155 into main May 22, 2026
2 checks passed
@murrayju murrayju deleted the murrayju/use-usage-endpoint branch May 22, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants