
Документация 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/types | Server types |
GET | /api/client/v1/catalog/types/{typeId}/images | Images of a server type |
Account
GET | /api/client/v1/me | Your account |
GET | /api/client/v1/notifications | Your notifications |
POST | /api/client/v1/notifications/{id}/read | Mark a notification as read |
Support
GET | /api/client/v1/tickets | Your support requests |
POST | /api/client/v1/tickets | Open a support request |
GET | /api/client/v1/tickets/{id} | Read a support request |
POST | /api/client/v1/tickets/{id}/reply | Reply to a support request |
Servers
GET | /api/client/v1/servers | List servers |
POST | /api/client/v1/servers | Create 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}/resize | Change cores and memory |
POST | /api/client/v1/servers/{id}/plan | Move to a larger plan: the server stops, changes and starts |
POST | /api/client/v1/servers/{id}/rebuild | Reinstall the system |
POST | /api/client/v1/servers/{id}/password | Set a new password, shown once |
POST | /api/client/v1/servers/{id}/ssh-keys | Add SSH keys to a server |
POST | /api/client/v1/servers/{id}/tags | Add a tag |
DELETE | /api/client/v1/servers/{id}/tags/{tag} | Remove a tag |
GET | /api/client/v1/servers/{id}/events | Server action log |
GET | /api/client/v1/servers/{id}/metrics | Performance graphs |
Disks
GET | /api/client/v1/servers/{id}/disks | List disks |
POST | /api/client/v1/servers/{id}/disks | Add 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}/cards | List network cards |
POST | /api/client/v1/servers/{id}/cards | Add 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}/firewall | Read the firewall |
PUT | /api/client/v1/servers/{id}/firewall | Write the whole firewall |
Backups
GET | /api/client/v1/servers/{id}/backup-policy | Read automatic backups |
PATCH | /api/client/v1/servers/{id}/backup-policy | Change automatic backups |
GET | /api/client/v1/servers/{id}/backups | List backups |
POST | /api/client/v1/servers/{id}/backups | Take a backup |
POST | /api/client/v1/servers/{id}/backups/{backupId}/restore | Restore a backup |
DELETE | /api/client/v1/servers/{id}/backups/{backupId} | Delete a backup |
Drive
GET | /api/client/v1/servers/{id}/drive | Read the drive |
PUT | /api/client/v1/servers/{id}/drive | Insert an image |
DELETE | /api/client/v1/servers/{id}/drive | Eject the image |
Operations
GET | /api/client/v1/operations/{id} | Read an operation |
Networks
GET | /api/client/v1/networks | List networks |
POST | /api/client/v1/networks | Create 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}/router | Attach a router |
DELETE | /api/client/v1/networks/{id}/router | Detach the router |
Addresses
GET | /api/client/v1/addresses | List public addresses |
POST | /api/client/v1/addresses | Take a public address |
DELETE | /api/client/v1/addresses/{id} | Release an address |
Routers
POST | /api/client/v1/routers | Create a router |
GET | /api/client/v1/routers/{id}/networks | Networks of a router |
PUT | /api/client/v1/routers/{id}/dhcp | Set address handout |
PUT | /api/client/v1/routers/{id}/address | Move the router to another public address |
GET | /api/client/v1/routers/{id}/rules | List access rules |
POST | /api/client/v1/routers/{id}/rules | Create 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}/forwards | List port forwards |
POST | /api/client/v1/routers/{id}/forwards | Create 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}/devices | List devices |
POST | /api/client/v1/routers/{id}/vpn/{kind}/devices | Create 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/images | Your ISO images and server images |
POST | /api/client/v1/images/iso | Add an ISO by URL |
POST | /api/client/v1/images/from-server | Take an image of a server |
DELETE | /api/client/v1/images/{id} | Delete an image |
SSH keys
GET | /api/client/v1/ssh-keys | List SSH keys |
POST | /api/client/v1/ssh-keys | Add an SSH key |
DELETE | /api/client/v1/ssh-keys/{id} | Delete an SSH key |
Billing
GET | /api/client/v1/usage | Charges of the current month |
GET | /api/client/v1/invoices | List invoices |
GET | /api/client/v1/invoices/{id} | Read an invoice with its lines |
GET | /api/client/v1/balance | Balance, credit and movements |
POST | /api/client/v1/quote | Price of an order: lines, discounts, tax, total in cents |