Skip to content

[add endpoint] Add cloudos analytics team-summary command for GET /api/v1/analytics/team/summary#365

Draft
danielboloc with Copilot wants to merge 2 commits into
mainfrom
copilot/sync-cloudos-cli-api-change-again
Draft

[add endpoint] Add cloudos analytics team-summary command for GET /api/v1/analytics/team/summary#365
danielboloc with Copilot wants to merge 2 commits into
mainfrom
copilot/sync-cloudos-cli-api-change-again

Conversation

Copilot AI commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Syncs cloudos-cli with a new API endpoint that returns aggregated team usage analytics (compute hours, job counts, spend) over a date range.

Overview

Adds cloudos analytics team-summary — a new command group and subcommand wrapping GET /api/v1/analytics/team/summary.

cloudos analytics team-summary \
  --apikey $APIKEY \
  --cloudos-url https://cloudos.lifebit.ai \
  --team-id <workspace-id> \
  --start-date 2024-01-01 \
  --end-date 2024-12-31 \
  --granularity monthly

JIRA

Changes

  • Adds cloudos_cli/analytics/ module: Analytics dataclass (extends Cloudos) with get_team_summary(team_id, start_date, end_date, granularity)
  • Adds cloudos analytics team-summary Click command with --team-id (required), --start-date, --end-date, --granularity (optional), --output-format [stdout|json]
  • Registers analytics command group in __main__.py
  • Adds supported-endpoints.json mapping analytics-team-summary → endpoint metadata
  • Bumps version 2.91.02.91.1; adds CHANGELOG entry
  • Adds 8 pytest tests (unit + CLI) covering happy path, optional param passthrough, and 400/401 error handling

Acceptance Criteria

Scenario 1 - team-summary returns analytics data to stdout
cloudos analytics team-summary \
  --apikey $APIKEY \
  --cloudos-url $CLOUDOS_URL \
  --team-id $TEAM_ID \
  --start-date 2024-01-01 \
  --end-date 2024-12-31 \
  --granularity monthly

Expected: JSON with computeHours, jobCount, spend fields printed to stdout.

Scenario 2 - team-summary saves output to file with --output-format json
cloudos analytics team-summary \
  --apikey $APIKEY \
  --cloudos-url $CLOUDOS_URL \
  --team-id $TEAM_ID \
  --output-format json \
  --output-basename my_summary

Expected: my_summary.json created with API response body.

Scenario 3 - bad API key returns non-zero exit with error message

Expected: BadRequestException raised, non-zero exit code, error message containing status code.

DEV

Proof this feature/patch works in this environment

AZURE

Proof this feature/patch works in this environment

Interactive Analysis

Proof this feature/patch works in this environment

Copilot AI changed the title [WIP] Update cloudos-cli for GET /api/v1/analytics/team/summary Add cloudos analytics team-summary command for GET /api/v1/analytics/team/summary Jun 19, 2026
Copilot AI requested a review from danielboloc June 19, 2026 14:01
@danielboloc danielboloc changed the title Add cloudos analytics team-summary command for GET /api/v1/analytics/team/summary [add endpoint] Add cloudos analytics team-summary command for GET /api/v1/analytics/team/summary Jun 19, 2026
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