Документация API

Управляйте серверами из программы. Выпустите ключ в профиле и передавайте его в заголовке Authorization. Ключ только для чтения или для чтения и записи; отозванный или просроченный ключ получает 401.

curl -H "Authorization: Bearer YOUR_KEY" https://DOMAIN/api/client/v1/servers

Ошибки приходят в JSON с кодом и текстом: код постоянный, текст для людей. Сверх предела частоты - 429 с Retry-After. Долгое действие возвращает операцию: читайте её, пока статус не перестанет быть running.

OpenAPI

Catalog

GET/api/client/v1/catalog/typesServer types
GET/api/client/v1/catalog/types/{typeId}/imagesImages of a server type

Account

GET/api/client/v1/meYour account
GET/api/client/v1/notificationsYour notifications
POST/api/client/v1/notifications/{id}/readMark a notification as read

Support

GET/api/client/v1/ticketsYour support requests
POST/api/client/v1/ticketsOpen a support request
GET/api/client/v1/tickets/{id}Read a support request
POST/api/client/v1/tickets/{id}/replyReply to a support request

Servers

GET/api/client/v1/serversList servers
POST/api/client/v1/serversCreate a server
GET/api/client/v1/servers/{id}Read a server
PATCH/api/client/v1/servers/{id}Rename a server
DELETE/api/client/v1/servers/{id}Delete a server
POST/api/client/v1/servers/{id}/power/{action}Power action
POST/api/client/v1/servers/{id}/resizeChange cores and memory
POST/api/client/v1/servers/{id}/planMove to a larger plan: the server stops, changes and starts
POST/api/client/v1/servers/{id}/rebuildReinstall the system
POST/api/client/v1/servers/{id}/passwordSet a new password, shown once
POST/api/client/v1/servers/{id}/ssh-keysAdd SSH keys to a server
POST/api/client/v1/servers/{id}/tagsAdd a tag
DELETE/api/client/v1/servers/{id}/tags/{tag}Remove a tag
GET/api/client/v1/servers/{id}/eventsServer action log
GET/api/client/v1/servers/{id}/metricsPerformance graphs

Disks

GET/api/client/v1/servers/{id}/disksList disks
POST/api/client/v1/servers/{id}/disksAdd a data disk
PATCH/api/client/v1/servers/{id}/disks/{diskId}Grow a disk
DELETE/api/client/v1/servers/{id}/disks/{diskId}Delete a data disk

Network cards

GET/api/client/v1/servers/{id}/cardsList network cards
POST/api/client/v1/servers/{id}/cardsAdd a card on a network: a running server restarts
PATCH/api/client/v1/servers/{id}/cards/{cardId}Change a card
DELETE/api/client/v1/servers/{id}/cards/{cardId}Remove a card

Firewall

GET/api/client/v1/servers/{id}/firewallRead the firewall
PUT/api/client/v1/servers/{id}/firewallWrite the whole firewall

Backups

GET/api/client/v1/servers/{id}/backup-policyRead automatic backups
PATCH/api/client/v1/servers/{id}/backup-policyChange automatic backups
GET/api/client/v1/servers/{id}/backupsList backups
POST/api/client/v1/servers/{id}/backupsTake a backup
POST/api/client/v1/servers/{id}/backups/{backupId}/restoreRestore a backup
DELETE/api/client/v1/servers/{id}/backups/{backupId}Delete a backup

Drive

GET/api/client/v1/servers/{id}/driveRead the drive
PUT/api/client/v1/servers/{id}/driveInsert an image
DELETE/api/client/v1/servers/{id}/driveEject the image

Operations

GET/api/client/v1/operations/{id}Read an operation

Networks

GET/api/client/v1/networksList networks
POST/api/client/v1/networksCreate a network
PATCH/api/client/v1/networks/{id}Rename a network or widen its subnet
DELETE/api/client/v1/networks/{id}Delete a network
PUT/api/client/v1/networks/{id}/routerAttach a router
DELETE/api/client/v1/networks/{id}/routerDetach the router

Addresses

GET/api/client/v1/addressesList public addresses
POST/api/client/v1/addressesTake a public address
DELETE/api/client/v1/addresses/{id}Release an address

Routers

POST/api/client/v1/routersCreate a router
GET/api/client/v1/routers/{id}/networksNetworks of a router
PUT/api/client/v1/routers/{id}/dhcpSet address handout
PUT/api/client/v1/routers/{id}/addressMove the router to another public address
GET/api/client/v1/routers/{id}/rulesList access rules
POST/api/client/v1/routers/{id}/rulesCreate an access rule
PATCH/api/client/v1/routers/{id}/rules/{ruleId}Change an access rule
DELETE/api/client/v1/routers/{id}/rules/{ruleId}Delete an access rule
GET/api/client/v1/routers/{id}/forwardsList port forwards
POST/api/client/v1/routers/{id}/forwardsCreate a port forward
PATCH/api/client/v1/routers/{id}/forwards/{forwardId}Change a port forward
DELETE/api/client/v1/routers/{id}/forwards/{forwardId}Delete a port forward

VPN

GET/api/client/v1/routers/{id}/vpn/{kind}Read a tunnel
PUT/api/client/v1/routers/{id}/vpn/{kind}Switch a tunnel
GET/api/client/v1/routers/{id}/vpn/{kind}/devicesList devices
POST/api/client/v1/routers/{id}/vpn/{kind}/devicesCreate a device: the profile is shown once
DELETE/api/client/v1/routers/{id}/vpn/{kind}/devices/{deviceId}Delete a device

Images

GET/api/client/v1/imagesYour ISO images and server images
POST/api/client/v1/images/isoAdd an ISO by URL
POST/api/client/v1/images/from-serverTake an image of a server
DELETE/api/client/v1/images/{id}Delete an image

SSH keys

GET/api/client/v1/ssh-keysList SSH keys
POST/api/client/v1/ssh-keysAdd an SSH key
DELETE/api/client/v1/ssh-keys/{id}Delete an SSH key

Billing

GET/api/client/v1/usageCharges of the current month
GET/api/client/v1/invoicesList invoices
GET/api/client/v1/invoices/{id}Read an invoice with its lines
GET/api/client/v1/balanceBalance, credit and movements
POST/api/client/v1/quotePrice of an order: lines, discounts, tax, total in cents