Subnets REST API
Use this REST API to view subnets.
Use Creating a new subnet use case to create a new subnet and Deleting a subnet use case to delete a subnet. For more information, see Creating a new subnet and Deleting a subnet .
Get all subnets
| REST API information | Value | Description |
|---|---|---|
| URI | /admin/resources/subnets | |
| Method | GET | |
| Returns | 200 | Returns a list of all subnets. |
| 404 | The list of subnets was not found. | |
| 500 | Platform System Manager encountered an internal error while processing the request. |
Creates a list of all subnets.
You can use optional parameters to modify the response from the REST API call. For more information, see the Related information section.
Response body
{
"bandwidth": null,
"created_time": "Fri 28 Aug 2015 12:52:57.594 UTC",
"created_time_raw": 1440766377594,
"description": null,
"dns": "172.17.248.101",
"gateway": "172.20.56.1",
"id": "/admin/resources/subnets/b3bc8e6a-8df4-41b8-8fdb-45a4661c70af",
"ip_version": "ipv4",
"label_key": "purexxxx",
"management": "F",
"mask": "255.255.248.0",
"name": "Shared",
"purpose": "data",
"routes": [
],
"secondary_dns": "",
"state": "available",
"subnet": "172.20.56.0",
"updated_time": "Fri 12 Aug 2016 20:06:07.525 UTC",
"updated_time_raw": 1471032367525,
"vdc": "/admin/resources/vdcs/92c626da-a2cd-4f9a-b36b-b0349fa6cc0e",
"vlan_id": "1824"
}
]
- bandwidth
- The speed of this subnet in megabits. This is an optional attribute. This is unused at this time.
- dns
- The primary DNS server for this subnet. This is an optional attribute.
- secondary_dns
- The secondary DNS server for this subnet. This is an optional attribute.
- gateway
- The gateway address for this subnet. This is an optional attribute.
- ip_version
- The IP version used for this subnet. Allowed values are ipv4 and ipv6. This is an optional attribute.
- mask
- The subnet mask for this subnet. This is an optional attribute.
- subnet
- The TCP/IP subnet containing IP addresses and related logical resources like DNS and default gateways. This is an optional attribute.
- vdc
- Reference to the VDC for this subnet. This is an optional attribute.
- state
- By default, when a new subnet is created, its state is set to unavailable. If a new address or address range (or list) is created into the subnet, its state is automatically turned into available. When the last address is removed from the subnet, its state is turned back into unavailable.
- vlan_id
- This value is required and has to match the vlan in one of the predefined networks of network_type customer.
Get a specific subnet
| REST API information | Value | Description |
|---|---|---|
| URI | /admin/resources/subnet/{id} | |
| Method | GET | |
| Returns | 200 | The subnet ID was returned. |
| 404 | The subnet ID was not found. | |
| 500 | Platform System Manager encountered an internal error while processing the request. |