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

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_1304753325",
  "name": "NAME_1542957815",
  "description": "subnet855224782",
  "state": "pending",
  "cidr_block": null,
  "is_default": false,
  "links": [
    {"rel":"self","href":"/api/clouds/888/subnets/RESOURCE_1304753325;4236649418"},
    {"rel":"datacenter","href":"/api/clouds/888/datacenters/RESOURCE_1487744977;RAND"},
    {"rel":"route_table","href":"/api/route_tables/RESOURCE_464270638;3386587850"},
    {"rel":"effective_route_table","href":"/api/route_tables/RESOURCE_464270638;3386587850"}
  ]
},{
  "visibility": "public",
  "resource_uid": "RESOURCE_113206265",
  "name": "NAME_179822137",
  "description": "subnet120615029",
  "state": "pending",
  "cidr_block": null,
  "is_default": false,
  "links": [
    {"rel":"self","href":"/api/clouds/888/subnets/RESOURCE_113206265;2326084964"},
    {"rel":"datacenter","href":"/api/clouds/888/datacenters/RESOURCE_1495262193;RAND"},
    {"rel":"route_table","href":"/api/route_tables/RESOURCE_3651573406;3252656490"},
    {"rel":"effective_route_table","href":"/api/route_tables/RESOURCE_3651573406;3252656490"}
  ]
}]
<?xml version="1.0" encoding="UTF-8"?>
<subnets>
  <subnet>
    <visibility>public</visibility>
    <resource_uid>RESOURCE_1304753325</resource_uid>
    <name>NAME_1542957815</name>
    <description>subnet855224782</description>
    <state>pending</state>
    <cidr_block/>
    <is_default>false</is_default>
    <links>
      <link rel="self" href="/api/clouds/888/subnets/RESOURCE_1304753325;4236649418"/>
      <link rel="datacenter" href="/api/clouds/888/datacenters/RESOURCE_1487744977;RAND"/>
      <link rel="route_table" href="/api/route_tables/RESOURCE_464270638;3386587850"/>
      <link rel="effective_route_table" href="/api/route_tables/RESOURCE_464270638;3386587850"/>
    </links>
  </subnet>
  <subnet>
    <visibility>public</visibility>
    <resource_uid>RESOURCE_113206265</resource_uid>
    <name>NAME_179822137</name>
    <description>subnet120615029</description>
    <state>pending</state>
    <cidr_block/>
    <is_default>false</is_default>
    <links>
      <link rel="self" href="/api/clouds/888/subnets/RESOURCE_113206265;2326084964"/>
      <link rel="datacenter" href="/api/clouds/888/datacenters/RESOURCE_1495262193;RAND"/>
      <link rel="route_table" href="/api/route_tables/RESOURCE_3651573406;3252656490"/>
      <link rel="effective_route_table" href="/api/route_tables/RESOURCE_3651573406;3252656490"/>
    </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

Example Responses

Click on a format below to see an example response:

JSON XML
{
  "visibility": "public",
  "resource_uid": "RESOURCE_1304753325",
  "name": "NAME_1542957815",
  "description": "subnet855224782",
  "state": "pending",
  "cidr_block": null,
  "is_default": false,
  "links": [
    {"rel":"self","href":"/api/clouds/888/subnets/RESOURCE_1304753325;4236649418"},
    {"rel":"datacenter","href":"/api/clouds/888/datacenters/RESOURCE_1487744977;RAND"},
    {"rel":"route_table","href":"/api/route_tables/RESOURCE_464270638;3386587850"},
    {"rel":"effective_route_table","href":"/api/route_tables/RESOURCE_464270638;3386587850"}
  ]
}
<?xml version="1.0" encoding="UTF-8"?>
<subnet>
  <visibility>public</visibility>
  <resource_uid>RESOURCE_1304753325</resource_uid>
  <name>NAME_1542957815</name>
  <description>subnet855224782</description>
  <state>pending</state>
  <cidr_block/>
  <is_default>false</is_default>
  <links>
    <link rel="self" href="/api/clouds/888/subnets/RESOURCE_1304753325;4236649418"/>
    <link rel="datacenter" href="/api/clouds/888/datacenters/RESOURCE_1487744977;RAND"/>
    <link rel="route_table" href="/api/route_tables/RESOURCE_464270638;3386587850"/>
    <link rel="effective_route_table" href="/api/route_tables/RESOURCE_464270638;3386587850"/>
  </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

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

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_1304753325",
  "name": "NAME_1542957815",
  "description": "subnet855224782",
  "state": "pending",
  "cidr_block": null,
  "is_default": false,
  "links": [
    {"rel":"self","href":"/api/clouds/888/subnets/RESOURCE_1304753325;4236649418"},
    {"rel":"datacenter","href":"/api/clouds/888/datacenters/RESOURCE_1487744977;RAND"},
    {"rel":"route_table","href":"/api/route_tables/RESOURCE_464270638;3386587850"},
    {"rel":"effective_route_table","href":"/api/route_tables/RESOURCE_464270638;3386587850"}
  ]
}
<?xml version="1.0" encoding="UTF-8"?>
<subnet>
  <visibility>public</visibility>
  <resource_uid>RESOURCE_1304753325</resource_uid>
  <name>NAME_1542957815</name>
  <description>subnet855224782</description>
  <state>pending</state>
  <cidr_block/>
  <is_default>false</is_default>
  <links>
    <link rel="self" href="/api/clouds/888/subnets/RESOURCE_1304753325;4236649418"/>
    <link rel="datacenter" href="/api/clouds/888/datacenters/RESOURCE_1487744977;RAND"/>
    <link rel="route_table" href="/api/route_tables/RESOURCE_464270638;3386587850"/>
    <link rel="effective_route_table" href="/api/route_tables/RESOURCE_464270638;3386587850"/>
  </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