GET/stacks/:stack_id/firewalls/:firewall_rule_id
Get Firewall Ruleadmin
Required Parameters
stack_id
stringThe stack UID
firewall_rule_id
integerThe firewall rule ID
Get information about a specific firewall rule.
Related Models:Firewall Rule
Request
GET
/stacks/:stack_id/firewalls/:firewall_rule_idcurl -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
List Firewall Rulesadmin
Required Parameters
stack_id
stringThe stack UID
Get list of all the firewall rules of a stack.
Request
GET
/stacks/:stack_id/firewallscurl -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
Add Firewall Ruleadmin
Required Parameters
stack_id
stringThe stack UID
protocol
stringProtocol (tcp/udp/icmp)
port
integerPort number
Optional Parameters
from_ip
stringSource IP address or CIDR
Add a new firewall rule to a stack.
Related Models:Firewall Rule
Request
POST
/stacks/:stack_id/firewallscurl -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"
}
}