Skip to main content

Networks

Private networks of the project​

GET /networks

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; default created:desc (pattern ^(id|name|created):(asc|desc)$)
qquerystringNoEvery word must match, in any case: part of the name or IP range, or label:key, label:key=value (minimum length 2, maximum length 100)

Responses​

StatusDescription
200Networks
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
networksarray of NetworkYes
metaMetaYes

Create a private network​

POST /networks

Parameters​

NameInTypeRequiredDescription
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)
ip_rangestringYesAn IPv4 or IPv6 range in CIDR notation (maximum length 49)
subnetsarray of objectNo(at most items 50)
subnets[].ip_rangestringYesAn IPv4 or IPv6 range in CIDR notation (maximum length 49)
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 network 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)
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
networkNetworkYes
actionActionYes

One network​

GET /networks/{id}

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes

Responses​

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

Response body​

FieldTypeRequiredDescription
networkNetworkYes

Rename or relabel a network​

PUT /networks/{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 network
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
networkNetworkYes

Delete a network​

DELETE /networks/{id}

Refused while servers are attached or protection.delete is on (409).

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 network​

GET /networks/{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 network​

GET /networks/{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

Add a subnet​

POST /networks/{id}/actions/add_subnet

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
ip_rangestringYesAn IPv4 or IPv6 range in CIDR notation (maximum length 49)

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

Remove an empty subnet​

POST /networks/{id}/actions/delete_subnet

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
ip_rangestringYesAn IPv4 or IPv6 range in CIDR notation (maximum length 49)

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 network from deletion​

POST /networks/{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