Logo
OpenScaler

List Computers with snapshots

GET
/v1/snapshots

List Computers in a project that currently have at least one snapshot. Rows are driven by vm_snapshot_cache (existence = has snapshots).

Authorization

bearer_auth
AuthorizationBearer <token>

Authentication

Create an API token on Profile, or with osctl auth login. Send it in the Authorization header:

Authorization: Bearer os1_...

Do not use the Keycloak web-session JWT as an API token. Keep the secret secure and do not share it.

In: header

Query Parameters

project_id*string

ID of the project used to filter results.

page*integer

Page number (1-based).

Range1 <= value
page_size*integer

Number of Computers per page (1–100).

Range1 <= value <= 100
filter?string

Case-insensitive substring match on Computer name.

order_by?string
Default"snapshot_count"

Value in

  • "name"
  • "snapshot_count"
  • "total_size_gib"
  • "created_at"
order_dir?string
Default"desc"

Value in

  • "asc"
  • "desc"

Response Body

application/json

application/json

text/pain

application/json

application/json

curl -X GET "https://example.com/v1/snapshots?project_id=default&page=1&page_size=10"
{  "computers": [    {      "vm_id": "9a025db5-7896-46f6-883f-28fe3549d7b4",      "name": "string",      "status": "string",      "region": "string",      "snapshot_count": 1,      "total_size_gib": 0,      "created_at": "2019-08-24T14:15:22Z"    }  ],  "total": 0,  "max_snapshots": 5}
{  "errors": [    {      "message": "'vcpus' field must be an integer",      "field": "resource_id"    }  ]}
"Access denied"
{  "errors": [    {      "message": "User not initialized. Send POST /v1/init, then retry the request."    }  ]}
{  "errors": [    {      "message": "VM with ID 23 not found"    }  ]}