Skip to main content

Servers

Servers of the project​

GET /servers

Parameters​

NameInTypeRequiredDescription
pagequeryintegerNo(minimum 1, default 1)
per_pagequeryintegerNo(minimum 1, maximum 100, default 25)
namequerystringNoExact name (maximum length 64)
label_selectorquerystringNokey, !key, key==v, key=v, key!=v, key in (a,b), key notin (a,b); comma-separated (and) (maximum length 1024)
sortquerystringNo<field>:asc|desc; fields id, name, created, status, server_type; default created:desc (pattern ^(id|name|created|status|server_type):(asc|desc)$)
qquerystringNoEvery word must match, in any case: part of the name or a public address, or label:key, label:key=value (minimum length 2, maximum length 100)
statusqueryinitializing, starting, running, stopping, off, deleting, rebuilding, migrating, unknownNo
busyquerybooleanNotrue: a running action or a transitional status; false: neither

Responses​

StatusDescription
200Servers
401No valid API key
403The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded)
422A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch)
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
serversarray of ServerYes
metaMetaYes

Create a server​

POST /servers

Counts against the project's servers, vcpu, ram and volume quota (403 resource_limit_exceeded).

Parameters​

NameInTypeRequiredDescription
Idempotency-KeyheaderstringNo16-128 visible ASCII characters; the first response is replayed for 24 hours (pattern ^[\x21-\x7e]{16,128}$)

Request body​

Exactly one of image and snapshot. A snapshot gives only its root disk; it must be of this project and location, and the server type's disk no smaller than the snapshot.

FieldTypeRequiredDescription
namestringYes1-64 printable characters without @ (minimum length 1, maximum length 64)
server_typeReferenceYes
imageReferenceNo
snapshotReferenceNo
locationReferenceYes
ssh_keysarray of ReferenceNo(at most items 20)
networksarray of ReferenceNo(at most items 10)
firewallsarray of ReferenceNo(at most items 5)
user_datastringNocloud-init user data; at most 24 KiB (24576 bytes in UTF-8). A longer value is 422 user_data malformed. (maximum length 24576)
start_after_createbooleanNo(default true)
labelsmap of stringNoAt most 32 keys; keys and values of 1-63 (values may be empty) letters, digits, ., _, -, starting and ending with a letter or digit
console_password_hashstringNoOptional console password for the image's default user (Image.default_user), as a SHA-512 crypt hash only: the password never reaches Netface. SSH stays key-only. The hash goes to the server's user data last, after user_data, and is taken away once the server has started; the two together are limited to 24576 bytes. Not offered for an image without a default user, nor with a user_data that is itself a MIME multipart. (pattern ^\$6\$(rounds=[1-9][0-9]{3,8}\$)?[./0-9A-Za-z]{1,16}\$[./0-9A-Za-z]{86}$)

Responses​

StatusDescription
201The server (initializing) and the create action
401No valid API key
403The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded)
409The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress)
422A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch)
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
serverServerYes
actionActionYes
root_passwordstring or nullYesReserved; null in this version. Sign in with an SSH key or the console password.

One server​

GET /servers/{id}

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes

Responses​

StatusDescription
200The server
401No valid API key
404No such resource in this project
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
serverServerYes

Rename or relabel a server​

PUT /servers/{id}

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes

Request body​

FieldTypeRequiredDescription
namestringNo1-64 printable characters without @ (minimum length 1, maximum length 64)
labelsmap of stringNoAt most 32 keys; keys and values of 1-63 (values may be empty) letters, digits, ., _, -, starting and ending with a letter or digit

Responses​

StatusDescription
200The server
401No valid API key
403The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded)
404No such resource in this project
409The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress)
422A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch)
423The resource has a running action
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
serverServerYes

Delete a server​

DELETE /servers/{id}

Refused while protection.delete is on (409). Releases the server's quota when the action succeeds.

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes

Responses​

StatusDescription
201The action
401No valid API key
403The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded)
404No such resource in this project
409The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress)
423The resource has a running action
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
actionActionYes

Actions of a server​

GET /servers/{id}/actions

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes
pagequeryintegerNo(minimum 1, default 1)
per_pagequeryintegerNo(minimum 1, maximum 100, default 25)
statusqueryrunning, success, errorNo
sortquerystringNo<field>:asc|desc; fields id, command, status, started, finished; default started:desc (pattern ^(id|command|status|started|finished):(asc|desc)$)

Responses​

StatusDescription
200Actions
401No valid API key
404No such resource in this project
422A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch)
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
actionsarray of ActionYes
metaMetaYes

One action of a server​

GET /servers/{id}/actions/{action_id}

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes
action_idpathstring (uuid)Yes

Responses​

StatusDescription
200The action
401No valid API key
404No such resource in this project
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
actionActionYes

Power a server on​

POST /servers/{id}/actions/poweron

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes
Idempotency-KeyheaderstringNo16-128 visible ASCII characters; the first response is replayed for 24 hours (pattern ^[\x21-\x7e]{16,128}$)

Responses​

StatusDescription
201The action
401No valid API key
403The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded)
404No such resource in this project
409The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress)
422A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch)
423The resource has a running action
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
actionActionYes

Cut a server's power (hard)​

POST /servers/{id}/actions/poweroff

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes
Idempotency-KeyheaderstringNo16-128 visible ASCII characters; the first response is replayed for 24 hours (pattern ^[\x21-\x7e]{16,128}$)

Responses​

StatusDescription
201The action
401No valid API key
403The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded)
404No such resource in this project
409The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress)
422A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch)
423The resource has a running action
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
actionActionYes

Shut a server down (ACPI)​

POST /servers/{id}/actions/shutdown

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes
Idempotency-KeyheaderstringNo16-128 visible ASCII characters; the first response is replayed for 24 hours (pattern ^[\x21-\x7e]{16,128}$)

Responses​

StatusDescription
201The action
401No valid API key
403The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded)
404No such resource in this project
409The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress)
422A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch)
423The resource has a running action
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
actionActionYes

Reboot a server (ACPI)​

POST /servers/{id}/actions/reboot

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes
Idempotency-KeyheaderstringNo16-128 visible ASCII characters; the first response is replayed for 24 hours (pattern ^[\x21-\x7e]{16,128}$)

Responses​

StatusDescription
201The action
401No valid API key
403The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded)
404No such resource in this project
409The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress)
422A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch)
423The resource has a running action
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
actionActionYes

Reset a server (hard)​

POST /servers/{id}/actions/reset

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes
Idempotency-KeyheaderstringNo16-128 visible ASCII characters; the first response is replayed for 24 hours (pattern ^[\x21-\x7e]{16,128}$)

Responses​

StatusDescription
201The action
401No valid API key
403The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded)
404No such resource in this project
409The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress)
422A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch)
423The resource has a running action
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
actionActionYes

Change the server type​

POST /servers/{id}/actions/resize

The server must be off. Counts against the vcpu, ram and volume quota.

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes
Idempotency-KeyheaderstringNo16-128 visible ASCII characters; the first response is replayed for 24 hours (pattern ^[\x21-\x7e]{16,128}$)

Request body​

FieldTypeRequiredDescription
server_typeReferenceYes
upgrade_diskbooleanNo(default false)

Responses​

StatusDescription
201The action
401No valid API key
403The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded)
404No such resource in this project
409The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress)
422A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch)
423The resource has a running action
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
actionActionYes

Rebuild a server from an image or a snapshot​

POST /servers/{id}/actions/rebuild

Exactly one of image and snapshot. Everything on the root disk is replaced; a failed rebuild may already have replaced it (the action then ends resolution_required).

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes
Idempotency-KeyheaderstringNo16-128 visible ASCII characters; the first response is replayed for 24 hours (pattern ^[\x21-\x7e]{16,128}$)

Request body​

FieldTypeRequiredDescription
imageReferenceNo
snapshotReferenceNo
console_password_hashstringNoOptional new console password for the image's default user, as a SHA-512 crypt hash only. A password set earlier does not carry over a rebuild. The hash is taken away once the server has started. Not offered with snapshot, nor for an image without a default user; a server whose user_data cannot take it (a MIME multipart, or over 24576 bytes together) ends the action provider_refused, with the disk untouched. (pattern ^\$6\$(rounds=[1-9][0-9]{3,8}\$)?[./0-9A-Za-z]{1,16}\$[./0-9A-Za-z]{86}$)

Responses​

StatusDescription
201The action
401No valid API key
403The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded)
404No such resource in this project
409The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress)
422A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch)
423The resource has a running action
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
actionActionYes

Snapshot a server's disk​

POST /servers/{id}/actions/create_snapshot

Counts against the snapshot quota.

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes
Idempotency-KeyheaderstringNo16-128 visible ASCII characters; the first response is replayed for 24 hours (pattern ^[\x21-\x7e]{16,128}$)

Request body​

FieldTypeRequiredDescription
namestringYes1-64 printable characters without @ (minimum length 1, maximum length 64)
labelsmap of stringNoAt most 32 keys; keys and values of 1-63 (values may be empty) letters, digits, ., _, -, starting and ending with a letter or digit

Responses​

StatusDescription
201The snapshot (creating) and its action
401No valid API key
403The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded)
404No such resource in this project
409The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress)
422A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch)
423The resource has a running action
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
snapshotSnapshotYes
actionActionYes

Attach a server to a private network​

POST /servers/{id}/actions/attach_to_network

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes
Idempotency-KeyheaderstringNo16-128 visible ASCII characters; the first response is replayed for 24 hours (pattern ^[\x21-\x7e]{16,128}$)

Request body​

FieldTypeRequiredDescription
networkReferenceYes
ipstringNoA free address of the network's subnet; chosen by the platform when absent (maximum length 45)

Responses​

StatusDescription
201The action
401No valid API key
403The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded)
404No such resource in this project
409The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress)
422A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch)
423The resource has a running action
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
actionActionYes

Detach a server from a private network​

POST /servers/{id}/actions/detach_from_network

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes
Idempotency-KeyheaderstringNo16-128 visible ASCII characters; the first response is replayed for 24 hours (pattern ^[\x21-\x7e]{16,128}$)

Request body​

FieldTypeRequiredDescription
networkReferenceYes

Responses​

StatusDescription
201The action
401No valid API key
403The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded)
404No such resource in this project
409The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress)
422A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch)
423The resource has a running action
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
actionActionYes

Protect a server from deletion​

POST /servers/{id}/actions/change_protection

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes
Idempotency-KeyheaderstringNo16-128 visible ASCII characters; the first response is replayed for 24 hours (pattern ^[\x21-\x7e]{16,128}$)

Request body​

FieldTypeRequiredDescription
deletebooleanYes

Responses​

StatusDescription
201The action
401No valid API key
403The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded)
404No such resource in this project
409The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress)
422A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch)
423The resource has a running action
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
actionActionYes

POST /servers/{id}/actions/request_console

Only a running server (409 conflict, details.reason = invalid_state) and only a read_write key or person, also while the subscription is restricted. No body and no Idempotency-Key (422 invalid_input): the link is returned once, to this requester, and is never stored for a replay. Opening the link gives full access to the server's screen and keyboard; treat it as a secret until expires_at (at most 60 seconds; the link works once). When the link is not ready within seconds the request is 503 unavailable with Retry-After and the link is never returned later; ask again. A location that offers no console is 409 conflict with details.reason = not_offered and details.action (the action ends with the error code not_offered); asking again does not help. A console allowance per server and per requester applies on top of the key's (429).

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes

Responses​

StatusDescription
201The finished action and the link
401No valid API key
403The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded)
404No such resource in this project
409The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress)
422A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch)
423The resource has a running action
429The key's allowance is used up
503The service could not answer in time (unavailable); ask again after Retry-After

Response body​

FieldTypeRequiredDescription
actionActionYes
consoleobjectYes
console.urlstring (uri)YesOpens the console in a browser
console.expires_atstring (date-time)Yes