Skip to content

API reference

Command history API

Search a machine's past commands, read one entry, and page through its stored stdout and stderr.

On this page

List command history

GET /v1/machines/{machine_id}/commands/history

  • API key: Authorization: Bearer vmy_… with preset use_existing, create_and_use, full_access.
  • Browser session: the vmyard_session cookie.
  • Who: Owner, Admin, or Operator.

Parameters

NameInTypeRequiredDescription
machine_idpathstring (uuid)Yes
X-Organization-IDheaderstring (uuid)NoRequired with a browser session. Optional with an API key, which fixes the organization; when sent it must match.
qquerystringNoCase-insensitive text contained in the command, at most 128 characters.
modequerystringNoall (default), sync, or detached.
limitqueryintegerNoPage size, 1-100 (default 50).
cursorquerystringNonext_cursor from the previous page.

Responses

StatusDescriptionBody
200—CommandHistoryPage
401Not signed in, or the API key is malformed, expired, or revoked (unauthenticated, invalid_api_key).ProblemDetails
403Refused for this caller: role, key preset, CSRF token, or organization (forbidden, insufficient_scope, csrf_invalid, organization_mismatch, session_required).ProblemDetails
404Not found in this organization (resource_not_found).ProblemDetails
422Invalid request (invalid_request); field_errors names the fields.ProblemDetails
Request
curl "$VMYARD_API_URL/v1/machines/$MACHINE_ID/commands/history" \
  -H "Authorization: Bearer $VMYARD_API_KEY"
Response 200
{
  "items": [
    {
      "argv": [
        "string"
      ],
      "cancelled": false,
      "command": "npm test",
      "created_at": "string",
      "duration_ms": 0,
      "error_code": "string",
      "exit_code": 0,
      "finished_at": "string",
      "logs_url": "/v1/machines/6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f/commands/history/6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f/logs",
      "machine_id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
      "mode": "sync",
      "operation_id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
      "output_purged": false,
      "started_at": "string",
      "status": "pending",
      "stderr_bytes": 0,
      "stdout_bytes": 0,
      "timed_out": false,
      "truncated": false
    }
  ],
  "next_cursor": "string"
}

Get a history entry

GET /v1/machines/{machine_id}/commands/history/{operation_id}

  • API key: Authorization: Bearer vmy_… with preset use_existing, create_and_use, full_access.
  • Browser session: the vmyard_session cookie.
  • Who: Owner, Admin, or Operator.

Parameters

NameInTypeRequiredDescription
machine_idpathstring (uuid)Yes
operation_idpathstring (uuid)Yes
X-Organization-IDheaderstring (uuid)NoRequired with a browser session. Optional with an API key, which fixes the organization; when sent it must match.

Responses

StatusDescriptionBody
200—CommandHistoryEntryDto
401Not signed in, or the API key is malformed, expired, or revoked (unauthenticated, invalid_api_key).ProblemDetails
403Refused for this caller: role, key preset, CSRF token, or organization (forbidden, insufficient_scope, csrf_invalid, organization_mismatch, session_required).ProblemDetails
404Not found in this organization (resource_not_found).ProblemDetails
Request
curl "$VMYARD_API_URL/v1/machines/$MACHINE_ID/commands/history/$OPERATION_ID" \
  -H "Authorization: Bearer $VMYARD_API_KEY"
Response 200
{
  "argv": [
    "string"
  ],
  "cancelled": false,
  "command": "npm test",
  "created_at": "string",
  "duration_ms": 0,
  "error_code": "string",
  "exit_code": 0,
  "finished_at": "string",
  "logs_url": "/v1/machines/6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f/commands/history/6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f/logs",
  "machine_id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
  "mode": "sync",
  "operation_id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
  "output_purged": false,
  "started_at": "string",
  "status": "pending",
  "stderr_bytes": 0,
  "stdout_bytes": 0,
  "timed_out": false,
  "truncated": false
}

Read stored command output

GET /v1/machines/{machine_id}/commands/history/{operation_id}/logs

While a streamed command runs, the relayed output is served and complete is false. After the retention period the output is removed and the answer is 410 output_expired.

  • API key: Authorization: Bearer vmy_… with preset use_existing, create_and_use, full_access.
  • Browser session: the vmyard_session cookie.
  • Who: Owner, Admin, or Operator.

Parameters

NameInTypeRequiredDescription
machine_idpathstring (uuid)Yes
operation_idpathstring (uuid)Yes
X-Organization-IDheaderstring (uuid)NoRequired with a browser session. Optional with an API key, which fixes the organization; when sent it must match.
streamquerystringNostdout (default) or stderr.
offsetqueryintegerNoByte offset into the stream (default 0).
limitqueryintegerNoBytes to return, 1 to 1048576 (default 65536).

Responses

StatusDescriptionBody
200—CommandLogChunkDto
401Not signed in, or the API key is malformed, expired, or revoked (unauthenticated, invalid_api_key).ProblemDetails
403Refused for this caller: role, key preset, CSRF token, or organization (forbidden, insufficient_scope, csrf_invalid, organization_mismatch, session_required).ProblemDetails
404Not found in this organization (resource_not_found).ProblemDetails
410Retention removed this command's outputProblemDetails
422Invalid request (invalid_request); field_errors names the fields.ProblemDetails
Request
curl "$VMYARD_API_URL/v1/machines/$MACHINE_ID/commands/history/$OPERATION_ID/logs" \
  -H "Authorization: Bearer $VMYARD_API_KEY"
Response 200
{
  "complete": false,
  "data_base64": "UEFTUyAgc3JjL2FwcC50ZXN0LnRzCg==",
  "next_offset": 0,
  "offset": 0,
  "operation_id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
  "size": 0,
  "stream": "stdout",
  "truncated": false
}