Cluster 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 ClusterFirewallRule API resource

Response of a singleton cluster firewall rule request.

Content type: application/json

Name Nullable Type Description
id string in EID format

Unique ID of the firewall rule.

rule string

Firewall rule in CIDR notation.

team_id string in EID format

The ID of the team that owns the associated network.

Example

{
    "id": "rwhpndhwrfdetco3wypdyuw4vm",
    "rule": "0.0.0.0/0",
    "team_id": "eaevtjiudzeq7bsqbbpiscund4"
}

List firewall rules

List existing firewall rules for a cluster.

GET /clusters/{cluster_id}/firewall

Request

Path parameters

  • cluster_id: Unique ID of the cluster.

cURL example

curl -X GET https://api.crunchybridge.com/clusters/{cluster_id}/firewall
    -H "Authorization: Bearer $CRUNCHY_ACCESS_TOKEN"

Response

Status: 200

Response of a list cluster firewall rules request.

Content type: application/json

Name Nullable Type Description
firewall_rules array of object of type ClusterFirewallRule

Firewall rules configured for a cluster.

Example

{
    "firewall_rules": [
        {
            "id": "rwhpndhwrfdetco3wypdyuw4vm",
            "rule": "0.0.0.0/0",
            "team_id": "eaevtjiudzeq7bsqbbpiscund4"
        }
    ]
}

Create firewall rule

Create a new firewall rule for a cluster.

POST /clusters/{cluster_id}/firewall

Request

Path parameters

  • cluster_id: Unique ID of the cluster.

Request body schema

Content type: application/json

Name Required Type Description
rule string

Firewall rule in CIDR notation.

Example request body

{
    "rule": "0.0.0.0/0"
}

cURL example

curl -X POST https://api.crunchybridge.com/clusters/{cluster_id}/firewall
    -H "Authorization: Bearer $CRUNCHY_ACCESS_TOKEN"
    -H "Content-Type: application/json"
    -d '{"rule":"0.0.0.0/0"}'

Response

Status: 201

Responds with the standard ClusterFirewallRule API resource.

Get firewall rule

Get an existing firewall rule for a cluster.

GET /clusters/{cluster_id}/firewall/{rule_id}

Request

Path parameters

  • cluster_id: Unique ID of the cluster.
  • rule_id: Unique ID of the cluster firewall rule.

cURL example

curl -X GET https://api.crunchybridge.com/clusters/{cluster_id}/firewall/{rule_id}
    -H "Authorization: Bearer $CRUNCHY_ACCESS_TOKEN"

Response

Status: 200

Responds with the standard ClusterFirewallRule API resource.

Update firewall rule

Update an existing firewall rule for a cluster.

PUT /clusters/{cluster_id}/firewall/{rule_id}

Request

Path parameters

  • cluster_id: Unique ID of the cluster.
  • rule_id: Unique ID of the cluster firewall rule.

Request body schema

Content type: application/json

Name Required Type Description
rule string

Firewall rule in CIDR notation.

Example request body

{
    "rule": "0.0.0.0/0"
}

cURL example

curl -X PUT https://api.crunchybridge.com/clusters/{cluster_id}/firewall/{rule_id}
    -H "Authorization: Bearer $CRUNCHY_ACCESS_TOKEN"
    -H "Content-Type: application/json"
    -d '{"rule":"0.0.0.0/0"}'

Response

Status: 200

Responds with the standard ClusterFirewallRule API resource.

Destroy firewall rule

Delete an existing firewall rule for a cluster.

DELETE /clusters/{cluster_id}/firewall/{rule_id}

Request

Path parameters

  • cluster_id: Unique ID of the cluster.
  • rule_id: Unique ID of the cluster firewall rule.

cURL example

curl -X DELETE https://api.crunchybridge.com/clusters/{cluster_id}/firewall/{rule_id}
    -H "Authorization: Bearer $CRUNCHY_ACCESS_TOKEN"

Response

Status: 200

Responds with the standard ClusterFirewallRule API resource.