Logo

Command Palette

Search for a command to run...

GET/stacks/:stack_id/firewalls/:firewall_rule_id

Required Parameters

stack_idstring
The stack UID
firewall_rule_idinteger
The firewall rule ID

Get information about a specific firewall rule.

Related Models:Firewall Rule

Request

GET
/stacks/:stack_id/firewalls/:firewall_rule_id
curl -X GET \
  "https://app.cloud66.com/api/3/stacks/:stack_id/firewalls/:firewall_rule_id" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Response

{
  "response": {
    "id": 5027,
    "from_ip": "0.0.0.0/0",
    "from_group_id": null,
    "from_server_id": null,
    "to_ip": null,
    "to_group_id": 128,
    "to_server_id": null,
    "protocol": "tcp",
    "port": 80,
    "rule_type": "dynamic",
    "comments": null,
    "created_at": "2014-08-29T17:58:23Z",
    "updated_at": "2014-08-29T17:58:23Z"
  }
}
GET/stacks/:stack_id/firewalls

Required Parameters

stack_idstring
The stack UID

Get list of all the firewall rules of a stack.

Request

GET
/stacks/:stack_id/firewalls
curl -X GET \
  "https://app.cloud66.com/api/3/stacks/:stack_id/firewalls" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Response

{
  "response": [
    {
      "id": 5027,
      "from_ip": "0.0.0.0/0",
      "from_group_id": null,
      "from_server_id": null,
      "to_ip": null,
      "to_group_id": 128,
      "to_server_id": null,
      "protocol": "tcp",
      "port": 80,
      "rule_type": "dynamic",
      "comments": null,
      "created_at": "2014-08-29T17:58:23Z",
      "updated_at": "2014-08-29T17:58:23Z"
    }
  ],
  "count": 2,
  "pagination": {
    "previous": null,
    "next": null,
    "current": 1,
    "per_page": 30,
    "count": 2,
    "pages": 1
  }
}
POST/stacks/:stack_id/firewalls

Required Parameters

stack_idstring
The stack UID
protocolstring
Protocol (tcp/udp/icmp)
portinteger
Port number

Optional Parameters

from_ipstring
Source IP address or CIDR

Add a new firewall rule to a stack.

Related Models:Firewall Rule

Request

POST
/stacks/:stack_id/firewalls
curl -X POST \
  "https://app.cloud66.com/api/3/stacks/:stack_id/firewalls?from_ip=0.0.0.0/0" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "stack_id": "5999b763474b0eafa5fafb64bff0ba80",
  "protocol": "tcp",
  "port": 8080
}'

Response

{
  "response": {
    "id": 5029,
    "from_ip": "0.0.0.0/0",
    "from_group_id": null,
    "from_server_id": null,
    "to_ip": null,
    "to_group_id": 128,
    "to_server_id": null,
    "protocol": "tcp",
    "port": 8080,
    "rule_type": "dynamic",
    "comments": "Custom rule",
    "created_at": "2015-01-01T12:00:00Z",
    "updated_at": "2015-01-01T12:00:00Z"
  }
}