Skip to content

API reference

Capacity (operators) API

For the people who run the service: the capacity loop's decisions, the budget guard, and the server purchases waiting for approval. These routes need the operator token.

On this page

List capacity decisions (operators)

GET /v1/operator/capacity/decisions

The capacity loop's decisions, newest first.

  • Authentication: none on this route.
  • Who: Service operators (operator token).

Parameters

NameInTypeRequiredDescription
limitqueryintegerNo1-200, default 50.
beforequeryintegerNoOnly decisions older than this ID.
X-VMYard-Operator-TokenheaderstringYesOperator token from the service configuration

Responses

StatusDescriptionBody
200—CapacityDecisionPage
401Not signed in, or the API key is malformed, expired, or revoked (unauthenticated, invalid_api_key).ProblemDetails
404operator routes are not configuredProblemDetails
422Invalid request (invalid_request); field_errors names the fields.ProblemDetails
Request
curl "$VMYARD_API_URL/v1/operator/capacity/decisions" \
  -H "X-VMYard-Operator-Token: $X_VMYARD_OPERATOR_TOKEN"
Response 200
{
  "decisions": [
    {
      "action": "string",
      "at": "string",
      "dry_run": false,
      "facts": {},
      "id": 0,
      "outcome": "string",
      "reason": "string",
      "region": "string",
      "server_id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f"
    }
  ],
  "next_before": 0
}

Read the capacity budget (operators)

GET /v1/operator/capacity/budget

What the budget guard allows now.

  • Authentication: none on this route.
  • Who: Service operators (operator token).

Parameters

NameInTypeRequiredDescription
X-VMYard-Operator-TokenheaderstringYesOperator token from the service configuration

Responses

StatusDescriptionBody
200—CapacityBudgetDto
401Not signed in, or the API key is malformed, expired, or revoked (unauthenticated, invalid_api_key).ProblemDetails
404operator routes or the capacity loop are not configuredProblemDetails
Request
curl "$VMYARD_API_URL/v1/operator/capacity/budget" \
  -H "X-VMYard-Operator-Token: $X_VMYARD_OPERATOR_TOKEN"
Response 200
{
  "allowance_micros": 0,
  "approval_threshold_micros": 0,
  "ceiling_micros": 0,
  "committed_monthly_micros": 0,
  "launch_floor_micros": 0,
  "revenue_30d_micros": 0,
  "revenue_share_bps": 0,
  "spend_30d_micros": 0
}

List purchases waiting for approval (operators)

GET /v1/operator/capacity/approvals

Purchases waiting for an operator's approval, oldest first.

  • Authentication: none on this route.
  • Who: Service operators (operator token).

Parameters

NameInTypeRequiredDescription
X-VMYard-Operator-TokenheaderstringYesOperator token from the service configuration

Responses

StatusDescriptionBody
200—CapacityApprovalList
401Not signed in, or the API key is malformed, expired, or revoked (unauthenticated, invalid_api_key).ProblemDetails
404operator routes are not configuredProblemDetails
Request
curl "$VMYARD_API_URL/v1/operator/capacity/approvals" \
  -H "X-VMYard-Operator-Token: $X_VMYARD_OPERATOR_TOKEN"
Response 200
{
  "approvals": [
    {
      "billing": "string",
      "decided_by": "string",
      "host_id": "string",
      "id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
      "monthly_cost_micros": 0,
      "note": "string",
      "provider": "github",
      "reason": "string",
      "region": "string",
      "requested_at": "string",
      "setup_cost_micros": 0,
      "slots": 0,
      "state": "string"
    }
  ]
}

Approve a server purchase (operators)

POST /v1/operator/capacity/approvals/{purchase_id}/approve

Approve a waiting purchase; the capacity loop orders it on its next pass if the budget rules still allow it.

  • Authentication: none on this route.
  • Who: Service operators (operator token).

Parameters

NameInTypeRequiredDescription
purchase_idpathstring (uuid)Yes
X-VMYard-Operator-TokenheaderstringYesOperator token from the service configuration

Request body (application/json, CapacityApprovalRequest)

FieldTypeRequiredDescription
operatorstringYesThe operator deciding, recorded with the decision (1-100 characters).
notestring | nullNoOptional note recorded with the decision (at most 500 characters).

Responses

StatusDescriptionBody
200—CapacityPurchaseDto
401Not signed in, or the API key is malformed, expired, or revoked (unauthenticated, invalid_api_key).ProblemDetails
404operator routes are not configured or the purchase is unknownProblemDetails
409the purchase is no longer waiting for approvalProblemDetails
422Invalid request (invalid_request); field_errors names the fields.ProblemDetails
Request
curl -X POST "$VMYARD_API_URL/v1/operator/capacity/approvals/$PURCHASE_ID/approve" \
  -H "X-VMYard-Operator-Token: $X_VMYARD_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operator": "string"
}'
Response 200
{
  "billing": "string",
  "decided_by": "string",
  "host_id": "string",
  "id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
  "monthly_cost_micros": 0,
  "note": "string",
  "provider": "github",
  "reason": "string",
  "region": "string",
  "requested_at": "string",
  "setup_cost_micros": 0,
  "slots": 0,
  "state": "string"
}

Reject a server purchase (operators)

POST /v1/operator/capacity/approvals/{purchase_id}/reject

Reject a waiting purchase; nothing is bought.

  • Authentication: none on this route.
  • Who: Service operators (operator token).

Parameters

NameInTypeRequiredDescription
purchase_idpathstring (uuid)Yes
X-VMYard-Operator-TokenheaderstringYesOperator token from the service configuration

Request body (application/json, CapacityApprovalRequest)

FieldTypeRequiredDescription
operatorstringYesThe operator deciding, recorded with the decision (1-100 characters).
notestring | nullNoOptional note recorded with the decision (at most 500 characters).

Responses

StatusDescriptionBody
200—CapacityPurchaseDto
401Not signed in, or the API key is malformed, expired, or revoked (unauthenticated, invalid_api_key).ProblemDetails
404operator routes are not configured or the purchase is unknownProblemDetails
409the purchase is no longer waiting for approvalProblemDetails
422Invalid request (invalid_request); field_errors names the fields.ProblemDetails
Request
curl -X POST "$VMYARD_API_URL/v1/operator/capacity/approvals/$PURCHASE_ID/reject" \
  -H "X-VMYard-Operator-Token: $X_VMYARD_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operator": "string"
}'
Response 200
{
  "billing": "string",
  "decided_by": "string",
  "host_id": "string",
  "id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
  "monthly_cost_micros": 0,
  "note": "string",
  "provider": "github",
  "reason": "string",
  "region": "string",
  "requested_at": "string",
  "setup_cost_micros": 0,
  "slots": 0,
  "state": "string"
}