Skip to main content

Firewalls

Firewalls of the project​

GET /firewalls

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 label:key, label:key=value (minimum length 2, maximum length 100)

Responses​

StatusDescription
200Firewalls
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
firewallsarray of FirewallYes
metaMetaYes

Create a firewall (security group)​

POST /firewalls

Rules are inbound-closed by default; the request lists what is open.

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)
rulesarray of objectNo(at most items 50)
rules[].directionin, outYes
rules[].protocoltcp, udp, icmp, esp, greYes
rules[].portstring or nullNo(pattern ^[0-9]{1,5}(-[0-9]{1,5})?$)
rules[].source_ipsarray of stringNo(at most items 100)
rules[].destination_ipsarray of stringNo(at most items 100)
rules[].descriptionstring or nullNo(maximum length 200)
apply_toarray of FirewallTargetNo(at most items 100)
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 firewall and the actions that applied it
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
firewallFirewallYes
actionsarray of ActionYes

One firewall​

GET /firewalls/{id}

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes

Responses​

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

Response body​

FieldTypeRequiredDescription
firewallFirewallYes

Rename or relabel a firewall​

PUT /firewalls/{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 firewall
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
firewallFirewallYes

Delete a firewall​

DELETE /firewalls/{id}

Refused while applied to a server (409).

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes

Responses​

StatusDescription
204Deleted
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

Actions of a firewall​

GET /firewalls/{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 firewall​

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

Replace the rules of a firewall​

POST /firewalls/{id}/actions/set_rules

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
rulesarray of FirewallRuleYes(at most items 50)

Responses​

StatusDescription
201One action per affected resource
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
actionsarray of ActionYes

Apply a firewall to servers​

POST /firewalls/{id}/actions/apply_to_resources

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
apply_toarray of FirewallTargetYes(at least items 1, at most items 100)

Responses​

StatusDescription
201One action per affected resource
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
actionsarray of ActionYes

Remove a firewall from servers​

POST /firewalls/{id}/actions/remove_from_resources

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
remove_fromarray of FirewallTargetYes(at least items 1, at most items 100)

Responses​

StatusDescription
201One action per affected resource
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
actionsarray of ActionYes