Implement qrun status with Voyage API #43

Open
opened 2026-01-03 23:45:50 +00:00 by KofTwentyTwo · 0 comments
KofTwentyTwo commented 2026-01-03 23:45:50 +00:00 (Migrated from github.com)

User Story

As a developer, I want to check the status of my deployed application so I can verify it's running correctly and see current replica counts and health.

Design

Command Interface

# Basic status
qrun status --app orders-service --env prod

# JSON output for scripting
qrun status --app orders-service --env prod --output json

# Watch mode (refresh every 5s)
qrun status --app orders-service --env prod --watch

Output Format

Application: orders-service
Environment: prod
Status: Running
Version: 1.2.3 (deployed 2h ago)
Replicas: 3/3 ready
Health: Healthy

Instances:
  orders-service-abc12  Running  10.0.1.5   2h    healthy
  orders-service-def34  Running  10.0.1.6   2h    healthy
  orders-service-ghi56  Running  10.0.1.7   2h    healthy

Resources:
  CPU: 45% (limit: 2 cores)
  Memory: 512Mi / 1Gi (51%)

Voyage API Integration

GET /v1/apps/{app}/status?env={env}

Response:
{
  "app": "orders-service",
  "environment": "prod",
  "status": "running",
  "version": "1.2.3",
  "deployedAt": "2024-01-15T10:30:00Z",
  "replicas": { "ready": 3, "desired": 3 },
  "health": "healthy",
  "instances": [...],
  "resources": { "cpu": {...}, "memory": {...} }
}

Files to Create/Modify

File Action Purpose
qctl-qrun/src/main/java/io/qrun/qctl/qrun/StatusCommand.java Create Main status command
qctl-qrun/src/main/java/io/qrun/qctl/qrun/model/AppStatus.java Create Status response model
qctl-qrun/src/main/java/io/qrun/qctl/qrun/model/Instance.java Create Instance info model
qctl-qrun/src/main/java/io/qrun/qctl/qrun/client/VoyageClient.java Modify Add getAppStatus()
qctl-qrun/src/main/java/io/qrun/qctl/qrun/format/StatusFormatter.java Create Output formatting

Implementation Tasks

  • Create StatusCommand with Picocli annotations
  • Add --app, --env, --output, --watch options
  • Create AppStatus and Instance model classes
  • Implement VoyageClient.getAppStatus() method
  • Create StatusFormatter for table/JSON output
  • Implement watch mode with configurable interval
  • Add health status color coding (green/yellow/red)
  • Handle offline/unreachable scenarios gracefully
  • Write unit tests for StatusCommand
  • Write unit tests for StatusFormatter

Acceptance Criteria

  • qrun status --app <app> --env <env> shows current status
  • Output includes replicas, health, version, and resource usage
  • --output json produces valid JSON for scripting
  • --watch refreshes status every 5 seconds
  • Clear error message when app not found
  • Works with Voyage mock API
## User Story As a developer, I want to check the status of my deployed application so I can verify it's running correctly and see current replica counts and health. ## Design ### Command Interface ```bash # Basic status qrun status --app orders-service --env prod # JSON output for scripting qrun status --app orders-service --env prod --output json # Watch mode (refresh every 5s) qrun status --app orders-service --env prod --watch ``` ### Output Format ``` Application: orders-service Environment: prod Status: Running Version: 1.2.3 (deployed 2h ago) Replicas: 3/3 ready Health: Healthy Instances: orders-service-abc12 Running 10.0.1.5 2h healthy orders-service-def34 Running 10.0.1.6 2h healthy orders-service-ghi56 Running 10.0.1.7 2h healthy Resources: CPU: 45% (limit: 2 cores) Memory: 512Mi / 1Gi (51%) ``` ### Voyage API Integration ``` GET /v1/apps/{app}/status?env={env} Response: { "app": "orders-service", "environment": "prod", "status": "running", "version": "1.2.3", "deployedAt": "2024-01-15T10:30:00Z", "replicas": { "ready": 3, "desired": 3 }, "health": "healthy", "instances": [...], "resources": { "cpu": {...}, "memory": {...} } } ``` ## Files to Create/Modify | File | Action | Purpose | |------|--------|---------| | `qctl-qrun/src/main/java/io/qrun/qctl/qrun/StatusCommand.java` | Create | Main status command | | `qctl-qrun/src/main/java/io/qrun/qctl/qrun/model/AppStatus.java` | Create | Status response model | | `qctl-qrun/src/main/java/io/qrun/qctl/qrun/model/Instance.java` | Create | Instance info model | | `qctl-qrun/src/main/java/io/qrun/qctl/qrun/client/VoyageClient.java` | Modify | Add getAppStatus() | | `qctl-qrun/src/main/java/io/qrun/qctl/qrun/format/StatusFormatter.java` | Create | Output formatting | ## Implementation Tasks - [ ] Create StatusCommand with Picocli annotations - [ ] Add --app, --env, --output, --watch options - [ ] Create AppStatus and Instance model classes - [ ] Implement VoyageClient.getAppStatus() method - [ ] Create StatusFormatter for table/JSON output - [ ] Implement watch mode with configurable interval - [ ] Add health status color coding (green/yellow/red) - [ ] Handle offline/unreachable scenarios gracefully - [ ] Write unit tests for StatusCommand - [ ] Write unit tests for StatusFormatter ## Acceptance Criteria - [ ] `qrun status --app <app> --env <env>` shows current status - [ ] Output includes replicas, health, version, and resource usage - [ ] `--output json` produces valid JSON for scripting - [ ] `--watch` refreshes status every 5 seconds - [ ] Clear error message when app not found - [ ] Works with Voyage mock API
Sign in to join this conversation.