Subnet Resource
Description
This resource is for manipulating individual subnets that are associated with a zone for routing purposes.
GET /subnets/:ID
Query for a specific subnet entry.
GET Parameters
| Name | Required | Type | Description | Default Value |
|---|---|---|---|---|
| :ID | Yes | URL Parameter | The unique numeric ID of the subnet entry. |
GET Response Values
| Name | Type | Description |
|---|---|---|
| subnet_resource | JSON String | The subnet resource. Should match the resource used for the GET request. |
| subnet | JSON String | The IP address with subnet mask that is processed by the zone. |
| description | JSON String | An optional description of the subnet. |
| zone_resource | JSON String | The zone resource for the zone containing the subnet. |
| group_resource | JSON String | The group resource that owns the zone with this subnet. |
| customer_resource | JSON String | This value is deprecated and should not be used. |
Example GET Request
GET /subnets/89910
Example GET Response
{
"subnet_resource": "/subnets/89910",
"subnet": "207.168.0.0/24",
"description": "",
"zone_resource": "/zones/2031",
"group_resource": "/groups/279",
"customer_resource": "/customers/279"
}
PUT /subnets/:ID
Update the given subnet. If changing the subnet, note that the subnet must be allowed for the zone per group routing policy.
warning
The two main subnets of the Default Zone (0.0.0.0/0 and ::/0) cannot be changed. This is to ensure there is always at least one set of rules to apply to incoming traffic.
PUT Parameters
| Name | Required | Type | Description | Default Value |
|---|---|---|---|---|
| :ID | Yes | URL Parameter | The unique numeric ID of the subnet to update. | |
| subnet | No | JSON String | The 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). | |
| description | No | JSON String | A description for this subnet. |
Example PUT Request
PUT /subnets/89910
JSON Body:
{
"data" : {
"subnet" : "207.168.1.0/24",
"description" : "Changed main subnet."
}
}
Example PUT Response
HTTP/1.1 200 OK
DELETE /subnets/:ID
Remove the subnet from the zone. Traffic for that prefix will be handled by the zone with the next most specific prefix, or by the Default Zone if there is no other matching prefix.
DELETE Parameters
| Name | Required | Type | Description | Default Value |
|---|---|---|---|---|
| :ID | Yes | URL Parameter | The unique numeric ID of the subnet entry to remove. |
Example DELETE Request
DELETE /subnet/89910
Example DELETE Response
HTTP/1.1 200 OK