Network firewall rule
Create and manage cluster firewall rules.
Part of the API reference collection
This page is part of the Crunchy Bridge API reference, and primarily meant to act as an exhaustive guide for technical integrations which are already in progress. To understand the basics of using the API, see API concepts and getting started.
The FirewallRule
API resource
Response of a firewall rule request.
Content type: application/json
Name | Nullable | Type | Description |
---|---|---|---|
id | string in EID format | Unique ID of the firewall rule. | |
description | ✔ | string | A human-readable description for the firewall rule. |
network_id | string in EID format | The ID of the associated network. | |
rule | string | Firewall rule in CIDR notation. | |
team_id | string in EID format | The ID of the team that owns the associated network. |
Example
{
"description": null,
"id": "rwhpndhwrfdetco3wypdyuw4vm",
"network_id": "p56biajnfvgjhftvqs7lqymspe",
"rule": "0.0.0.0/0",
"team_id": "eaevtjiudzeq7bsqbbpiscund4"
}
List firewall rules
List existing firewall rules for a network.
This endpoint's pagination may be ordered through the order_field
parameter
by id
or cidr
. Defaults to being ordered by id
.
GET /networks/{network_id}/firewall-rules
Request
Path parameters
network_id
: Unique ID of the network.
Query parameters
Name | Required | Type | Description |
---|---|---|---|
cursor | string | Return only items starting after this cursor ID. When paginating, pass the value of Cursor values depend on the field in | |
limit | integer | The maximum number of items to return on the page. Defaults to | |
order | string | The order of pagination. Enum | |
order_field | string | The name of the field on which to paginate like |
cURL example
curl -X GET https://api.crunchybridge.com/networks/{network_id}/firewall-rules
-H "Authorization: Bearer $CRUNCHY_API_KEY"
Response
Status: 200
Response of a list firewall rules request.
Content type: application/json
Name | Nullable | Type | Description |
---|---|---|---|
firewall_rules | array of array | Firewall rules configured for a cluster. |
Example
{
"firewall_rules": [
{
"description": null,
"id": "rwhpndhwrfdetco3wypdyuw4vm",
"network_id": "p56biajnfvgjhftvqs7lqymspe",
"rule": "0.0.0.0/0",
"team_id": "eaevtjiudzeq7bsqbbpiscund4"
}
]
}
Create firewall rule
Create a new firewall rule for a network.
POST /networks/{network_id}/firewall-rules
Request
Path parameters
network_id
: Unique ID of the network.
Request body schema
Content type: application/json
Name | Required | Type | Description |
---|---|---|---|
rule | ✔ | string | Firewall rule in CIDR notation. |
description | string | A human-readable description for the firewall rule. |
cURL example
curl -X POST https://api.crunchybridge.com/networks/{network_id}/firewall-rules
-H "Authorization: Bearer $CRUNCHY_API_KEY"
Response
Status: 201
Responds with the standard FirewallRule
API resource.
Get firewall rule
Get an existing firewall rule for a network.
GET /networks/{network_id}/firewall-rules/{rule_id}
Request
Path parameters
network_id
: Unique ID of the network.rule_id
: Unique ID of the network firewall rule.
cURL example
curl -X GET https://api.crunchybridge.com/networks/{network_id}/firewall-rules/{rule_id}
-H "Authorization: Bearer $CRUNCHY_API_KEY"
Response
Status: 200
Responds with the standard FirewallRule
API resource.
Update firewall rule
Update an existing firewall rule for a network.
PATCH /networks/{network_id}/firewall-rules/{rule_id}
Request
Path parameters
network_id
: Unique ID of the network.rule_id
: Unique ID of the network firewall rule.
Request body schema
Content type: application/json
Name | Required | Type | Description |
---|---|---|---|
description | string | A human-readable description for the firewall rule. | |
rule | string | Firewall rule in CIDR notation. |
cURL example
curl -X PATCH https://api.crunchybridge.com/networks/{network_id}/firewall-rules/{rule_id}
-H "Authorization: Bearer $CRUNCHY_API_KEY"
Response
Status: 200
Responds with the standard FirewallRule
API resource.
Destroy firewall rule
Delete an existing firewall rule for a network.
DELETE /networks/{network_id}/firewall-rules/{rule_id}
Request
Path parameters
network_id
: Unique ID of the network.rule_id
: Unique ID of the cluster firewall rule.
cURL example
curl -X DELETE https://api.crunchybridge.com/networks/{network_id}/firewall-rules/{rule_id}
-H "Authorization: Bearer $CRUNCHY_API_KEY"
Response
Status: 200
Responds with the standard FirewallRule
API resource.