← All procedures

snapshot.list

List available snapshots in S3 bucket

CLI
Package
@procedures/snapshot · README
Path
["snapshot","list"]
CLI
mark snapshot list --bucket <string>
As data
{"$proc":["snapshot","list"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/snapshot"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["snapshot","list"], { bucket: "<bucket>" });
console.log(JSON.stringify(result));

From the command line

$ mark snapshot list --bucket <string>

As data, in a program

{ "$proc": ["snapshot", "list"], "input": { "bucket": "<bucket>" } }

Input

FieldTypeRequiredDefaultDescription
bucketstringyesS3 bucket to list
prefixstringnoFilter by name prefix
maxResultsnumberno100Maximum results (default: 100)

Output

FieldTypeRequiredDefaultDescription
snapshotsobject[]yesThe snapshots, newest first
countnumberyesThe number of snapshots
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "bucket": {
        "type": "string",
        "description": "S3 bucket to list"
      },
      "prefix": {
        "description": "Filter by name prefix",
        "type": "string"
      },
      "maxResults": {
        "default": 100,
        "description": "Maximum results (default: 100)",
        "type": "number"
      }
    },
    "required": [
      "bucket"
    ]
  },
  "output": {
    "type": "object",
    "properties": {
      "snapshots": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "The snapshot id"
            },
            "name": {
              "description": "The name of the snapshot",
              "type": "string"
            },
            "preset": {
              "description": "The preset",
              "type": "string"
            },
            "createdAt": {
              "description": "The time of the snapshot (ISO 8601)",
              "type": "string"
            },
            "size": {
              "description": "The size of the archive, in bytes",
              "type": "number"
            },
            "os": {
              "description": "The operating system of the snapshot",
              "type": "string"
            }
          },
          "required": [
            "id"
          ],
          "additionalProperties": {}
        },
        "description": "The snapshots, newest first"
      },
      "count": {
        "type": "number",
        "description": "The number of snapshots"
      }
    },
    "required": [
      "snapshots",
      "count"
    ],
    "additionalProperties": {}
  }
}