API Lifecycle
Openapi
Use this workflow to keep local API understanding aligned with Rackspace Spot upstream changes.
What Is Generated
openapi/openapi.json: full schema snapshotopenapi/metadata.json: source URL, fetch timestamp, version/title metadatasrc/rsspot/generated/openapi_index.py: lightweight operation inventory (OPERATIONSlist)
1. Sync Schema Snapshot
uv run python scripts/sync_openapi.py
Optional controls:
uv run python scripts/sync_openapi.py \
--url https://spot.rackspace.com/openapi/v2 \
--out openapi/openapi.json \
--metadata openapi/metadata.json
Environment fallbacks used by sync_openapi.py:
- URL priority:
--url->RSSPOT_OPENAPI_URL-> default candidates - Auth token:
RSSPOT_ACCESS_TOKENorRACKSPACE_ACCESS_TOKEN
2. Rebuild Operation Index
uv run python scripts/generate_openapi_index.py
The script reads paths from the schema and writes an operation list with:
operation_id(or generated fallback)methodpathsummary
3. Review and Diff
git diff -- openapi/openapi.json openapi/metadata.json src/rsspot/generated/openapi_index.py
Recommended review checklist:
- New/removed paths and methods
- Renamed operation ids
- Endpoint semantics that require SDK model/service updates
- Backward-compatibility implications for CLI commands
Handling Upstream Breakage
If sync fails or response shape changes:
- Retry with explicit
--urland known-good token. - Inspect response status/body from
sync_openapi.pyerror output. - Keep previous committed schema while investigating to avoid partial updates.
- Update service/model coverage only after schema diff is understood.
Maintainer Cadence
Use this pipeline before releases and whenever Spot API behavior appears changed in production.