List Firewall Group Rules
From Hostway API Documentation
Revision as of 08:24, 11 June 2015 by Viktor.penkov (Talk)
GET /accounts/{accountNumber}/os-security-groups/{security-group-id}/rules
Returns a list of firewall group rules
Contents |
Request
GET /accounts/{accountNumber}/os-security-groups/{security-group-id}/rules
Request Parameters
- accountNumber - string
- The user account to which the domain name and the subdomains belong
- security-group-id - string
- The target security group
URI Parameters
- page - integer
- Specifies which page should be displayed. Requires a pageSize parameter to also be provided
- pageSize - integer
- Specifies the number of entries to be displayed on a page. Requires a page parameter to also be provided
Request Headers
- Authorization - HTTP Authorization header [1]
- The Authentication credentials of the client application.
Response
Response Body
{ "list": [ { "priority": "{priority}", "action": "{action}", "from_port": "{from_port}", "protocol": "{protocol}", "to_port": "{to_port}", "cidr": "{cidr}", "id": "{id}" } ], "links": [ { "href": "http://{server_name}/accounts/{accountNumber}/os-security-groups/{security-group-id}/rules/", "rel": "self" } ] }
Parameters
- priority - integer
- Rule priority, starting from 0 lowest priority.
- action - string
- Rule target action
- ACCEPT, REJECT or DROP
- from_port - integer
- Start port number
- protocol - string
- TCP, UDP, AH, ESP, GRE, AH+ESP, ALL(all protocols)
- AH, ESP, GRE, AH+ESP, ALL protocols don't support port - both should be 0
- to_port - integer
- End port number
- cidr - string
- CIDR notation IP address.
- id - string
- The id of the rule.
- links - list
- Hypermedia for this resource
Status Code
- 200 OK
- Success
- 401 Unauthorized
- The supplied credentials are invalid or do not provide permissions for this operation
- 403 Forbidden
- The authenticated user is not allowed to access this resource
- 404 Not Found
- The security group does not have any rules
Examples
Successful retrieving firewall rules
Request
GET /accounts/test-account/os-security-groups/group-123/rules
Response
{ "list": [ { "priority": 0, "action": "ACCEPT", "from_port": 80, "protocol": "TCP", "to_port": 80, "cidr": "127.0.0.1/24", "id": "rule2015May28_A3iOEGDrJVeC" } ], "links": [ { "href": "http://localhost:6545/accounts/test-account/os-security-groups/group-123/rules/", "rel": "self" } ] }