Use the REST API
Every HTTP resource has a name under /api/v1/. Project-scoped resource names start with projects/{project}/. Use this guide for a first request; use the REST contract for wire semantics or download the OpenAPI 3.1 specification for a client generator.
Make a read-only request
Start a development cell and set VELSTRA_API and VELSTRA_TOKEN in the shell. The development token is a cell operator.
curl -fsS -H "Authorization: Bearer $VELSTRA_TOKEN" \
"$VELSTRA_API/api/v1/projects/p1/instances/web-1" \
| jq '{name: .meta.name, requested: .spec.desiredState, conditions: .status.conditions}'
A resource separates the desired configuration under spec from observations under status. Accepted writes can take more than one reconciliation pass to appear there.
Ask a question without changing state
curl -fsS -H "Authorization: Bearer $VELSTRA_TOKEN" \
"$VELSTRA_API/api/v1/projects/p1/instances/too-big:explainPlacement" \
| jq '.rejected[] | {node, why, detail}'
The response names each host rejected for this request. Host-level placement details require the operator role. See VM placement.
Choose a reference
| Need | Resource |
|---|---|
| Resource naming, lists, filters and paging | Names and shapes |
| Permission model and project boundaries | Who may do what |
| Conflict handling and idempotency | Client rules |
| Waiting for asynchronous creation or deletion | Long-running operations |
| Diagnosing API errors | Errors |
| Authentication for an integration | Sessions and passwords · Service accounts |
| Schemas for the running build | GET /api/v1/openapi.json |