API reference · Compute
SSH keys, init scripts and server groups
15 operations of the Ankra Cloud API: SSH keys, init scripts and server groups.
List init scripts#
/v1/init-scripts- Operation
list_init_scripts- Credentials
- API token, Portal session
- Requires
- Permission
read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
cursor | query | string | The next_cursor of the previous page. |
limit | query | integer | Page size; the server applies its default and maximum. |
Responses
200A page of init scripts, newest first.application/json · InitScriptList
| Field | Type | Description |
|---|---|---|
itemsrequired | array of InitScript | |
idrequired | string | |
namerequired | string | |
contentrequired | string | |
created_atrequired | string (date-time) | |
updated_atrequired | string (date-time) | |
next_cursorrequired | string | null | Pass as ?cursor= for the next page; null on the last page. |
- 400The request is invalid;
detailsays why. - 401Not signed in, or the credential is invalid or expired.
- 403The role lacks the permission, the token is read-only (a read-only token also gets
reason: read_only_token_cannot_read_credentialson every credential read), the CSRF header is missing, a support session may not do this, or the route needs a verified email address and the caller's is not (reason: email_unverified). - defaultAny other error, usually 500.
Example
curl 'https://cloud.ankra.app/v1/init-scripts' \
-H "Authorization: Bearer $ANKRA_CLOUD_TOKEN"Add an init script#
/v1/init-scripts- Operation
create_init_script- Credentials
- API token, Portal session
- Requires
- Permission
operate
Content up to 32 KiB; at most 100 scripts per account.
Request bodyapplication/json · InitScriptRequest
| Field | Type | Description |
|---|---|---|
name | string | |
content | string |
Responses
201Created.application/json
| Field | Type | Description |
|---|---|---|
init_scriptrequired | InitScript | |
idrequired | string | |
namerequired | string | |
contentrequired | string | |
created_atrequired | string (date-time) | |
updated_atrequired | string (date-time) |
- 400The request is invalid;
detailsays why. - 401Not signed in, or the credential is invalid or expired.
- 403The role lacks the permission, the token is read-only (a read-only token also gets
reason: read_only_token_cannot_read_credentialson every credential read), the CSRF header is missing, a support session may not do this, or the route needs a verified email address and the caller's is not (reason: email_unverified). - 409The resource's state does not allow this now.
- 422The account would exceed a quota;
detailnames the limit. - defaultAny other error, usually 500.
Example
curl -X POST 'https://cloud.ankra.app/v1/init-scripts' \
-H "Authorization: Bearer $ANKRA_CLOUD_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"name": "string",
"content": "string"
}'Get an init script#
/v1/init-scripts/{id}- Operation
get_init_script- Credentials
- API token, Portal session
- Requires
- Permission
read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Responses
200Found.application/json
| Field | Type | Description |
|---|---|---|
init_scriptrequired | InitScript | |
idrequired | string | |
namerequired | string | |
contentrequired | string | |
created_atrequired | string (date-time) | |
updated_atrequired | string (date-time) |
- 401Not signed in, or the credential is invalid or expired.
- 403The role lacks the permission, the token is read-only (a read-only token also gets
reason: read_only_token_cannot_read_credentialson every credential read), the CSRF header is missing, a support session may not do this, or the route needs a verified email address and the caller's is not (reason: email_unverified). - 404No such resource in the caller's account.
- defaultAny other error, usually 500.
Example
curl 'https://cloud.ankra.app/v1/init-scripts/<id>' \
-H "Authorization: Bearer $ANKRA_CLOUD_TOKEN"Change an init script#
/v1/init-scripts/{id}- Operation
update_init_script- Credentials
- API token, Portal session
- Requires
- Permission
operate
Servers keep the user data they booted with.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Request bodyapplication/json · InitScriptRequest
| Field | Type | Description |
|---|---|---|
name | string | |
content | string |
Responses
200Updated.application/json
| Field | Type | Description |
|---|---|---|
init_scriptrequired | InitScript | |
idrequired | string | |
namerequired | string | |
contentrequired | string | |
created_atrequired | string (date-time) | |
updated_atrequired | string (date-time) |
- 400The request is invalid;
detailsays why. - 401Not signed in, or the credential is invalid or expired.
- 403The role lacks the permission, the token is read-only (a read-only token also gets
reason: read_only_token_cannot_read_credentialson every credential read), the CSRF header is missing, a support session may not do this, or the route needs a verified email address and the caller's is not (reason: email_unverified). - 404No such resource in the caller's account.
- 409The resource's state does not allow this now.
- defaultAny other error, usually 500.
Example
curl -X PATCH 'https://cloud.ankra.app/v1/init-scripts/<id>' \
-H "Authorization: Bearer $ANKRA_CLOUD_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"name": "string",
"content": "string"
}'Delete an init script#
/v1/init-scripts/{id}- Operation
delete_init_script- Credentials
- API token, Portal session
- Requires
- Permission
operate
Servers keep the user data they booted with.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Responses
204Deleted.
- 401Not signed in, or the credential is invalid or expired.
- 403The role lacks the permission, the token is read-only (a read-only token also gets
reason: read_only_token_cannot_read_credentialson every credential read), the CSRF header is missing, a support session may not do this, or the route needs a verified email address and the caller's is not (reason: email_unverified). - 404No such resource in the caller's account.
- 409The resource's state does not allow this now.
- defaultAny other error, usually 500.
Example
curl -X DELETE 'https://cloud.ankra.app/v1/init-scripts/<id>' \
-H "Authorization: Bearer $ANKRA_CLOUD_TOKEN"List server groups#
/v1/server-groups- Operation
list_server_groups- Credentials
- API token, Portal session
- Requires
- Permission
read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
cursor | query | string | The next_cursor of the previous page. |
limit | query | integer | Page size; the server applies its default and maximum. |
Responses
200A page of server groups, newest first.application/json · ServerGroupList
| Field | Type | Description |
|---|---|---|
itemsrequired | array of ServerGroup | |
idrequired | string | |
zonerequired | string | null | Null for a zone-spread group, whose members live in several zones of region. |
regionrequired | string | |
namerequired | string | |
spreadrequired | string | The failure domain members are kept apart in. host: different compute nodes, preferring different racks; rack: different racks of the zone; zone: different zones of the region (and different nodes inside each).One of host, rack, zone |
strictrequired | boolean | Placement fails with a clear error rather than share a failure domain. |
policyrequired | string | The same as strict (strict: true), kept for older clients.One of strict, soft |
member_countrequired | integer | |
members | array of string | Server identifiers, oldest first; only on the single-group read. |
created_atrequired | string (date-time) | |
next_cursorrequired | string | null | Pass as ?cursor= for the next page; null on the last page. |
- 400The request is invalid;
detailsays why. - 401Not signed in, or the credential is invalid or expired.
- 403The role lacks the permission, the token is read-only (a read-only token also gets
reason: read_only_token_cannot_read_credentialson every credential read), the CSRF header is missing, a support session may not do this, or the route needs a verified email address and the caller's is not (reason: email_unverified). - defaultAny other error, usually 500.
Example
curl 'https://cloud.ankra.app/v1/server-groups' \
-H "Authorization: Bearer $ANKRA_CLOUD_TOKEN"Add a server group#
/v1/server-groups- Operation
create_server_group- Credentials
- API token, Portal session
- Requires
- Permission
operate
An empty anti-affinity group in a zone; at most 100 groups per account.
Request bodyapplication/json · CreateServerGroupRequest
| Field | Type | Description |
|---|---|---|
zone | string | Required for host and rack spread; for zone spread it names a zone of the region instead of region. |
region | string | The region of a zone-spread group (or give zone). |
namerequired | string | |
spread | string | One of host, rack, zone |
strict | boolean | |
policy | string | Older spelling of strict; send one of the two.One of strict, soft |
Responses
201Created.application/json
| Field | Type | Description |
|---|---|---|
server_grouprequired | ServerGroup | |
idrequired | string | |
zonerequired | string | null | Null for a zone-spread group, whose members live in several zones of region. |
regionrequired | string | |
namerequired | string | |
spreadrequired | string | The failure domain members are kept apart in. host: different compute nodes, preferring different racks; rack: different racks of the zone; zone: different zones of the region (and different nodes inside each).One of host, rack, zone |
strictrequired | boolean | Placement fails with a clear error rather than share a failure domain. |
policyrequired | string | The same as strict (strict: true), kept for older clients.One of strict, soft |
member_countrequired | integer | |
members | array of string | Server identifiers, oldest first; only on the single-group read. |
created_atrequired | string (date-time) |
- 400The request is invalid;
detailsays why. - 401Not signed in, or the credential is invalid or expired.
- 403The role lacks the permission, the token is read-only (a read-only token also gets
reason: read_only_token_cannot_read_credentialson every credential read), the CSRF header is missing, a support session may not do this, or the route needs a verified email address and the caller's is not (reason: email_unverified). - 409The resource's state does not allow this now.
- 422The account would exceed a quota;
detailnames the limit. - defaultAny other error, usually 500.
Example
curl -X POST 'https://cloud.ankra.app/v1/server-groups' \
-H "Authorization: Bearer $ANKRA_CLOUD_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"name": "string"
}'Get a server group#
/v1/server-groups/{id}- Operation
get_server_group- Credentials
- API token, Portal session
- Requires
- Permission
read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Responses
200Found.application/json
| Field | Type | Description |
|---|---|---|
server_grouprequired | ServerGroup | |
idrequired | string | |
zonerequired | string | null | Null for a zone-spread group, whose members live in several zones of region. |
regionrequired | string | |
namerequired | string | |
spreadrequired | string | The failure domain members are kept apart in. host: different compute nodes, preferring different racks; rack: different racks of the zone; zone: different zones of the region (and different nodes inside each).One of host, rack, zone |
strictrequired | boolean | Placement fails with a clear error rather than share a failure domain. |
policyrequired | string | The same as strict (strict: true), kept for older clients.One of strict, soft |
member_countrequired | integer | |
members | array of string | Server identifiers, oldest first; only on the single-group read. |
created_atrequired | string (date-time) |
- 401Not signed in, or the credential is invalid or expired.
- 403The role lacks the permission, the token is read-only (a read-only token also gets
reason: read_only_token_cannot_read_credentialson every credential read), the CSRF header is missing, a support session may not do this, or the route needs a verified email address and the caller's is not (reason: email_unverified). - 404No such resource in the caller's account.
- defaultAny other error, usually 500.
Example
curl 'https://cloud.ankra.app/v1/server-groups/<id>' \
-H "Authorization: Bearer $ANKRA_CLOUD_TOKEN"Change a server group#
/v1/server-groups/{id}- Operation
update_server_group- Credentials
- API token, Portal session
- Requires
- Permission
operate
Only the name changes.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Request bodyapplication/json · RenameRequest
| Field | Type | Description |
|---|---|---|
namerequired | string |
Responses
200Updated.application/json
| Field | Type | Description |
|---|---|---|
server_grouprequired | ServerGroup | |
idrequired | string | |
zonerequired | string | null | Null for a zone-spread group, whose members live in several zones of region. |
regionrequired | string | |
namerequired | string | |
spreadrequired | string | The failure domain members are kept apart in. host: different compute nodes, preferring different racks; rack: different racks of the zone; zone: different zones of the region (and different nodes inside each).One of host, rack, zone |
strictrequired | boolean | Placement fails with a clear error rather than share a failure domain. |
policyrequired | string | The same as strict (strict: true), kept for older clients.One of strict, soft |
member_countrequired | integer | |
members | array of string | Server identifiers, oldest first; only on the single-group read. |
created_atrequired | string (date-time) |
- 400The request is invalid;
detailsays why. - 401Not signed in, or the credential is invalid or expired.
- 403The role lacks the permission, the token is read-only (a read-only token also gets
reason: read_only_token_cannot_read_credentialson every credential read), the CSRF header is missing, a support session may not do this, or the route needs a verified email address and the caller's is not (reason: email_unverified). - 404No such resource in the caller's account.
- 409The resource's state does not allow this now.
- defaultAny other error, usually 500.
Example
curl -X PATCH 'https://cloud.ankra.app/v1/server-groups/<id>' \
-H "Authorization: Bearer $ANKRA_CLOUD_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"name": "string"
}'Delete a server group#
/v1/server-groups/{id}- Operation
delete_server_group- Credentials
- API token, Portal session
- Requires
- Permission
operate
409 while the group has servers.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Responses
204Deleted.
- 401Not signed in, or the credential is invalid or expired.
- 403The role lacks the permission, the token is read-only (a read-only token also gets
reason: read_only_token_cannot_read_credentialson every credential read), the CSRF header is missing, a support session may not do this, or the route needs a verified email address and the caller's is not (reason: email_unverified). - 404No such resource in the caller's account.
- 409The resource's state does not allow this now.
- defaultAny other error, usually 500.
Example
curl -X DELETE 'https://cloud.ankra.app/v1/server-groups/<id>' \
-H "Authorization: Bearer $ANKRA_CLOUD_TOKEN"List SSH keys#
/v1/ssh-keys- Operation
list_ssh_keys- Credentials
- API token, Portal session
- Requires
- Permission
read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
cursor | query | string | The next_cursor of the previous page. |
limit | query | integer | Page size; the server applies its default and maximum. |
Responses
200A page of SSH keys, newest first.application/json · SSHKeyList
| Field | Type | Description |
|---|---|---|
itemsrequired | array of SSHKey | |
idrequired | string | |
namerequired | string | |
public_keyrequired | string | |
fingerprintrequired | string | SHA256 fingerprint, as ssh-keygen -l prints it. |
created_atrequired | string (date-time) | |
next_cursorrequired | string | null | Pass as ?cursor= for the next page; null on the last page. |
- 400The request is invalid;
detailsays why. - 401Not signed in, or the credential is invalid or expired.
- 403The role lacks the permission, the token is read-only (a read-only token also gets
reason: read_only_token_cannot_read_credentialson every credential read), the CSRF header is missing, a support session may not do this, or the route needs a verified email address and the caller's is not (reason: email_unverified). - defaultAny other error, usually 500.
Example
curl 'https://cloud.ankra.app/v1/ssh-keys' \
-H "Authorization: Bearer $ANKRA_CLOUD_TOKEN"Add an SSH key#
/v1/ssh-keys- Operation
create_ssh_key- Credentials
- API token, Portal session
- Requires
- Permission
operate
409 when the account already holds the name or the key; at most 100 keys per account.
Request bodyapplication/json · CreateSSHKeyRequest
| Field | Type | Description |
|---|---|---|
namerequired | string | |
public_keyrequired | string | One OpenSSH public key line. |
Responses
201Created.application/json
| Field | Type | Description |
|---|---|---|
ssh_keyrequired | SSHKey | |
idrequired | string | |
namerequired | string | |
public_keyrequired | string | |
fingerprintrequired | string | SHA256 fingerprint, as ssh-keygen -l prints it. |
created_atrequired | string (date-time) |
- 400The request is invalid;
detailsays why. - 401Not signed in, or the credential is invalid or expired.
- 403The role lacks the permission, the token is read-only (a read-only token also gets
reason: read_only_token_cannot_read_credentialson every credential read), the CSRF header is missing, a support session may not do this, or the route needs a verified email address and the caller's is not (reason: email_unverified). - 409The resource's state does not allow this now.
- 422The account would exceed a quota;
detailnames the limit. - defaultAny other error, usually 500.
Example
curl -X POST 'https://cloud.ankra.app/v1/ssh-keys' \
-H "Authorization: Bearer $ANKRA_CLOUD_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"name": "string",
"public_key": "string"
}'Get an SSH key#
/v1/ssh-keys/{id}- Operation
get_ssh_key- Credentials
- API token, Portal session
- Requires
- Permission
read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Responses
200Found.application/json
| Field | Type | Description |
|---|---|---|
ssh_keyrequired | SSHKey | |
idrequired | string | |
namerequired | string | |
public_keyrequired | string | |
fingerprintrequired | string | SHA256 fingerprint, as ssh-keygen -l prints it. |
created_atrequired | string (date-time) |
- 401Not signed in, or the credential is invalid or expired.
- 403The role lacks the permission, the token is read-only (a read-only token also gets
reason: read_only_token_cannot_read_credentialson every credential read), the CSRF header is missing, a support session may not do this, or the route needs a verified email address and the caller's is not (reason: email_unverified). - 404No such resource in the caller's account.
- defaultAny other error, usually 500.
Example
curl 'https://cloud.ankra.app/v1/ssh-keys/<id>' \
-H "Authorization: Bearer $ANKRA_CLOUD_TOKEN"Change an SSH key#
/v1/ssh-keys/{id}- Operation
update_ssh_key- Credentials
- API token, Portal session
- Requires
- Permission
operate
Only the name changes; add a new key and delete the old one to replace a key.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Request bodyapplication/json · RenameRequest
| Field | Type | Description |
|---|---|---|
namerequired | string |
Responses
200Updated.application/json
| Field | Type | Description |
|---|---|---|
ssh_keyrequired | SSHKey | |
idrequired | string | |
namerequired | string | |
public_keyrequired | string | |
fingerprintrequired | string | SHA256 fingerprint, as ssh-keygen -l prints it. |
created_atrequired | string (date-time) |
- 400The request is invalid;
detailsays why. - 401Not signed in, or the credential is invalid or expired.
- 403The role lacks the permission, the token is read-only (a read-only token also gets
reason: read_only_token_cannot_read_credentialson every credential read), the CSRF header is missing, a support session may not do this, or the route needs a verified email address and the caller's is not (reason: email_unverified). - 404No such resource in the caller's account.
- 409The resource's state does not allow this now.
- defaultAny other error, usually 500.
Example
curl -X PATCH 'https://cloud.ankra.app/v1/ssh-keys/<id>' \
-H "Authorization: Bearer $ANKRA_CLOUD_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"name": "string"
}'Delete an SSH key#
/v1/ssh-keys/{id}- Operation
delete_ssh_key- Credentials
- API token, Portal session
- Requires
- Permission
operate
Servers keep the keys they were created with.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Responses
204Deleted.
- 401Not signed in, or the credential is invalid or expired.
- 403The role lacks the permission, the token is read-only (a read-only token also gets
reason: read_only_token_cannot_read_credentialson every credential read), the CSRF header is missing, a support session may not do this, or the route needs a verified email address and the caller's is not (reason: email_unverified). - 404No such resource in the caller's account.
- 409The resource's state does not allow this now.
- defaultAny other error, usually 500.
Example
curl -X DELETE 'https://cloud.ankra.app/v1/ssh-keys/<id>' \
-H "Authorization: Bearer $ANKRA_CLOUD_TOKEN"