Cloud Management API 1.5
Subnets
A Subnet is a logical grouping of network devices. An Instance can have many Subnets.
Actions
index
Lists subnets of a given cloud.
- URLs
- GET /api/clouds/:cloud_id/instances/:instance_id/subnets
- GET /api/clouds/:cloud_id/subnets
- HTTP response code
- 200 OK
- Content-type
- application/vnd.rightscale.subnet;type=collection
Required roles
- observer
Parameters
name | required | type | values | regexp | blank? | description |
---|---|---|---|---|---|---|
filter | no | Array | * | * | no | See below for valid filter parameters. |
Filters
name | partial_match? | description |
---|---|---|
datacenter_href | no | The href of the datacenter to filter on. |
instance_href | no | Returns Subnets that are associated with the specified Instance. |
name | yes | Name of the Subnet to filter on. |
network_href | no | The href of the network to filter on. |
resource_uid | no | Resource Unique IDentifier for the Subnet to filter on. |
visibility | no | Visibility of the subnet to filter by (private, shared, etc). |
Example Responses
Click on a format below to see an example response:
JSON XML[{
"visibility": "public",
"resource_uid": "RESOURCE_338641695",
"name": "NAME_1844799193",
"description": "subnet564692249",
"state": "pending",
"cidr_block": null,
"is_default": false,
"links": [
{"rel":"self","href":"/api/clouds/888/subnets/RESOURCE_338641695;2426559548"},
{"rel":"datacenter","href":"/api/clouds/888/datacenters/RESOURCE_556415035;RAND"},
{"rel":"route_table","href":"/api/route_tables/RESOURCE_3923508869;1793948747"},
{"rel":"effective_route_table","href":"/api/route_tables/RESOURCE_3923508869;1793948747"}
]
},{
"visibility": "public",
"resource_uid": "RESOURCE_2962658872",
"name": "NAME_2675242806",
"description": "subnet3850447803",
"state": "pending",
"cidr_block": null,
"is_default": false,
"links": [
{"rel":"self","href":"/api/clouds/888/subnets/RESOURCE_2962658872;2857642701"},
{"rel":"datacenter","href":"/api/clouds/888/datacenters/RESOURCE_967310530;RAND"},
{"rel":"route_table","href":"/api/route_tables/RESOURCE_3736612933;772099720"},
{"rel":"effective_route_table","href":"/api/route_tables/RESOURCE_3736612933;772099720"}
]
}]
<?xml version="1.0" encoding="UTF-8"?>
<subnets>
<subnet>
<visibility>public</visibility>
<resource_uid>RESOURCE_338641695</resource_uid>
<name>NAME_1844799193</name>
<description>subnet564692249</description>
<state>pending</state>
<cidr_block/>
<is_default>false</is_default>
<links>
<link rel="self" href="/api/clouds/888/subnets/RESOURCE_338641695;2426559548"/>
<link rel="datacenter" href="/api/clouds/888/datacenters/RESOURCE_556415035;RAND"/>
<link rel="route_table" href="/api/route_tables/RESOURCE_3923508869;1793948747"/>
<link rel="effective_route_table" href="/api/route_tables/RESOURCE_3923508869;1793948747"/>
</links>
</subnet>
<subnet>
<visibility>public</visibility>
<resource_uid>RESOURCE_2962658872</resource_uid>
<name>NAME_2675242806</name>
<description>subnet3850447803</description>
<state>pending</state>
<cidr_block/>
<is_default>false</is_default>
<links>
<link rel="self" href="/api/clouds/888/subnets/RESOURCE_2962658872;2857642701"/>
<link rel="datacenter" href="/api/clouds/888/datacenters/RESOURCE_967310530;RAND"/>
<link rel="route_table" href="/api/route_tables/RESOURCE_3736612933;772099720"/>
<link rel="effective_route_table" href="/api/route_tables/RESOURCE_3736612933;772099720"/>
</links>
</subnet>
</subnets>
show
Shows attributes of a single subnet.
- URLs
- GET /api/clouds/:cloud_id/instances/:instance_id/subnets/:id
- GET /api/clouds/:cloud_id/subnets/:id
- HTTP response code
- 200 OK
- Content-type
- application/vnd.rightscale.subnet
Required roles
- observer
Example Responses
Click on a format below to see an example response:
JSON XML{
"visibility": "public",
"resource_uid": "RESOURCE_338641695",
"name": "NAME_1844799193",
"description": "subnet564692249",
"state": "pending",
"cidr_block": null,
"is_default": false,
"links": [
{"rel":"self","href":"/api/clouds/888/subnets/RESOURCE_338641695;2426559548"},
{"rel":"datacenter","href":"/api/clouds/888/datacenters/RESOURCE_556415035;RAND"},
{"rel":"route_table","href":"/api/route_tables/RESOURCE_3923508869;1793948747"},
{"rel":"effective_route_table","href":"/api/route_tables/RESOURCE_3923508869;1793948747"}
]
}
<?xml version="1.0" encoding="UTF-8"?>
<subnet>
<visibility>public</visibility>
<resource_uid>RESOURCE_338641695</resource_uid>
<name>NAME_1844799193</name>
<description>subnet564692249</description>
<state>pending</state>
<cidr_block/>
<is_default>false</is_default>
<links>
<link rel="self" href="/api/clouds/888/subnets/RESOURCE_338641695;2426559548"/>
<link rel="datacenter" href="/api/clouds/888/datacenters/RESOURCE_556415035;RAND"/>
<link rel="route_table" href="/api/route_tables/RESOURCE_3923508869;1793948747"/>
<link rel="effective_route_table" href="/api/route_tables/RESOURCE_3923508869;1793948747"/>
</links>
</subnet>
create
Creates a new subnet.
- URLs
- POST /api/clouds/:cloud_id/instances/:instance_id/subnets
- POST /api/clouds/:cloud_id/subnets
- HTTP response code
- 201 Created
Required roles
- security_manager
Parameters
name | required | type | values | regexp | blank? | description |
---|---|---|---|---|---|---|
subnet | yes | Hash | * | * | no | |
subnet[cidr_block] | yes | String | * | * | no | The range of IP addresses for the Subnet. |
subnet[datacenter_href] | no | String | * | * | no | The associated Datacenter. |
subnet[description] | no | String | * | * | no | The description for the Subnet. |
subnet[name] | no | String | * | * | no | The name for the Subnet. |
subnet[network_href] | yes | String | * | * | no | The associated Network. |
update
Updates name and description for the current subnet.
- URLs
- PUT /api/clouds/:cloud_id/instances/:instance_id/subnets/:id
- PUT /api/clouds/:cloud_id/subnets/:id
- HTTP response code
- 204 No Content
- Content-type
- application/vnd.rightscale.subnet
Required roles
- security_manager
Parameters
name | required | type | values | regexp | blank? | description |
---|---|---|---|---|---|---|
subnet | yes | Hash | * | * | no | |
subnet[cidr_block] | no | String | * | * | no | The range of IP addresses for the Subnet. |
subnet[description] | no | String | * | * | yes | The updated description for the Subnet. |
subnet[name] | no | String | * | * | yes | The updated name for the Subnet. |
subnet[route_table_href] | no | String | * | * | yes | The RouteTable to associate/dissociate with this Subnet. Pass this parameter with an empty string to reset this Subnet to use the default RouteTable. |
Example Responses
Click on a format below to see an example response:
JSON XML{
"visibility": "public",
"resource_uid": "RESOURCE_338641695",
"name": "NAME_1844799193",
"description": "subnet564692249",
"state": "pending",
"cidr_block": null,
"is_default": false,
"links": [
{"rel":"self","href":"/api/clouds/888/subnets/RESOURCE_338641695;2426559548"},
{"rel":"datacenter","href":"/api/clouds/888/datacenters/RESOURCE_556415035;RAND"},
{"rel":"route_table","href":"/api/route_tables/RESOURCE_3923508869;1793948747"},
{"rel":"effective_route_table","href":"/api/route_tables/RESOURCE_3923508869;1793948747"}
]
}
<?xml version="1.0" encoding="UTF-8"?>
<subnet>
<visibility>public</visibility>
<resource_uid>RESOURCE_338641695</resource_uid>
<name>NAME_1844799193</name>
<description>subnet564692249</description>
<state>pending</state>
<cidr_block/>
<is_default>false</is_default>
<links>
<link rel="self" href="/api/clouds/888/subnets/RESOURCE_338641695;2426559548"/>
<link rel="datacenter" href="/api/clouds/888/datacenters/RESOURCE_556415035;RAND"/>
<link rel="route_table" href="/api/route_tables/RESOURCE_3923508869;1793948747"/>
<link rel="effective_route_table" href="/api/route_tables/RESOURCE_3923508869;1793948747"/>
</links>
</subnet>
destroy
Deletes the given subnet(s).
- URLs
- DELETE /api/clouds/:cloud_id/instances/:instance_id/subnets/:id
- DELETE /api/clouds/:cloud_id/subnets/:id
- HTTP response code
- 204 No Content
Required roles
- security_manager