Skip to content
Odinex Cloud
API reference

Firewalls

List firewalls

GET
/firewalls

Authorization

headerAuthorizationBearer <token>

Query Parameters

label_selector?string

Filter by labels: env=prod, env!=prod, env (has key), !env; comma = AND

Response Body

Firewalls

application/json
  1. response
firewalls*array<>
curl -X GET "https://example.com/firewalls"
{  "firewalls": [    {      "id": 0,      "name": "string",      "rules": [        {          "direction": "in",          "protocol": "tcp",          "port": "string",          "source_ips": [            "string"          ],          "destination_ips": [            "string"          ],          "description": "string"        }      ],      "applied_to": [        {          "type": "server",          "server": 0,          "label_selector": "string",          "applied_to_servers": [            0          ]        }      ],      "labels": {        "property1": "string",        "property2": "string"      },      "created": "2019-08-24T14:15:22Z"    }  ]}

Create firewall

POST
/firewalls

Authorization

headerAuthorizationBearer <token>

Request Body

application/json
  1. body
name*string
Length1 <= length <= 64
rules?array<>
apply_to?array<>
labels?

Up to 64 key/value pairs; keys and values up to 63 characters

Response Body

Created

application/json
  1. response
firewall*
action?|null
curl -X POST "https://example.com/firewalls" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "firewall": {    "id": 0,    "name": "string",    "rules": [      {        "direction": "in",        "protocol": "tcp",        "port": "string",        "source_ips": [          "string"        ],        "destination_ips": [          "string"        ],        "description": "string"      }    ],    "applied_to": [      {        "type": "server",        "server": 0,        "label_selector": "string",        "applied_to_servers": [          0        ]      }    ],    "labels": {      "property1": "string",      "property2": "string"    },    "created": "2019-08-24T14:15:22Z"  },  "action": {    "id": 0,    "command": "create_server",    "status": "running",    "progress": 0,    "started": "2019-08-24T14:15:22Z",    "finished": "2019-08-24T14:15:22Z",    "resources": [      {        "id": 0,        "type": "server"      }    ],    "error": {      "code": "string",      "message": "string"    }  }}

Get firewall

GET
/firewalls/{id}

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Response Body

Firewall

application/json
  1. response
firewall*
curl -X GET "https://example.com/firewalls/0"
{  "firewall": {    "id": 0,    "name": "string",    "rules": [      {        "direction": "in",        "protocol": "tcp",        "port": "string",        "source_ips": [          "string"        ],        "destination_ips": [          "string"        ],        "description": "string"      }    ],    "applied_to": [      {        "type": "server",        "server": 0,        "label_selector": "string",        "applied_to_servers": [          0        ]      }    ],    "labels": {      "property1": "string",      "property2": "string"    },    "created": "2019-08-24T14:15:22Z"  }}

Delete firewall

DELETE
/firewalls/{id}

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Response Body

Deleted

curl -X DELETE "https://example.com/firewalls/0"
Empty

Update firewall

PUT
/firewalls/{id}

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Request Body

application/json
  1. body
name?string
Length1 <= length <= 64
labels?

Up to 64 key/value pairs; keys and values up to 63 characters

Response Body

Updated

application/json
  1. response
firewall*
curl -X PUT "https://example.com/firewalls/0" \  -H "Content-Type: application/json" \  -d '{}'
{  "firewall": {    "id": 0,    "name": "string",    "rules": [      {        "direction": "in",        "protocol": "tcp",        "port": "string",        "source_ips": [          "string"        ],        "destination_ips": [          "string"        ],        "description": "string"      }    ],    "applied_to": [      {        "type": "server",        "server": 0,        "label_selector": "string",        "applied_to_servers": [          0        ]      }    ],    "labels": {      "property1": "string",      "property2": "string"    },    "created": "2019-08-24T14:15:22Z"  }}

Replace all rules

POST
/firewalls/{id}/actions/set_rules

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Request Body

application/json
  1. body
rules*array<>

Response Body

Action started

application/json
  1. response
action*
curl -X POST "https://example.com/firewalls/0/actions/set_rules" \  -H "Content-Type: application/json" \  -d '{    "rules": [      {        "direction": "in",        "protocol": "tcp"      }    ]  }'
{  "action": {    "id": 0,    "command": "create_server",    "status": "running",    "progress": 0,    "started": "2019-08-24T14:15:22Z",    "finished": "2019-08-24T14:15:22Z",    "resources": [      {        "id": 0,        "type": "server"      }    ],    "error": {      "code": "string",      "message": "string"    }  }}
POST
/firewalls/{id}/actions/apply_to_resources

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Request Body

application/json
  1. body
apply_to*array<>

Response Body

Action started

application/json
  1. response
action*
curl -X POST "https://example.com/firewalls/0/actions/apply_to_resources" \  -H "Content-Type: application/json" \  -d '{    "apply_to": [      {        "type": "server"      }    ]  }'
{  "action": {    "id": 0,    "command": "create_server",    "status": "running",    "progress": 0,    "started": "2019-08-24T14:15:22Z",    "finished": "2019-08-24T14:15:22Z",    "resources": [      {        "id": 0,        "type": "server"      }    ],    "error": {      "code": "string",      "message": "string"    }  }}
POST
/firewalls/{id}/actions/remove_from_resources

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Request Body

application/json
  1. body
remove_from*array<>

Response Body

Action started

application/json
  1. response
action*
curl -X POST "https://example.com/firewalls/0/actions/remove_from_resources" \  -H "Content-Type: application/json" \  -d '{    "remove_from": [      {        "type": "server"      }    ]  }'
{  "action": {    "id": 0,    "command": "create_server",    "status": "running",    "progress": 0,    "started": "2019-08-24T14:15:22Z",    "finished": "2019-08-24T14:15:22Z",    "resources": [      {        "id": 0,        "type": "server"      }    ],    "error": {      "code": "string",      "message": "string"    }  }}