Skip to main content
Version: 10.0

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​

NameRequiredTypeDescriptionDefault Value
:IDYesURL ParameterThe unique numeric ID of the group. 
qNoQuery ParameterFilter 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​

NameRequiredTypeDescriptionDefault Value
:IDYesURL ParameterThe unique numeric ID of the group. 
dataYesJSON ArrayThis should be an array of the subnet elements you want to create. 
subnetYesJSON StringThe 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. 
descriptionYesJSON StringDescription 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"
}
]
}