Skip to main content
Version: 10.1

Zone Subnets Resource

Description​

This resource is for checking and adding subnets to a zone.

GET /zones/:ID/subnets​

Get all subnets currently mapped to a zone. This is a paged query.

GET Parameters​

NameRequiredTypeDescriptionDefault Value
:IDYesURL ParameterThe unique numeric ID of the zone whose subnets you want to see. 
qNoQuery ParameterFilter results by either the subnet or its description. 

GET Response Values​

Each element in the returned data array will be a subnet resource object.

Example GET Request​

 GET /zones/2031/subnets

Example GET Response​

{
"rows": 1,
"data": [
{
"subnet_resource": "/subnets/89910",
"subnet": "207.168.1.0/24",
"description": "Changed main subnet.",
"zone_resource": "/zones/2031",
"group_resource": "/groups/279",
"customer_resource": "/customers/279"
}
],
"start": 0
}

POST /zones/:ID/subnets​

Add new subnets to a zone. When adding subnets, note that the subnet must be allowed for the zone per group routing policy.

POST Parameters​

NameRequiredTypeDescriptionDefault Value
:IDYesURL ParameterThe unique numeric ID of the zone that you want to add subnets to. 
dataYesJSON ArrayThis should contain one or more subnet objects you want to add to the zone. 
subnetYesJSON StringThe IP address and subnet mask you wish to change to. Accepts either IPv4 or IPv6 addresses. If the subnet mask is omitted it will default to /32 for IPv4 and /128 for IPv6. The specific subnet and mask used must be unique among all zones in rWeb (you can't use the same address in two different zones). 
descriptionNoJSON StringAn optional description for the subnet. 

POST Response Values​

Each returned element will be the newly created subnet resource object for each subnet you create.

Example POST Request​

POST /zones/2031/subnets
 
JSON Body:
{
"data" : [
{
"subnet" : "207.168.2.0/24",
"description" : "Other description"
},
{
"subnet" : "207.168.3.0/24"
}
]
} 

Example POST Response​

HTTP/1.1 201 Created
 
{
"data": [
{
"subnet_resource": "/subnets/89911",
"subnet": "207.168.2.0/24",
"description": "Other description",
"zone_resource": "/zones/2031",
"group_resource": "/groups/279",
"customer_resource": "/customers/279"
},
{
"subnet_resource": "/subnets/89912",
"subnet": "207.168.3.0/24",
"description": null,
"zone_resource": "/zones/2031",
"group_resource": "/groups/279",
"customer_resource": "/customers/279"
}
]
}