Skip to content

feat(core): instance events command and getInstanceEvents - #172

Merged
birme merged 1 commit into
mainfrom
feat-instance-events-command
Nov 11, 2026
Merged

birme merged 1 commit into
mainfrom
feat-instance-events-command

Conversation

@birme

@birme birme commented Nov 11, 2026

Copy link
Copy Markdown
Member

Part of Eyevinn/osaas-deploy-manager#2146 (part of Eyevinn/osaas-deploy-manager#2043). Cross-repo, so no closing keyword.

What changed

  • @osaas/client-core: new getInstanceEvents(ctx, serviceId, name, { from, to, type, limit, cursor }) calling GET https://deploy.svc.<env>.osaas.io/myinstances/{serviceId}/{name}/events with x-pat-jwt. type is sent comma-separated; each parameter is sent only when given. Exports InstanceEvent, InstanceEventsResponse, InstanceEventsOptions (enumerated fields typed as string).
  • @osaas/cli: new events <serviceId> <name> command with --from, --to, --type, --limit, --cursor. Prints capturedSince and retentionDays, a truncation notice with oldestRetainedAt when truncated, one line per event, and the nextCursor with a --cursor hint. --json prints the raw response. --help explains the HA standby slot <name>b.
  • Tests for each flag pass-through, the no-flag path, truncated and not truncated, cursor output, and the help text. README command list updated.

Verified against the route in Eyevinn/osaas-deploy-manager src/api_instances.ts (merged in #2147, 89dee56): x-pat-jwt auth, query from|to|type|limit|cursor, 404 when no history recorded (the CLI prints the error message like the other commands).

Usage

osc events eyevinn-web-runner myapp --type crash,oom --limit 20
osc events eyevinn-web-runner myapp --cursor <nextCursor from previous page>

Changes for existing consumers: none (new function and command; no existing export changed; no new dependency, package.json and lockfile unchanged; no version bump).

What a human does next: release the packages when ready (not done here), then osc events <serviceId> <name> against an instance that has history; expect the header line and event lines.

Lessons

createFetch throws on the route's 404 "no history recorded", so a never-recorded instance prints an error message rather than an empty list, matching the other commands. commander helpInformation() wraps descriptions, so help-text assertions must match short phrases, not whole sentences.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

@birme birme self-assigned this Nov 11, 2026
@birme
birme merged commit 4e86664 into main Nov 11, 2026
1 check passed
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.

1 participant