Velocity • Durability

Version 12.0.0

5. Realm and Platform

This chapter covers About and Realm.

5.1 About

Endpoint Summary

Path Summary Method
/api/v1/about About GET

GET /api/v1/about

About

Return service name, version, and PanFS version.

Nothing sits between the route and its two sources: there is no store to adapt and no invariant to guard. The version file is read per request, so the endpoint follows the realm software without a restart.

Authentication: not required.

Responses

Status Description Schema
200 Successful Response AboutResponse

Response Body (200, AboutResponse)

Field Type Required Default Example Description
name string yes n/a PanAPI Service name
panfs_version string, nullable no null 12.0.0 PanFS realm software version read from the local filesystem; null when unavailable
version string yes n/a 1.2.3 Service version, derived from the package metadata at build time

5.2 Realm

Endpoint Summary

Path Summary Method
/api/v1/realm Get realm GET
/api/v1/realm/actions Perform realm action POST
/api/v1/realm/log-collections List realm log collections GET
/api/v1/realm/log-collections Start a realm log collection POST
/api/v1/realm/log-collections/{collection_id} Get a realm log collection GET
/api/v1/realm/log-collections/{collection_id} Delete a realm log collection DELETE
/api/v1/realm/log-collections/{collection_id}/archive Download a realm log collection archive GET

GET /api/v1/realm

Get realm

Returns the current realm.

Authentication: required (PasswordLogin or BearerJWT).

Responses

Status Description Schema
200 Successful response containing the realm RealmResponse
401 Unauthorized. Authentication required. -
403 Forbidden. Insufficient permissions. -
500 Internal server error. -

Response Body (200, RealmResponse)

Field Type Required Default Example Description
realm Realm object yes n/a Realm details
server_tzone string yes n/a America/Los_Angeles, UTC IANA timezone name of the API server’s host (e.g. ‘America/Los_Angeles’).

Example

{
   "realm" : {
      "boot_epoch_seconds" : 0,
      "clientmode_current" : "balanced",
      "clientmode_next" : "balanced",
      "data_generation" : 6,
      "heartbeat_failure_grace_seconds" : 30,
      "heartbeat_period_seconds" : 30,
      "id" : "a538deadbeef0001889abcdef1234567",
      "locked" : false,
      "log_sizing" : "12g",
      "mem_sizing_current" : 1,
      "mem_sizing_next" : 1,
      "mia_timer" : 360,
      "name" : "exp-aic-97-5",
      "panfs_mounted" : true,
      "president_flags" : [
         "settled_storage",
         "settled_mgr"
      ],
      "state" : "online",
      "state_flags" : [],
      "volume_layout_type_default" : "raid6+",
      "volume_max_vols_realm" : 1200,
      "volume_recovery_priority_default" : 50
   },
   "server_tzone" : "America/Los_Angeles"
}

POST /api/v1/realm/actions

Perform realm action

Performs a realm-scoped action. Supported actions: “rehome_root” - reassign the realm root volume to a different StorageSet; “reboot” - reboot the realm; “online” - bring the realm online; “offline” - take the realm offline (mode: “paused” for graceful drain, “unavailable” to make volumes inaccessible without draining); “lock” - prevent new nodes from joining via PanDHCP; “unlock” - re-enable PanDHCP joins. Lock and unlock are idempotent; “move_service” - relocate a service (volume service, PM, …) to a target Director Node (service_type “primary” performs a live failover, “backup” moves the standby).

Authentication: required (PasswordLogin or BearerJWT).

Request Body (application/json, required)

One of the following, selected by action:

action: lock - RealmLockActionRequest

Field Type Required Default Example Description
action literal lock yes n/a The action to perform on the realm.
params null (not used) no n/a

action: move_service - RealmMoveServiceActionRequest

Field Type Required Default Example Description
action literal move_service yes n/a The action to perform on the realm.
params RealmMoveServiceActionParams object yes n/a Parameters identifying the service to move and its destination node.

action: offline - RealmOfflineActionRequest

Field Type Required Default Example Description
action literal offline yes n/a The action to perform on the realm.
params RealmOfflineActionParams object no n/a Parameters for taking the realm offline.

action: online - RealmOnlineActionRequest

Field Type Required Default Example Description
action literal online yes n/a The action to perform on the realm.
params null (not used) no n/a

action: reboot - RealmRebootActionRequest

Field Type Required Default Example Description
action literal reboot yes n/a The action to perform on the realm.
params null (not used) no n/a

action: rehome_root - RealmRehomeRootActionRequest

Field Type Required Default Example Description
action literal rehome_root yes n/a The action to perform on the realm.
params RealmRehomeRootActionParams object yes n/a Parameters required to reassign the realm root volume to a different StorageSet.

action: unlock - RealmUnlockActionRequest

Field Type Required Default Example Description
action literal unlock yes n/a The action to perform on the realm.
params null (not used) no n/a

Responses

Status Description Schema
204 Action performed successfully on the realm. No content is returned. -
401 Unauthorized. Authentication required. -
403 Forbidden. Insufficient permissions. -
409 Conflict. Action conflicts with current system state. -
422 Validation error. -
500 Internal server error. -

GET /api/v1/realm/log-collections

List realm log collections

Lists running and finished collections, newest first.

Authentication: required (PasswordLogin or BearerJWT).

Responses

Status Description Schema
200 The collections, newest first. LogCollectionListResponse
401 Unauthorized. Authentication required. -
403 Forbidden. Insufficient permissions. -
500 Internal server error. -

Response Body (200, LogCollectionListResponse)

Field Type Required Default Example Description
collections array of LogCollectionResponse object yes n/a Running and finished collections, newest first.

POST /api/v1/realm/log-collections

Start a realm log collection

Starts collecting logs, system databases, and corefiles from the realm’s nodes with collect_logs. No body, or an empty one, collects everything from every node (collect_logs all). The body selects nodes (scope, hosts, storagesets) and leaves content out (include_cores, include_databases, include_sed, run_diagnostics, age). Poll the Location URL until status is succeeded or failed. One collection runs at a time; a second start gets 409, as does one while collect_logs runs on this Director outside the API. The server keeps finished collections for a limited time and number, so download the archive soon.

Before you call this. Needs: No other collection running. Otherwise: 409 while one runs, including a collect_logs started on the Director outside the API; 503 if collect_logs is not installed or the collection directory is unusable.

Authentication: required (PasswordLogin or BearerJWT).

Request Body (application/json, optional)

Schema: LogCollectionCreateRequest

What to collect, and from which nodes. An empty body collects everything from every node.

Field Type Required Default Example Description
age LogAgeRequest object, nullable no null Skip rotated /var/log files and corefiles older than this. Default: no age limit.
hosts array of string no n/a Nodes to collect from, by IPv4 address, serial, or name (e.g. VCH-1,1). Adds to scope.
include_cores boolean no true Collect corefiles and executables. Stack files always are.
include_databases boolean no true Collect the system databases (sanitised copies).
include_sed boolean no true Collect the self-encrypting drive (SED) event log, /pan/var/lib/pan_sed/event.log (ASU nodes only).
node_timeout_seconds integer, nullable no null Seconds each node may take to collect, and to copy back (collect_logs timeout). Default 900; 0 means no limit. The server also limits the whole run.
run_diagnostics boolean no true Run the diagnostic tools on each node before collecting.
scope LogCollectionScope (all, repset, directors, storage), nullable no null A whole class of nodes: all, repset (the Directors in the replication set), directors or storage. Defaults to all when neither hosts nor storagesets is given. all cannot be combined with them, because it already covers every node.
storagesets array of string no n/a StorageSets whose nodes to collect from, by name (e.g. Set 1). Adds to scope.
wait_for_savecore boolean no false Wait for a running savecore to finish first.

Responses

Status Description Schema
202 Accepted. The collection runs in the background. Poll the Location URL until status is succeeded or failed, then download the archive from archive_url. LogCollectionResponse
401 Unauthorized. Authentication required. -
403 Forbidden. Insufficient permissions. -
409 Conflict. A collection is already running, and only one runs at a time. That includes a collect_logs started on this Director outside the API, by hand or left by an API that was killed. -
422 Validation error. -
500 Internal server error. -
503 Service unavailable. Nothing was started. Either collect_logs is not installed on this Director, or the collection directory is unusable or short of free space. -

Response Body (202, LogCollectionResponse)

Field Type Required Default Example Description
archive_sha256 string, nullable no null 0f26932a2db4c86847bbf2b28e8f38ef8e9fd1b802e9e228471c13cd82db208c SHA-256 of the archive, in hex. The download sends it as its ETag.
archive_size_bytes integer, nullable no null Size of the archive, once it is ready.
archive_url string, nullable yes n/a Where to download the archive, once it is ready.
duration_seconds number, nullable yes n/a Seconds from start to end, once the run has ended.
error string, nullable no null Why the run failed.
failed_hosts array of string no n/a Addresses of the hosts that failed. A run with some failed hosts still succeeds.
finished_at string (date-time), nullable no null When the run ended (UTC); the archive name carries this time.
host_count integer, nullable no null Nodes the run collects from, once it has listed them.
hosts array of CollectedHostResponse object no n/a Every node the run collected from, once it has ended.
id string (uuid) yes n/a Identifier of the run.
options LogCollectionOptionsResponse object yes n/a What the run collects, as requested.
realm RealmRefResponse object, nullable no null The realm, when the RM could be read.
requested_by string, nullable no null platform/admin Who started the run: <tenant>/<principal>.
started_at string (date-time) yes n/a When the run started (UTC).
status LogCollectionStatus (running, succeeded, failed) yes n/a running until the run ends, then succeeded (an archive is ready) or failed.

GET /api/v1/realm/log-collections/{collection_id}

Get a realm log collection

Returns one collection: its status, node count, failed nodes, and, once succeeded, the archive size and archive_url.

Authentication: required (PasswordLogin or BearerJWT).

Parameters

Name In Type Required Description
collection_id path string (uuid) yes

Responses

Status Description Schema
200 The collection. LogCollectionResponse
401 Unauthorized. Authentication required. -
403 Forbidden. Insufficient permissions. -
404 Not found. No collection has this ID. -
422 Validation error. -
500 Internal server error. -

Response Body (200, LogCollectionResponse)

Field Type Required Default Example Description
archive_sha256 string, nullable no null 0f26932a2db4c86847bbf2b28e8f38ef8e9fd1b802e9e228471c13cd82db208c SHA-256 of the archive, in hex. The download sends it as its ETag.
archive_size_bytes integer, nullable no null Size of the archive, once it is ready.
archive_url string, nullable yes n/a Where to download the archive, once it is ready.
duration_seconds number, nullable yes n/a Seconds from start to end, once the run has ended.
error string, nullable no null Why the run failed.
failed_hosts array of string no n/a Addresses of the hosts that failed. A run with some failed hosts still succeeds.
finished_at string (date-time), nullable no null When the run ended (UTC); the archive name carries this time.
host_count integer, nullable no null Nodes the run collects from, once it has listed them.
hosts array of CollectedHostResponse object no n/a Every node the run collected from, once it has ended.
id string (uuid) yes n/a Identifier of the run.
options LogCollectionOptionsResponse object yes n/a What the run collects, as requested.
realm RealmRefResponse object, nullable no null The realm, when the RM could be read.
requested_by string, nullable no null platform/admin Who started the run: <tenant>/<principal>.
started_at string (date-time) yes n/a When the run started (UTC).
status LogCollectionStatus (running, succeeded, failed) yes n/a running until the run ends, then succeeded (an archive is ready) or failed.

DELETE /api/v1/realm/log-collections/{collection_id}

Delete a realm log collection

Removes a collection and its archive. A running collection is stopped first, and its leftovers are cleaned off the nodes.

Authentication: required (PasswordLogin or BearerJWT).

Parameters

Name In Type Required Description
collection_id path string (uuid) yes

Responses

Status Description Schema
204 Deleted. A running collection was stopped and its leftovers cleaned off the nodes. -
401 Unauthorized. Authentication required. -
403 Forbidden. Insufficient permissions. -
404 Not found. No collection has this ID. -
422 Validation error. -
500 Internal server error. -
503 Service unavailable. The collection was stopped and removed from the list. Its files could not be removed from disk; the API log has the details. -

GET /api/v1/realm/log-collections/{collection_id}/archive

Download a realm log collection archive

Downloads the archive of a succeeded collection as application/x-tar. It holds one .tgz per node. Downloading needs its own permission, realm-logs:download: the archive holds every node’s logs and system databases.

To resume an interrupted download, send Range: bytes=<bytes you have>- with If-Range: <ETag>, and append only a 206 whose Content-Range starts where you asked. A 200 means the archive changed: start again. HEAD on this URL gives the size and ETag without the body.

Before you call this. Needs: A collection whose status is succeeded. Otherwise: 409 while it is still running; 404 if it failed or its archive was removed.

Authentication: required (PasswordLogin or BearerJWT).

Parameters

Name In Type Required Description
collection_id path string (uuid) yes

Responses

Status Description Schema
200 The archive: a tar with one <node ip>/logs_<time>.tgz per node, plus manifest.json, collect_logs_cmdline.txt and ip_map.txt. Check it with sha256sum against the ETag. string
206 Partial content: the bytes the Range header asked for. Append them only when Content-Range starts at the byte you asked for. string
400 Bad request: the Range header is malformed. The body is a plain-text explanation, not JSON; its wording depends on the server version. string
401 Unauthorized. Authentication required. -
403 Forbidden. Insufficient permissions. -
404 Not found. No such collection, or it has no archive: it failed, or the archive was removed. -
409 Conflict. The collection is still running; its archive is not ready yet. -
416 Range not satisfiable: the Range starts at or past the end of the archive. A partial download of that size is already complete, or stale. The body is plain text, not JSON. string
422 Validation error. -
500 Internal server error. -