GCO Cost Monitor — API spec sheet¶
Service cost-monitor · OpenAPI 3.1.0 · API version 1.0.0 · 5 endpoints · 3 schemas
Scheduled and on-demand OpenCost allocation reporting
- Machine-readable document:
docs/openapi/cost-monitor.json— the FastAPIapp.openapi()export (scripts/generate_openapi.py) this sheet is rendered from - Interactive console (Swagger UI): https://aws-solutions-library-samples.github.io/global-capacity-orchestrator-on-aws/swagger/cost-monitor/
- Catalogue index: README.md · interaction diagram
Endpoints¶
| Method | Path | Summary | Tags |
|---|---|---|---|
GET |
/healthz |
Kubernetes Health Check | Health |
GET |
/internal/reports |
List Reports | Cost |
POST |
/internal/reports |
Generate Adhoc Report | Cost |
GET |
/internal/status |
Get Status | Cost |
GET |
/readyz |
Kubernetes Readiness Check | Health |
Endpoint details¶
GET /healthz¶
Kubernetes-style liveness probe.
- Operation ID:
kubernetes_health_check_healthz_get - Tags: Health
Responses
| Status | Description | Content |
|---|---|---|
200 |
Successful Response | application/json: object of string |
GET /internal/reports¶
List this region's most recent report objects, newest first.
- Operation ID:
list_reports_internal_reports_get - Tags: Cost
Parameters
| Name | In | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|---|
adhoc |
query | boolean | no | false |
— | List ad-hoc instead of scheduled reports |
limit |
query | integer | no | 50 |
≥ 1; ≤ 1000 | Maximum objects returned |
Responses
| Status | Description | Content |
|---|---|---|
200 |
Successful Response | application/json: object (free-form) |
422 |
Validation Error | application/json: HTTPValidationError |
POST /internal/reports¶
Generate one ad-hoc allocation report for the trailing window.
- Operation ID:
generate_adhoc_report_internal_reports_post - Tags: Cost
Request body (required): application/json: AdhocReportRequest
Responses
| Status | Description | Content |
|---|---|---|
201 |
Successful Response | application/json: object (free-form) |
422 |
Validation Error | application/json: HTTPValidationError |
GET /internal/status¶
Service status including OpenCost health and the data-returning probe.
- Operation ID:
get_status_internal_status_get - Tags: Cost
Responses
| Status | Description | Content |
|---|---|---|
200 |
Successful Response | application/json: object (free-form) |
GET /readyz¶
Readiness requires the monitor plus a live scheduled-report task.
- Operation ID:
kubernetes_readiness_check_readyz_get - Tags: Health
Responses
| Status | Description | Content |
|---|---|---|
200 |
Successful Response | application/json: object of string |
Schemas¶
AdhocReportRequest¶
Request body for POST /internal/reports.
| Property | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
include_rows |
boolean | no | false |
— | Include the normalized allocation rows in the response |
window_hours |
integer | no | 24 |
≥ 1.0; ≤ 168.0 | Trailing window the report covers, in hours |
HTTPValidationError¶
| Property | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
detail |
array of ValidationError |
no | — | — | — |
ValidationError¶
| Property | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
ctx |
object | no | — | — | — |
input |
any | no | — | — | — |
loc |
array of string or integer | yes | — | — | — |
msg |
string | yes | — | — | — |
type |
string | yes | — | — | — |