Velocity • Durability

Version 12.0.0

2. Getting Started

The reference chapters describe each endpoint on its own. Many calls only work after other resources exist, so this chapter shows how the calls fit together, covering what to create, in what order, and what to wait for. Each scenario lists its steps in the order that works. Run in another order, a step fails with the error noted beside it. Appendix A lists the common error shapes.

Every endpoint named here links to its full reference. Most of these steps are Platform Admin calls; the step says when a different caller is needed.

2.1 Before You Start

  1. Sign in with POST /api/v1/auth/login and send the returned token as Authorization: Bearer <JWT> on every other call (see Chapter 1.2).
  2. Check the realm with GET /api/v1/realm. The field panfs_mounted must be true before you create a tenant or a volume. While it is false, those calls return 503. The API runs on the realm president, so after a change of president call the new president; the old address stops answering.
  3. Keep the dependency order in mind. A StorageSet holds capacity; a tenant gets a quota in a StorageSet and a subnet; volumes, users, and S3 resources live inside the tenant. Nothing in the second group works before the first group exists.
  4. Use the right token for each call. Most calls here use your own Platform Admin token. Two kinds of call differ. POST /api/v1/volumes creates the volume in the tenant of the token, so call POST /api/v1/auth/tenant-switch first and use the token it returns for the volume call. A Platform Admin who calls without switching gets 404 because the volume would go to the platform tenant. mount-info is the reverse; it returns 403 through the tenant switcher, so call it with your own token. Calls that carry the tenant in the URL (S3, users, and PanFS users) work either way. Keep your original token while you use the switched one.

Every request body in this chapter is JSON, so send it with Content-Type: application/json. <realm> is the address of the realm president. For example, sign in and then create a StorageSet:

curl -X POST "https://<realm>/api/v1/auth/login" \
  -d "username=admin" -d "password=<password>"

curl -X POST "https://<realm>/api/v1/storagesets" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"name": "Set 1", "spares_requested": 2}'

The request bodies below use placeholders such as <tenant-id> for values you supply. Each body matches the schema of its endpoint.

2.2 Bring Up a Realm

Run these once, as a Platform Admin, before any tenant exists.

  1. Create a StorageSet. POST /api/v1/storagesets with a name (unique in the realm) and, optionally, spares_requested. The response carries the StorageSet ID.

    Request body for POST /api/v1/storagesets:

    {
      "spares_requested": 2,
      "name": "Set 1"
    }
  2. Find the nodes you can add. GET /api/v1/nodes lists every node. Add only nodes that are unassigned (a StorageSet ID of 0) and whose role is vhost, vosd, or snode. Other roles, such as qnode, are refused. On a realm that runs on virtual hosts, list the vhost nodes; their VPODs join with them.

  3. Add the storage. POST /api/v1/storagesets/{storageset_id}/actions with the add_storage action, a mode (add_spare to expand capacity), and the dataserials to add. Always list the nodes; a call without dataserials adds nothing, yet still returns 204. The call returns 204 at once, but the storage is absorbed asynchronously, which takes about 15 minutes. A vhost adds its capacity later because each of its VPODs joins after it installs and boots; until the first one joins, the StorageSet reports the activating condition. Poll GET /api/v1/storagesets/{storageset_id} until state.status is ok. One node is rarely enough; a volume needs several online disks (OSDs) for its RAID layout, 4 for raid6+ (the default) and 3 for raid5+ and raid10+. With too few, volume create returns 409 “Not enough online disks in StorageSet to create volume”. A StorageSet built from one vhost has 3 VPODs, which is too few for raid6+.

    Request body for POST /api/v1/storagesets/{storageset_id}/actions:

    {
      "action": "add_storage",
      "params": {
        "mode": "add_spare",
        "dataserials": [
          "<dataserial-1>",
          "<dataserial-2>"
        ],
        "spares_requested": 2
      }
    }
  4. Wait for the filesystem. After the StorageSet status is ok, poll GET /api/v1/realm until panfs_mounted is true. The filesystem usually mounts about 30 seconds after the status is ok. Until then, tenant and volume create return 503.

  5. Choose the network segment type. PUT /api/v1/subnets/segment-type sets VLAN or VXLAN for the whole realm. Set it before the first subnet is created. It cannot change while subnets exist on a different type (409). Read it back with GET /api/v1/subnets/segment-type.

    Request body for PUT /api/v1/subnets/segment-type:

    {
      "segment_type": "vxlan"
    }

The realm is ready for tenants when a StorageSet reports status ok, panfs_mounted is true, and the segment type is set.

2.3 Onboard a Tenant

Steps 1 to 4 are Platform Admin calls. Run them in this order.

  1. Create the tenant. POST /api/v1/tenants with name (3 to 10 alphanumeric characters), display_name, email, and auth_settings. It returns 503 while panfs_mounted is false. The tenant’s status follows its subnet: pending means it has no subnet, configuring means it has a subnet but no node address on it yet, and active means at least one node address has been issued. Check it with GET /api/v1/tenants/{tenant_id}.

    Request body for POST /api/v1/tenants:

    {
      "name": "demo",
      "display_name": "Demo Tenant",
      "email": "admin@demo.example.com",
      "auth_settings": {
        "auth_mode": "local"
      }
    }
  2. Give the tenant capacity. PUT /api/v1/tenants/{tenant_id}/storagesets/{storageset_id} with a quota_bytes. Without this, creating a volume for the tenant returns 404. Only platform-admin and storage-admin can set it, and a Tenant Admin gets 403. A quota on a StorageSet with no free space returns 400 (“… exceeds available 0 bytes”), so an empty StorageSet cannot be given to a tenant.

    Request body for PUT /api/v1/tenants/{tenant_id}/storagesets/{storageset_id}:

    {
      "quota_bytes": 10000000000
    }
  3. Give the tenant a subnet. POST /api/v1/tenants/{tenant_id}/subnets with a name, ip_range_base, ip_range_prefix, and optionally a segment_id. If you leave it out, the realm assigns an unused one; if you give one, it must be unused on the realm. Call it directly as a Platform Admin. Do not switch into the tenant first. A switched-in session returns 403.

    Request body for POST /api/v1/tenants/{tenant_id}/subnets:

    {
      "name": "subnet-demo",
      "ip_range_base": "192.168.0.0",
      "ip_range_prefix": 16,
      "gateway": "192.168.0.1",
      "segment_id": 4201
    }
  4. Wait for the subnet to be usable. You need two things, and they are not the same. Poll GET /api/v1/tenants/{tenant_id} until status is active, which is enough to create volumes; before that, volume create returns 409 (“The tenant holds no issued subnet address, so a volume created for it could not be reached. Create a subnet for the tenant and let one of its nodes report an address into it first”). Then poll GET /api/v1/tenants/{tenant_id}/subnets/{subnet_id}/mount-info until rmlist is not empty, which is what mounting needs. rmlist lists only replica Directors with an IPv4 address, so it can still be empty when directors is not. Both normally arrive within seconds of creating the subnet: active typically 2 to 7 seconds after, and rmlist under a second later. If the tenant stays configuring for minutes, check that the Directors are online. active means an address was issued, not that traffic flows, so confirm with a mount.

  5. Optional: create a tenant user and give it a role. Tenant users are not fully supported in this release (see Chapter 7), so you can skip this step and use the tenant switcher in step 6. POST /api/v1/tenants/{tenant_id}/users with a username and password, then PATCH /api/v1/tenants/{tenant_id}/users/{user_id}/roles with ["admin"]. Roles are defined per tenant; list them with GET /api/v1/tenants/roles. An unknown or reserved role (platform-support, s3-gateway) returns 400. The API supports tenant users, though Vantage does not yet offer full management of them. The user signs in as <tenant-name>/<user> through POST /api/v1/auth/login.

    Request body for POST /api/v1/tenants/{tenant_id}/users:

    {
      "username": "demoadmin",
      "password": "change-me-now",
      "email": "demoadmin@demo.example.com",
      "auth_settings": {
        "auth_mode": "local"
      }
    }

    Request body for PATCH /api/v1/tenants/{tenant_id}/users/{user_id}/roles:

    {
      "roles": [
        "admin"
      ]
    }
  6. Create volumes. Use a token for the tenant. Switch into it with POST /api/v1/auth/tenant-switch as a Platform Admin, which needs no tenant user, or sign in as the tenant admin if you created one in step 5. Then call POST /api/v1/volumes with a pathname and a storageset_id. Always send hard_quota_bytes with a value greater than 0; a tenant volume without one returns 400. The call returns 503 while panfs_mounted is false, and 504 if no answer arrived in time (the volume may still appear, so list volumes before retrying).

    Request body for POST /api/v1/auth/tenant-switch:

    {
      "tenant_id": "<tenant-id>",
      "ttl_minutes": 60
    }

    Request body for POST /api/v1/volumes:

    {
      "pathname": "/vol1",
      "storageset_id": 1,
      "hard_quota_bytes": 10000000000
    }

2.4 Give Clients Access to a Tenant

A client host reaches a tenant’s volumes over the tenant subnet. A Platform Admin who is not switched into the tenant performs both steps. A Tenant Admin gets 403 on mount-info and on every attachment endpoint, and mount-info also returns 403 through the tenant switcher.

  1. Attach the host. POST /api/v1/tenants/{tenant_id}/subnets/{subnet_id}/attachments with the host’s underlay_ip, and optionally a hostname and an overlay_ip on the tenant network. The response carries the overlay_ip, overlay_prefix, and mtu the host must apply to its tenant interface. The mtu is never 0; set the host’s interface to exactly that value.

    Request body for POST /api/v1/tenants/{tenant_id}/subnets/{subnet_id}/attachments:

    {
      "underlay_ip": "10.128.9.0",
      "hostname": "client-0"
    }
  2. Mount with the realm addresses. GET /api/v1/tenants/{tenant_id}/subnets/{subnet_id}/mount-info returns rmlist, the addresses to pass to the mount command, joined with ;, and directors, the Directors that hold an address on the subnet. Use rmlist for the mount; it is empty until a realm node has reported an address. Give the addresses to the administrator of the client.

To remove a host, call DELETE /api/v1/tenants/{tenant_id}/subnets/{subnet_id}/attachments/{attachment_id}.

2.5 Enable and Use S3

S3 needs a realm switch, a tenant configuration, a running gateway instance, and a PanFS user for the credentials. Run the steps in this order. The S3, PanFS user, and bucket calls carry the tenant in the URL, so a Platform Admin can call them directly or through the tenant switcher.

  1. Create the volume S3 will serve. The tenant’s default_prefix must name an existing volume of the tenant (or a directory inside one), so create it first (see 2.3, step 6, which needs a token for the tenant).

  2. Enable S3 for the realm. PUT /api/v1/s3/enabled with enabled set to true. Enabling the tenant before the realm returns 409.

    Request body for PUT /api/v1/s3/enabled:

    {
      "enabled": true
    }
  3. Create the tenant S3 configuration. PUT /api/v1/tenants/{tenant_id}/s3. No field is required, so {} returns 201.

    Request body for PUT /api/v1/tenants/{tenant_id}/s3:

    {}
  4. Turn S3 on for the tenant. PATCH /api/v1/tenants/{tenant_id}/s3 with enabled set to true and the default_prefix. The response is 200 and lists restart_required, the changes that running gateways pick up only after a restart.

    Request body for PATCH /api/v1/tenants/{tenant_id}/s3:

    {
      "enabled": true,
      "default_prefix": "/vol1"
    }
  5. Create a PanFS user for the S3 credentials. POST /api/v1/tenants/{tenant_id}/fs-users with a name. The user’s access_key defaults to the name. Read the secret with GET /api/v1/tenants/{tenant_id}/fs-users/{fs_user_id}/s3/secret.

    Request body for POST /api/v1/tenants/{tenant_id}/fs-users:

    {
      "name": "alice",
      "uid": 1000,
      "gid": 1000
    }
  6. Create a gateway instance. POST /api/v1/tenants/{tenant_id}/s3/instances with a five-character instance_id and the dataserial of the node that hosts it (from GET /api/v1/nodes). The tenant needs a subnet, and gets at most one instance per node (409 otherwise).

    Request body for POST /api/v1/tenants/{tenant_id}/s3/instances:

    {
      "instance_id": "abc12",
      "dataserial": "<dataserial>"
    }
  7. Start it. POST /api/v1/tenants/{tenant_id}/s3/instances/{iid}/start returns 202: The desired state is recorded, not reached. Poll GET /api/v1/tenants/{tenant_id}/s3/instances/{iid} until observed is running.

  8. Create a bucket. POST /api/v1/tenants/{tenant_id}/s3/buckets with a name and an owner, which is the access key of the PanFS user from step 5. Bucket calls return 503 until an instance is running, and a 503 for “no running gateway” does not clear on retry. A 504 means the bucket may exist, so list buckets before retrying.

    Request body for POST /api/v1/tenants/{tenant_id}/s3/buckets:

    {
      "name": "my-bucket",
      "owner": "alice"
    }
  9. Connect a client. Read the instance’s address from the endpoint field of GET /api/v1/tenants/{tenant_id}/s3/instances/{iid}, for example https://192.168.79.51:3000. Each instance has its own address; the field is null until the hosting node holds an address on the tenant subnet. The port is 3000 for every instance. Connect over HTTPS from a host attached to the tenant subnet (see 2.4), and sign requests with the access key and secret from step 5. By default (realm-generated) the gateway certificate is signed by the realm’s internal certificate authority, which is not exposed to customers, so a client cannot verify it. To give clients a certificate they can verify, set tls.mode to tenant-provided and supply your own certificate and authority.

2.6 Delete a Tenant

Deleting a tenant does not cascade. The call returns 409 until the tenant’s S3 instances, volumes, and subnets are removed, in that order.

  1. Remove the S3 instances. POST /api/v1/tenants/{tenant_id}/s3/instances/delete-all waits (up to its timeout) for the instances to be gone. Skip this when the tenant never used S3. A leftover S3 instance also makes the tenant delete return 409.
  2. Delete the tenant’s volumes. Find the IDs with GET /api/v1/volumes and its tenant_id filter, which a Platform Admin can call without switching. Deleting needs a token for the tenant, as creating does; switch in with POST /api/v1/auth/tenant-switch or sign in as the tenant admin, then call DELETE /api/v1/volumes/{volume_id} for each volume (204). Without the switcher a Platform Admin gets 404 “Volume not found”.
  3. Delete the tenant’s subnets. DELETE /api/v1/tenants/{tenant_id}/subnets/{subnet_id} for each subnet.
  4. Delete the tenant. DELETE /api/v1/tenants/{tenant_id}.

2.7 Collect Logs for Support

A log collection gathers logs, system databases, and corefiles from the realm’s nodes into one archive. Starting, downloading, and deleting a collection are Platform Admin calls (see Chapter 1.4).

  1. Start the collection. POST /api/v1/realm/log-collections with no body collects everything from every node. To limit it, set scope (all, repset, directors, or storage), hosts, or storagesets. The call answers 202 with the new collection and a Location URL. Only one collection runs at a time, so a second start returns 409.
  2. Wait for it to end. Poll GET /api/v1/realm/log-collections/{collection_id} until status is succeeded or failed. A run in which some hosts failed still succeeds, and failed_hosts lists them. On failure, error says why.
  3. Download the archive. GET /api/v1/realm/log-collections/{collection_id}/archive returns a tar file with one .tgz per node. It is often hundreds of megabytes, so write it to disk as it arrives and do not hold it in memory. The collection’s archive_sha256 is also sent as the ETag, so check the finished file against it. To resume an interrupted download, send Range and If-Range as described under the endpoint.
  4. Clean up. DELETE /api/v1/realm/log-collections/{collection_id} stops a collection that is still running, cleans the nodes, and removes the archive.

Old archives are cleaned when a new run starts or when a collection is deleted, not on a timer. By default, the newest 3 runs and 24 hours are kept.

An archive holds configuration and state from every node, so handle it as sensitive and keep it inside support channels. Archives stay on the Director that produced them, and they do not follow the API if it moves to another Director.

2.8 Before You Call This: Dependencies at a Glance

Each endpoint below needs something to exist or be true first. The same note appears under the endpoint in its reference chapter.

Endpoint Needs first Otherwise
POST /api/v1/tenants The realm filesystem is mounted (panfs_mounted is true on GET /api/v1/realm). 503 while it is not mounted.
PUT /api/v1/tenants/{tenant_id}/storagesets/{storageset_id} The tenant and the StorageSet exist, and the StorageSet has capacity. Only platform-admin and storage-admin may call it. 403 for any other role; 400 for a quota that exceeds the space available in the StorageSet, so an empty StorageSet cannot be given to a tenant. A tenant with no quota in a StorageSet cannot create volumes in it: volume create returns 404.
POST /api/v1/tenants/{tenant_id}/subnets The realm segment type is set (PUT /api/v1/subnets/segment-type), any segment_id you give is unused on the realm (leave it out and the realm assigns one), and the call comes from a platform role directly, not from a session switched into the tenant. 409 when the segment ID is held by another subnet or the realm has subnets on a different segment type; 403 from a switched-in session.
GET /api/v1/tenants/{tenant_id}/subnets/{subnet_id}/mount-info The subnet exists and a realm node has reported an address into it. Call it with a Platform Admin token that is not switched into a tenant. rmlist stays empty until then (an empty directors array with an empty rmlist is a legitimate answer); 403 for a Tenant Admin and through the tenant switcher; 503 when the realm manager cannot be reached.
POST /api/v1/tenants/{tenant_id}/subnets/{subnet_id}/attachments The subnet exists. Platform roles only. 404 when the subnet does not exist; 403 for a Tenant Admin; 503 when the realm manager cannot be reached.
POST /api/v1/storagesets/{storageset_id}/actions For add_storage: list the nodes in dataserials, each unassigned and with a role of vhost, vosd, or snode. A call without dataserials adds nothing yet returns 204; a role such as qnode is refused. The call returns 204 before the storage is usable, so poll GET /api/v1/storagesets/{storageset_id} until state.status is ok.
POST /api/v1/volumes A token for the tenant (POST /api/v1/auth/tenant-switch as a Platform Admin, or a tenant admin); the realm filesystem is mounted; the tenant has a quota in the StorageSet; the tenant has a subnet with an issued address; the StorageSet has enough online disks for the RAID layout; and hard_quota_bytes is greater than 0. 404 for a Platform Admin who has not switched into the tenant (the volume would go to the platform tenant), and also without the StorageSet quota; 503 while not mounted; 409 (“The tenant holds no issued subnet address, so a volume created for it could not be reached. Create a subnet for the tenant and let one of its nodes report an address into it first”) before the tenant is active; 409 “Not enough online disks in StorageSet to create volume” when the StorageSet has too few online OSDs for the RAID layout (4 for raid6+, 3 for raid5+ and raid10+); 400 without a positive hard_quota_bytes. A 504 means the volume may still appear, so list volumes before retrying.
DELETE /api/v1/volumes/{volume_id} A token for the tenant that owns the volume (POST /api/v1/auth/tenant-switch as a Platform Admin, or a tenant admin). 404 “Volume not found” for a Platform Admin who has not switched into the tenant, the same as for GET /api/v1/volumes/{volume_id}. Find the IDs with GET /volumes?tenant_id={tenant_id}, which works without switching.
PATCH /api/v1/tenants/{tenant_id}/users/{user_id}/roles Every role in the request is defined for the tenant (GET /api/v1/tenants/roles). 400 for an unknown or reserved role (platform-support, s3-gateway).
PATCH /api/v1/tenants/{tenant_id}/s3 S3 is enabled for the realm (PUT /api/v1/s3/enabled) and the tenant S3 configuration exists. To set enabled to true, default_prefix must name an existing volume of the tenant. 409 when the realm is not enabled. The call is refused when the prefix does not name an existing volume.
POST /api/v1/tenants/{tenant_id}/s3/instances S3 is enabled for the tenant, the tenant has a subnet, and the tenant has no instance on that node yet. 409 when the tenant already has an instance on that node.
POST /api/v1/tenants/{tenant_id}/s3/instances/{iid}/start The instance exists. A 202 means the desired state is recorded, not reached. Poll observed on GET /api/v1/tenants/{tenant_id}/s3/instances/{iid} until it is running.
GET /api/v1/tenants/{tenant_id}/s3/buckets A running S3 gateway instance for the tenant. 503, never an empty list. It does not clear on retry until an instance is started.
POST /api/v1/tenants/{tenant_id}/s3/buckets A running S3 gateway instance, and an owner that is the access key of an existing PanFS user in the tenant. 503 with no running instance, which does not clear on retry. A 504 means the bucket may exist, so list buckets before retrying.
DELETE /api/v1/tenants/{tenant_id}/s3/buckets/{name} A running S3 gateway instance for the tenant. 503 with no running instance; 409 for a non-empty bucket. A 504 means the bucket may have been deleted.
DELETE /api/v1/tenants/{tenant_id} Nothing left in the tenant: delete its S3 instances (POST /api/v1/tenants/{tenant_id}/s3/instances/delete-all), then its volumes, then its subnets. 409 for any leftover resource, including an S3 gateway instance.
DELETE /api/v1/tenants/{tenant_id}/s3/buckets/{name}/policy A running S3 gateway instance for the tenant. 503 with no running instance. A 504 means the policy may have been removed; the call is safe to repeat.
POST /api/v1/realm/log-collections No other collection running. 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.
GET /api/v1/realm/log-collections/{collection_id}/archive A collection whose status is succeeded. 409 while it is still running; 404 if it failed or its archive was removed.