Firewall rules¶
Entity¶
Firewall rules¶
Firewall_rule resource:
Field |
Explanation |
---|---|
id |
rule identifier |
network_interface_id |
network interface asociated |
command |
rule command |
protocol |
rule protocol |
address |
rule matching ip address/mask |
port |
rule matching ports |
status |
rule’s status |
order |
order of the rule in the interface |
Firewall_rule_list resource:
[rule resource 1, rule resource 2, …]
Operations¶
List virtual machine firewall rules¶
List interface firewall rules¶
Set default policy¶
Apply firewall rules¶
Delete rule¶
- Method
DELETE
- Url
/account/<account_id>/firewall_rule/<rule_id>
- Success Code
204
- Returned Data
No data returned
- Has Token
No
Remove an existing rule.
Curl example¶
curl -i -X DELETE https://api.gigas.com/account/ACCOUNT_ID/firewall_rule/RULE_ID -H "Authorization: $TOKEN" -H "Content-Type: application/json"
Edit rule¶
- Method
PUT
- Url
/account/<account_id>/firewall_rule/<rule_id>
- Success Code
200
- Returned Data
- Has Token
No
Change filtering rule.
Optional parameters:
network_interface_id: interface at which the rule will be applied.
command: ACCEPT or DROP packet matching the rule.
protocol: TCP or UDP.
address: ip address o ip address/mask o range. Empty or 0.0.0.0 for full access.
port: Empty for any port, can be separated by commas for a list or by colon for a range.
description: description of the rule.
Curl example¶
curl -i -X PUT https://api.gigas.com/account/ACCOUNT_ID/firewall_rule/RULE_ID -d '{ "network_interface_id": "NNNN", "command"="ACCEPT|DROP", "protocol": "TCP|UDP", "address": "x.x.x.x", "port": "NNNN" -H "Authorization: $TOKEN" -H "Content-Type: application/json"
Get rule¶
- Method
GET
- Url
/account/<account_id>/firewall_rule/<rule_id>
- Success Code
200
- Returned Data
- Has Token
No
Get an specific rule.
Filters:
command (accept/drop)
port
address
List rules¶
- Method
GET
- Url
/account/<account_id>/firewall_rules
- Success Code
200
- Returned Data
- Has Token
No
Get all rules.
Sort rules¶
- Method
POST
- Url
/account/<account_id>/firewall_rule/<rule_id>/move
- Success Code
200
- Returned Data
- Has Token
No
prioritize firewall rules.
Parameters:
direction (up/down)
Order rules¶
- Method
POST
- Url
/account/<account_id>/firewall_rule/<rule_id>/order
- Success Code
200
- Returned Data
- Has Token
No
Provide a new position for a firewall rule
Parameters:
order: the new position for the firewall rule
Example:
{
"order": 3
}