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
- Sign in with
POST /api/v1/auth/loginand send the returned token asAuthorization: Bearer <JWT>on every other call (see Chapter 1.2). - Check the realm with
GET /api/v1/realm. The fieldpanfs_mountedmust betruebefore you create a tenant or a volume. While it isfalse, those calls return503. The API runs on the realm president, so after a change of president call the new president; the old address stops answering. - 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.
- Use the right token for each call. Most calls here use your own Platform Admin token. Two kinds of call differ.
POST /api/v1/volumescreates the volume in the tenant of the token, so callPOST /api/v1/auth/tenant-switchfirst and use the token it returns for the volume call. A Platform Admin who calls without switching gets404because the volume would go to the platform tenant.mount-infois the reverse; it returns403through 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.
Create a StorageSet.
POST /api/v1/storagesetswith aname(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" }Find the nodes you can add.
GET /api/v1/nodeslists every node. Add only nodes that are unassigned (a StorageSet ID of 0) and whose role isvhost,vosd, orsnode. Other roles, such asqnode, are refused. On a realm that runs on virtual hosts, list thevhostnodes; their VPODs join with them.Add the storage.
POST /api/v1/storagesets/{storageset_id}/actionswith theadd_storageaction, amode(add_spareto expand capacity), and thedataserialsto add. Always list the nodes; a call withoutdataserialsadds nothing, yet still returns204. The call returns204at 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 theactivatingcondition. PollGET /api/v1/storagesets/{storageset_id}untilstate.statusisok. One node is rarely enough; a volume needs several online disks (OSDs) for its RAID layout, 4 forraid6+(the default) and 3 forraid5+andraid10+. With too few, volume create returns409“Not enough online disks in StorageSet to create volume”. A StorageSet built from one vhost has 3 VPODs, which is too few forraid6+.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 } }Wait for the filesystem. After the StorageSet status is
ok, pollGET /api/v1/realmuntilpanfs_mountedistrue. The filesystem usually mounts about 30 seconds after the status isok. Until then, tenant and volume create return503.Choose the network segment type.
PUT /api/v1/subnets/segment-typesets 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 withGET /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.
Create the tenant.
POST /api/v1/tenantswithname(3 to 10 alphanumeric characters),display_name,email, andauth_settings. It returns503whilepanfs_mountedisfalse. The tenant’sstatusfollows its subnet:pendingmeans it has no subnet,configuringmeans it has a subnet but no node address on it yet, andactivemeans at least one node address has been issued. Check it withGET /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" } }Give the tenant capacity.
PUT /api/v1/tenants/{tenant_id}/storagesets/{storageset_id}with aquota_bytes. Without this, creating a volume for the tenant returns404. Onlyplatform-adminandstorage-admincan set it, and a Tenant Admin gets403. A quota on a StorageSet with no free space returns400(“… 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 }Give the tenant a subnet.
POST /api/v1/tenants/{tenant_id}/subnetswith aname,ip_range_base,ip_range_prefix, and optionally asegment_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 returns403.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 }Wait for the subnet to be usable. You need two things, and they are not the same. Poll
GET /api/v1/tenants/{tenant_id}untilstatusisactive, which is enough to create volumes; before that, volume create returns409(“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 pollGET /api/v1/tenants/{tenant_id}/subnets/{subnet_id}/mount-infountilrmlistis not empty, which is what mounting needs.rmlistlists only replica Directors with an IPv4 address, so it can still be empty whendirectorsis not. Both normally arrive within seconds of creating the subnet:activetypically 2 to 7 seconds after, andrmlistunder a second later. If the tenant staysconfiguringfor minutes, check that the Directors are online.activemeans an address was issued, not that traffic flows, so confirm with a mount.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}/userswith ausernameandpassword, thenPATCH /api/v1/tenants/{tenant_id}/users/{user_id}/roleswith["admin"]. Roles are defined per tenant; list them withGET /api/v1/tenants/roles. An unknown or reserved role (platform-support,s3-gateway) returns400. The API supports tenant users, though Vantage does not yet offer full management of them. The user signs in as<tenant-name>/<user>throughPOST /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" ] }Create volumes. Use a token for the tenant. Switch into it with
POST /api/v1/auth/tenant-switchas a Platform Admin, which needs no tenant user, or sign in as the tenant admin if you created one in step 5. Then callPOST /api/v1/volumeswith apathnameand astorageset_id. Always sendhard_quota_byteswith a value greater than 0; a tenant volume without one returns400. The call returns503whilepanfs_mountedisfalse, and504if 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.
Attach the host.
POST /api/v1/tenants/{tenant_id}/subnets/{subnet_id}/attachmentswith the host’sunderlay_ip, and optionally ahostnameand anoverlay_ipon the tenant network. The response carries theoverlay_ip,overlay_prefix, andmtuthe host must apply to its tenant interface. Themtuis 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" }Mount with the realm addresses.
GET /api/v1/tenants/{tenant_id}/subnets/{subnet_id}/mount-inforeturnsrmlist, the addresses to pass to the mount command, joined with;, anddirectors, the Directors that hold an address on the subnet. Usermlistfor 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.
Create the volume S3 will serve. The tenant’s
default_prefixmust 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).Enable S3 for the realm.
PUT /api/v1/s3/enabledwithenabledset totrue. Enabling the tenant before the realm returns409.Request body for
PUT /api/v1/s3/enabled:{ "enabled": true }Create the tenant S3 configuration.
PUT /api/v1/tenants/{tenant_id}/s3. No field is required, so{}returns201.Request body for
PUT /api/v1/tenants/{tenant_id}/s3:{}Turn S3 on for the tenant.
PATCH /api/v1/tenants/{tenant_id}/s3withenabledset totrueand thedefault_prefix. The response is200and listsrestart_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" }Create a PanFS user for the S3 credentials.
POST /api/v1/tenants/{tenant_id}/fs-userswith aname. The user’saccess_keydefaults to the name. Read the secret withGET /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 }Create a gateway instance.
POST /api/v1/tenants/{tenant_id}/s3/instanceswith a five-characterinstance_idand thedataserialof the node that hosts it (fromGET /api/v1/nodes). The tenant needs a subnet, and gets at most one instance per node (409otherwise).Request body for
POST /api/v1/tenants/{tenant_id}/s3/instances:{ "instance_id": "abc12", "dataserial": "<dataserial>" }Start it.
POST /api/v1/tenants/{tenant_id}/s3/instances/{iid}/startreturns202: The desired state is recorded, not reached. PollGET /api/v1/tenants/{tenant_id}/s3/instances/{iid}untilobservedisrunning.Create a bucket.
POST /api/v1/tenants/{tenant_id}/s3/bucketswith anameand anowner, which is the access key of the PanFS user from step 5. Bucket calls return503until an instance is running, and a503for “no running gateway” does not clear on retry. A504means 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" }Connect a client. Read the instance’s address from the
endpointfield ofGET /api/v1/tenants/{tenant_id}/s3/instances/{iid}, for examplehttps://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, settls.modetotenant-providedand 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.
- Remove the S3 instances.
POST /api/v1/tenants/{tenant_id}/s3/instances/delete-allwaits (up to itstimeout) for the instances to be gone. Skip this when the tenant never used S3. A leftover S3 instance also makes the tenant delete return409. - Delete the tenant’s volumes. Find the IDs with
GET /api/v1/volumesand itstenant_idfilter, which a Platform Admin can call without switching. Deleting needs a token for the tenant, as creating does; switch in withPOST /api/v1/auth/tenant-switchor sign in as the tenant admin, then callDELETE /api/v1/volumes/{volume_id}for each volume (204). Without the switcher a Platform Admin gets404“Volume not found”. - Delete the tenant’s subnets.
DELETE /api/v1/tenants/{tenant_id}/subnets/{subnet_id}for each subnet. - 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).
- Start the collection.
POST /api/v1/realm/log-collectionswith no body collects everything from every node. To limit it, setscope(all,repset,directors, orstorage),hosts, orstoragesets. The call answers202with the new collection and aLocationURL. Only one collection runs at a time, so a second start returns409. - Wait for it to end. Poll
GET /api/v1/realm/log-collections/{collection_id}untilstatusissucceededorfailed. A run in which some hosts failed still succeeds, andfailed_hostslists them. On failure,errorsays why. - Download the archive.
GET /api/v1/realm/log-collections/{collection_id}/archivereturns a tar file with one.tgzper node. It is often hundreds of megabytes, so write it to disk as it arrives and do not hold it in memory. The collection’sarchive_sha256is also sent as theETag, so check the finished file against it. To resume an interrupted download, sendRangeandIf-Rangeas described under the endpoint. - 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. |