Skip to main content

Regional VPS API

Regional VPS servers (such as region iran-1) have their own API: ordering servers, power, reinstalling, resizing, resetting the root password, a browser console and traffic. The arianet vps regional CLI commands are built on it.

Which API?

VPS servers ordered through /api/v1/servers (the arianet vps commands) are described in the VPS API. This page covers the regional VPS servers, which the panel lists next to the others. Both APIs accept the same token.

Quick start​

  1. In the panel, at cloud.ariaservice.net/users/api-tokens, create a token with the scopes vps:servers:read and vps:servers:write.
  2. Call the API:
export ARIANET_TOKEN="paste-your-token-here"
BASE=https://api.ariaservice.net/vps/v1
AUTH="Authorization: Bearer $ARIANET_TOKEN"

curl -s $BASE/datacenters -H "$AUTH"
curl -s "$BASE/plans?datacenter=thr-1" -H "$AUTH"
curl -s "$BASE/images?datacenter=thr-1" -H "$AUTH"
curl -s -X POST $BASE/servers -H "$AUTH" -H "Content-Type: application/json" \
-d '{"datacenter":"thr-1","plan_id":4,"image":"ubuntu-24.04","hostname":"web-1","billing_mode":"hourly"}'

An order answers with the server and an action. Without a password a root password is generated and returned only once, in that answer. Follow the operation with GET /actions/{id} until state is success or error.

Authentication and scopes​

ScopeAllows
vps:servers:readdatacenters, plans, images, servers, traffic and operations
vps:servers:writeevery change: ordering, deleting, power, reinstalling, resizing, passwords and the console

A token without any scope is unrestricted. For a team member the account's IAM policies on VPS servers apply too.

Regions​

The Arianet-Region header picks the region; without it the request goes to the default region (today iran-1). An unknown region answers 404 region_not_found. Requests to this region travel over the secure link between regions, so event streams (text/event-stream) are not available there and answer 501 streaming_unsupported; follow operations with GET /actions/{id}.

Resources​

Method and pathPurpose
GET /datacenters, GET /plans, GET /imagesthe region's catalog
GET /servers, POST /serverslist and order servers
GET /servers/{id}, DELETE /servers/{id}details and deletion (what it cost so far is settled)
POST /servers/{id}/actions/{op}start, stop (graceful), restart, kill (hard power-off)
POST /servers/{id}/reinstallreinstall from an image ({"image":"..."}); the disk is wiped
POST /servers/{id}/resizemove to another plan ({"plan_id":5}); disks only grow
POST /servers/{id}/reset-passwordset the root password
POST /servers/{id}/consolea one-time browser console URL
GET /servers/{id}/traffictraffic and the period's quota (from, to, granularity)
PUT /servers/{id}/traffic-settingsturn overage billing on or off ({"overage_billing": true}); off means overage is never billed and the network is cut once the period's quota is used up, until the next period. Team members need the vps:manage IAM permission
GET /servers/{id}/actions, GET /actions, GET /actions/{id}asynchronous operations

Errors​

Errors are JSON, {"error": "...", "code": "..."}.

HTTPcode
400invalid_input, invalid_region
401unauthorized
402insufficient balance
403forbidden, insufficient_scope
404not_found, region_not_found
409the server's state does not allow it now
429rate_limit_exceeded
501streaming_unsupported
503vps_unavailable, region_unavailable
504gateway_timeout: the region did not answer in time; the request may still have been applied, check before retrying