Accounts-account-dedicatedServers-server-ipAddresses-ipaddress-os-security-groups:GET
From Hostway API Documentation
GET /accounts/{accountId}/dedicatedServers/{serverId}/ipAddresses/{ipAddress}/os-security-groups
Get all security groups, which are assigned to a specific IP address of a dedicated server
Contents |
Request
GET /accounts/{accountId}/dedicatedServers/{serverId}/ipAddresses/{ipAddress}/os-security-groups
Request Parameters
- accountId - string
- The user account owning the dedicated server
- serverId - string
- The specified dedicated server Id
- ipAddress - string
- The specified IP address of the dedicated server
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
- unassigned - string
- If set to "true", all unassigned groups against the given IP address will be shown.
Response
Status Code
- 200 OK
- Success
- 401 Unauthorized
- The supplied credentials are invalid or do not provide permissions for this operation.
- 404 Not Found
- The domain name or account does not exist.
Response Body
{
"totalCount": 1,
"list": [
{
"status": "{status}",
"displayName": "{displayName}",
"description": "{description}",
"rules": [
{
"startPort": "{startPort}",
"name": "{name}",
"priority": "{priority}",
"fromCidr": "{fromCidr}",
"action": "{action}",
"protocol": "{protocol}"
"endPort": "{endPort}"
}
],
"serverName": {serverName},
"groupId": {groupId},
}
],
"links": [
{
"href": {resourceURL},
"rel": "self"
}
]
}
Parameters
- status - string - one of "enabled" or "disabled"
- The status of the group
- displayName - string
- The display name of the firewall group.
- description - string
- Text describing the firewall group.
- startPort - integer
- Start port number
- name - string
- The displayname of the rule
- priority - integer
- rule priority, starting from 0 lowest priority
- fromCidr - string
- CIDR notation IP address.
- action - string
- rule target action
- ACCEPT, REJECT or DROP
- 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
- endPort - integer
- End port number
- serverName - string
- The display name of the dedicated server
- groupId - string
- The unique ID of the security group
Examples
Success getting a security group
Request
GET /accounts/test-acount/dedicatedServers/test-acount-213/ipAddresses/1.1.1.1/os-security-groups
Response
{
"totalCount": 1,
"list": [
{
"status": "ENABLED",
"displayName": "dedicated_test_sec_gr",
"description": "A test group",
"rules":
[
{
"startPort": 80,
"name": "rule2015May28_A3iOEGDrJVeC",
"priority": 0,
"fromCidr": "127.0.0.1/24",
"action": "ACCEPT",
"protocol": "TCP",
"endPort": 80
}
],
"serverName": "servername",
"groupId": "group2015May28_1QBhG4AvTnxD"
}
],
"links": [
{
"href": "https://api.hostway.com/accounts/test-acount/dedicatedServers/test-acount-213/ipAddresses/1.1.1.1/os-security-groups/",
"rel": "self"
}
]
}
Paginated request
Request
GET /accounts/test-acount/dedicatedServers/test-acount-213/ipAddresses/1.1.1.1/os-security-groups?page=2&pageSize=2
Response
{
"totalCount": 6,
"list": [
{
"status": "ENABLED",
"displayName": "dedicated_test_sec_gr_1",
"description": "A test group 1",
"rules":
[
{
"startPort": 80,
"name": "rule2015May28_A3iOEGDrJVeC",
"priority": 0,
"fromCidr": "127.0.0.1/24",
"action": "ACCEPT",
"protocol": "TCP",
"endPort": 80
}
],
"serverName": "servername",
"groupId": "group2015May28_1QBhG4AvTnxD"
},
{
"status": "ENABLED",
"displayName": "dedicated_test_sec_gr_1",
"description": "A test group 1",
"rules":
[
{
"startPort": 80,
"name": "rule2015May28_A7i8EGDrJVeC",
"priority": 0,
"fromCidr": "127.0.0.1/24",
"action": "ACCEPT",
"protocol": "TCP",
"endPort": 80
}
],
"serverName": "servername",
"groupId": "group2015May28_A7i8EGDrJVeC"
}
],
"links": [
{
"href": "https://api.hostway.com/accounts/test-acount/dedicatedServers/test-acount-213/ipAddresses/1.1.1.1/os-security-groups?page=1&pageSize=2",
"rel": "first"
},
{
"href": "https://api.hostway.com/accounts/test-acount/dedicatedServers/test-acount-213/ipAddresses/1.1.1.1/os-security-groups?page=1&pageSize=2",
"rel": "previous"
},
{
"href": "https://api.hostway.com/accounts/test-acount/dedicatedServers/test-acount-213/ipAddresses/1.1.1.1/os-security-groups?page=3&pageSize=2",
"rel": "next"
},
{
"href": "https://api.hostway.com/accounts/test-acount/dedicatedServers/test-acount-213/ipAddresses/1.1.1.1/os-security-groups?page=3&pageSize=2",
"rel": "last"
},
{
"href": "https://api.hostway.com/accounts/test-acount/dedicatedServers/test-acount-213/ipAddresses/1.1.1.1/os-security-groups/",
"rel": "self"
}
]
}