Firewalls of the project
GET /firewalls
Parameters
| Name | In | Type | Required | Description |
|---|
page | query | integer | No | (minimum 1, default 1) |
per_page | query | integer | No | (minimum 1, maximum 100, default 25) |
name | query | string | No | Exact name (maximum length 64) |
label_selector | query | string | No | key, !key, key==v, key=v, key!=v, key in (a,b), key notin (a,b); comma-separated (and) (maximum length 1024) |
sort | query | string | No | <field>:asc|desc; fields id, name, created; default created:desc (pattern ^(id|name|created):(asc|desc)$) |
q | query | string | No | Every word must match, in any case: part of the name, or label:key, label:key=value (minimum length 2, maximum length 100) |
Responses
| Status | Description |
|---|
200 | Firewalls |
401 | No valid API key |
403 | The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded) |
422 | A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch) |
429 | The key's allowance is used up |
Response body
| Field | Type | Required | Description |
|---|
firewalls | array of Firewall | Yes | |
meta | Meta | Yes | |
Create a firewall (security group)
POST /firewalls
Rules are inbound-closed by default; the request lists what is open.
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | No | 16-128 visible ASCII characters; the first response is replayed for 24 hours (pattern ^[\x21-\x7e]{16,128}$) |
Request body
| Field | Type | Required | Description |
|---|
name | string | Yes | 1-64 printable characters without @ (minimum length 1, maximum length 64) |
rules | array of object | No | (at most items 50) |
rules[].direction | in, out | Yes | |
rules[].protocol | tcp, udp, icmp, esp, gre | Yes | |
rules[].port | string or null | No | (pattern ^[0-9]{1,5}(-[0-9]{1,5})?$) |
rules[].source_ips | array of string | No | (at most items 100) |
rules[].destination_ips | array of string | No | (at most items 100) |
rules[].description | string or null | No | (maximum length 200) |
apply_to | array of FirewallTarget | No | (at most items 100) |
labels | map of string | No | At most 32 keys; keys and values of 1-63 (values may be empty) letters, digits, ., _, -, starting and ending with a letter or digit |
Responses
| Status | Description |
|---|
201 | The firewall and the actions that applied it |
401 | No valid API key |
403 | The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded) |
409 | The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress) |
422 | A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch) |
429 | The key's allowance is used up |
Response body
| Field | Type | Required | Description |
|---|
firewall | Firewall | Yes | |
actions | array of Action | Yes | |
One firewall
GET /firewalls/{id}
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | Yes | |
Responses
| Status | Description |
|---|
200 | The firewall |
401 | No valid API key |
404 | No such resource in this project |
429 | The key's allowance is used up |
Response body
| Field | Type | Required | Description |
|---|
firewall | Firewall | Yes | |
Rename or relabel a firewall
PUT /firewalls/{id}
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | Yes | |
Request body
| Field | Type | Required | Description |
|---|
name | string | No | 1-64 printable characters without @ (minimum length 1, maximum length 64) |
labels | map of string | No | At most 32 keys; keys and values of 1-63 (values may be empty) letters, digits, ., _, -, starting and ending with a letter or digit |
Responses
| Status | Description |
|---|
200 | The firewall |
401 | No valid API key |
403 | The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded) |
404 | No such resource in this project |
409 | The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress) |
422 | A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch) |
423 | The resource has a running action |
429 | The key's allowance is used up |
Response body
| Field | Type | Required | Description |
|---|
firewall | Firewall | Yes | |
Delete a firewall
DELETE /firewalls/{id}
Refused while applied to a server (409).
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | Yes | |
Responses
| Status | Description |
|---|
204 | Deleted |
401 | No valid API key |
403 | The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded) |
404 | No such resource in this project |
409 | The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress) |
423 | The resource has a running action |
429 | The key's allowance is used up |
Actions of a firewall
GET /firewalls/{id}/actions
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | Yes | |
page | query | integer | No | (minimum 1, default 1) |
per_page | query | integer | No | (minimum 1, maximum 100, default 25) |
status | query | running, success, error | No | |
sort | query | string | No | <field>:asc|desc; fields id, command, status, started, finished; default started:desc (pattern ^(id|command|status|started|finished):(asc|desc)$) |
Responses
| Status | Description |
|---|
200 | Actions |
401 | No valid API key |
404 | No such resource in this project |
422 | A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch) |
429 | The key's allowance is used up |
Response body
| Field | Type | Required | Description |
|---|
actions | array of Action | Yes | |
meta | Meta | Yes | |
One action of a firewall
GET /firewalls/{id}/actions/{action_id}
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | Yes | |
action_id | path | string (uuid) | Yes | |
Responses
| Status | Description |
|---|
200 | The action |
401 | No valid API key |
404 | No such resource in this project |
429 | The key's allowance is used up |
Response body
| Field | Type | Required | Description |
|---|
action | Action | Yes | |
Replace the rules of a firewall
POST /firewalls/{id}/actions/set_rules
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | Yes | |
Idempotency-Key | header | string | No | 16-128 visible ASCII characters; the first response is replayed for 24 hours (pattern ^[\x21-\x7e]{16,128}$) |
Request body
| Field | Type | Required | Description |
|---|
rules | array of FirewallRule | Yes | (at most items 50) |
Responses
| Status | Description |
|---|
201 | One action per affected resource |
401 | No valid API key |
403 | The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded) |
404 | No such resource in this project |
409 | The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress) |
422 | A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch) |
423 | The resource has a running action |
429 | The key's allowance is used up |
Response body
| Field | Type | Required | Description |
|---|
actions | array of Action | Yes | |
Apply a firewall to servers
POST /firewalls/{id}/actions/apply_to_resources
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | Yes | |
Idempotency-Key | header | string | No | 16-128 visible ASCII characters; the first response is replayed for 24 hours (pattern ^[\x21-\x7e]{16,128}$) |
Request body
| Field | Type | Required | Description |
|---|
apply_to | array of FirewallTarget | Yes | (at least items 1, at most items 100) |
Responses
| Status | Description |
|---|
201 | One action per affected resource |
401 | No valid API key |
403 | The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded) |
404 | No such resource in this project |
409 | The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress) |
422 | A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch) |
423 | The resource has a running action |
429 | The key's allowance is used up |
Response body
| Field | Type | Required | Description |
|---|
actions | array of Action | Yes | |
Remove a firewall from servers
POST /firewalls/{id}/actions/remove_from_resources
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | Yes | |
Idempotency-Key | header | string | No | 16-128 visible ASCII characters; the first response is replayed for 24 hours (pattern ^[\x21-\x7e]{16,128}$) |
Request body
| Field | Type | Required | Description |
|---|
remove_from | array of FirewallTarget | Yes | (at least items 1, at most items 100) |
Responses
| Status | Description |
|---|
201 | One action per affected resource |
401 | No valid API key |
403 | The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded) |
404 | No such resource in this project |
409 | The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress) |
422 | A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch) |
423 | The resource has a running action |
429 | The key's allowance is used up |
Response body
| Field | Type | Required | Description |
|---|
actions | array of Action | Yes | |