Group Subnets Resource
Description
This resource is for manipulating the subnets assigned to a group.
GET /groups/:ID/subnets
List the allowed subnets for this group. If the routing is inherited, the subnet resources returned may be from further up in the group hierarchy. This is a paged query.
GET Parameters
| Name | Required | Type | Description | Default Value |
|---|---|---|---|---|
| :ID | Yes | URL Parameter | The unique numeric ID of the group. | |
| q | No | Query Parameter | Filter the results by subnet or description. |
GET Response Values
Each data element will be a group subnet resource object.
Example GET Request
GET /groups/407/subnets
Example GET Response
{
"rows": 2,
"data": [
{
"subnet_resource": "/group_subnets/1",
"subnet": "0.0.0.0/0",
"description": "IPv4 Default Subnet Prefix",
"group_resource": "/groups/0"
},
{
"subnet_resource": "/group_subnets/2",
"subnet": "::/0",
"description": "IPv6 Default Subnet Prefix",
"group_resource": "/groups/0"
}
],
"start": 0
}
POST /groups/:ID/subnets
Create one or more subnets for the group. The new subnet(s) must be contained within the allowed subnets for the group (that is, contained within the group subnets for its parent group).
warning
Subnet inheritence must be turned off before this configuration can be changed. Toggling that setting will also change the current set of configured subnets.
POST Parameters
| Name | Required | Type | Description | Default Value |
|---|---|---|---|---|
| :ID | Yes | URL Parameter | The unique numeric ID of the group. | |
| data | Yes | JSON Array | This should be an array of the subnet elements you want to create. | |
| subnet | Yes | JSON String | The IPv4 or IPv6 group subnet address for the subnet object. If omitted, the subnet mask will default to /32 or /128 depending on the IP version. The largest allowed mask for new IPv4 subnets is /16. | |
| description | Yes | JSON String | Description of the subnet object you want to create. Can be an empty string, but must be included. |
POST Response Values
Each data element will be a group subnet resource object.
Example POST Request
POST /groups/717/subnets
JSON Body:
{
"data": [
{
"subnet": "192.168.50.0/24",
"description": "Test net 1"
},
{
"subnet": "192.168.51.0/24",
"description": "Test net 2"
}
]
}
Example POST Response
HTTP/1.1 201 Created
{
"data": [
{
"subnet_resource": "/group_subnets/5310",
"subnet": "192.168.50.0/24",
"description": "Test net 1",
"group_resource": "/groups/717"
},
{
"subnet_resource": "/group_subnets/5311",
"subnet": "192.168.51.0/24",
"description": "Test net 2",
"group_resource": "/groups/717"
}
]
}