Lists subnets to which the
specified tenant has access.Default policy settings returns exclusively subnets
owned by the tenant submitting the request, unless the
request is submitted by an user with administrative
rights. You can control which attributes are returned
by using the fields query parameter. You can filter
results by using query string parameters. For
information, see Filtering and Column Selection in the
OpenStack Networking API v2.0
Reference.{
"subnets": [
{
"name": "private-subnet",
"enable_dhcp": true,
"network_id": "db193ab3-96e3-4cb3-8fc5-05f4296d0324",
"tenant_id": "26a7980765d0414dbc1fc1f88cdb7e6e",
"dns_nameservers": [],
"allocation_pools": [
{
"start": "10.0.0.2",
"end": "10.0.0.254"
}
],
"host_routes": [],
"ip_version": 4,
"gateway_ip": "10.0.0.1",
"cidr": "10.0.0.0/24",
"id": "08eae331-0402-425a-923c-34f7cfe39c1b"
},
{
"name": "my_subnet",
"enable_dhcp": true,
"network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
"tenant_id": "4fd44f30292945e481c7b8a0c8908869",
"dns_nameservers": [],
"allocation_pools": [
{
"start": "192.0.0.2",
"end": "192.255.255.254"
}
],
"host_routes": [],
"ip_version": 4,
"gateway_ip": "192.0.0.1",
"cidr": "192.0.0.0/8",
"id": "54d6f61d-db07-451c-9ab3-b9609b6b6f0b"
}
]
}<?xml version='1.0' encoding='UTF-8'?>
<subnets xmlns="http://openstack.org/quantum/api/v2.0"
xmlns:quantum="http://openstack.org/quantum/api/v2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<subnet>
<name>private-subnet</name>
<enable_dhcp quantum:type="bool">True</enable_dhcp>
<network_id>db193ab3-96e3-4cb3-8fc5-05f4296d0324</network_id>
<tenant_id>26a7980765d0414dbc1fc1f88cdb7e6e</tenant_id>
<dns_nameservers quantum:type="list"/>
<allocation_pools>
<allocation_pool>
<start>10.0.0.2</start>
<end>10.0.0.254</end>
</allocation_pool>
</allocation_pools>
<host_routes quantum:type="list"/>
<ip_version quantum:type="long">4</ip_version>
<gateway_ip>10.0.0.1</gateway_ip>
<cidr>10.0.0.0/24</cidr>
<id>08eae331-0402-425a-923c-34f7cfe39c1b</id>
</subnet>
<subnet>
<name>my_subnet</name>
<enable_dhcp quantum:type="bool">True</enable_dhcp>
<network_id>d32019d3-bc6e-4319-9c1d-6722fc136a22</network_id>
<tenant_id>4fd44f30292945e481c7b8a0c8908869</tenant_id>
<dns_nameservers quantum:type="list"/>
<allocation_pools>
<allocation_pool>
<start>192.0.0.2</start>
<end>192.255.255.254</end>
</allocation_pool>
</allocation_pools>
<host_routes quantum:type="list"/>
<ip_version quantum:type="long">4</ip_version>
<gateway_ip>192.0.0.1</gateway_ip>
<cidr>192.0.0.0/8</cidr>
<id>54d6f61d-db07-451c-9ab3-b9609b6b6f0b</id>
</subnet>
</subnets>
Creates a subnet on a specified
network.By default, OpenStack Networking creates IP v4
subnets. To create an IP v6 subnet, you must specify
the value 6 for the ip_version attribute
in the request body. OpenStack Networking does not try
to derive the correct IP version from the provided
CIDR. If the parameter for the gateway address,
gateway_ip, is not specified,
OpenStack Networking allocates an address from the
cidr for the gateway for the subnet.To specify a subnet without a gateway, specify the
value null for the gateway_ip attribute
in the request body. If allocation pools attribute,
allocation_pools, is not specified,
OpenStack Networking automatically allocates pools for
covering all IP addresses in the CIDR, excluding the
address reserved for the subnet gateway. Otherwise,
you can explicitly specify allocation pools as shown
in the following example.When allocation_pools and
gateway_ip are both specified, it is
up to the user to ensure that the gateway IP does not
overlap with the specified allocation pools; otherwise
a 409 Conflict error occurs.The subnet name.The ID of the attached network.The ID of the tenant who owns the network. Only administrative users can specify a tenant ID other than their own.The start and end addresses for the allocation pools.The gateway IP address.The IP version, which is 4 or 6.The CIDR.The ID of the subnet.Set to true if DHCP is enabled and false if DHCP is disabled.{
"subnet": {
"network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
"ip_version": 4,
"cidr": "192.168.199.0/24"
}
}<?xml version="1.0" encoding="UTF-8"?>
<subnet>
<name>test_subnet_1</name>
<network_id>d32019d3-bc6e-4319-9c1d-6722fc136a22</network_id>
<cidr>192.0.0.0/8</cidr>
<ip_version>4</ip_version>
</subnet>
The subnet name.The ID of the attached network.The ID of the tenant who owns the network. Only administrative users can specify a tenant ID other than their own.The start and end addresses for the allocation pools.The gateway IP address.The IP version, which is 4 or 6.The CIDR.The ID of the subnet.Set to true if DHCP is enabled and false if DHCP is disabled.{
"subnet": {
"name": "",
"enable_dhcp": true,
"network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
"tenant_id": "4fd44f30292945e481c7b8a0c8908869",
"dns_nameservers": [],
"allocation_pools": [
{
"start": "192.168.199.2",
"end": "192.168.199.254"
}
],
"host_routes": [],
"ip_version": 4,
"gateway_ip": "192.168.199.1",
"cidr": "192.168.199.0/24",
"id": "3b80198d-4f7b-4f77-9ef5-774d54e17126"
}
}<?xml version='1.0' encoding='UTF-8'?>
<subnet xmlns="http://openstack.org/quantum/api/v2.0"
xmlns:quantum="http://openstack.org/quantum/api/v2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<name>test_subnet_1</name>
<enable_dhcp quantum:type="bool">True</enable_dhcp>
<network_id>d32019d3-bc6e-4319-9c1d-6722fc136a22</network_id>
<tenant_id>4fd44f30292945e481c7b8a0c8908869</tenant_id>
<dns_nameservers quantum:type="list"/>
<allocation_pools>
<allocation_pool>
<start>192.0.0.2</start>
<end>192.255.255.254</end>
</allocation_pool>
</allocation_pools>
<host_routes quantum:type="list"/>
<ip_version quantum:type="int">4</ip_version>
<gateway_ip>192.0.0.1</gateway_ip>
<cidr>192.0.0.0/8</cidr>
<id>54d6f61d-db07-451c-9ab3-b9609b6b6f0b</id>
</subnet>
Creates multiple subnets in a
single request. Specify a list of subnets in the
request body.The bulk create operation is always atomic. Either
all or no subnets in the request body are
created.The subnet name.The ID of the attached network.The ID of the tenant who owns the network. Only administrative users can specify a tenant ID other than their own.The start and end addresses for the allocation pools.The gateway IP address.The IP version, which is 4 or 6.The CIDR.The ID of the subnet.Set to true if DHCP is enabled and false if DHCP is disabled.{
"subnets": [
{
"cidr": "192.168.199.0/24",
"ip_version": 4,
"network_id": "e6031bc2-901a-4c66-82da-f4c32ed89406"
},
{
"cidr": "10.56.4.0/22",
"ip_version": 4,
"network_id": "64239a54-dcc4-4b39-920b-b37c2144effa"
}
]
}<?xml version="1.0" encoding="UTF-8"?>
<subnets>
<subnet>
<name>test_subnet_1</name>
<network_id>a3775a7d-9f8b-4148-be81-c84bbd0837ce</network_id>
<cidr>10.0.0.0/8</cidr>
<ip_version>4</ip_version>
</subnet>
<subnet>
<name>test_subnet_2</name>
<network_id>a3775a7d-9f8b-4148-be81-c84bbd0837ce</network_id>
<cidr>192.168.0.0/16</cidr>
<ip_version>4</ip_version>
</subnet>
</subnets>
The subnet name.The ID of the attached network.The ID of the tenant who owns the network. Only administrative users can specify a tenant ID other than their own.The start and end addresses for the allocation pools.The gateway IP address.The IP version, which is 4 or 6.The CIDR.The ID of the subnet.Set to true if DHCP is enabled and false if DHCP is disabled.{
"subnets": [
{
"allocation_pools": [
{
"end": "192.168.199.254",
"start": "192.168.199.2"
}
],
"cidr": "192.168.199.0/24",
"dns_nameservers": [],
"enable_dhcp": true,
"gateway_ip": "192.168.199.1",
"host_routes": [],
"id": "0468a7a7-290d-4127-aedd-6c9449775a24",
"ip_version": 4,
"name": "",
"network_id": "e6031bc2-901a-4c66-82da-f4c32ed89406",
"tenant_id": "d19231fc08ec4bc4829b668040d34512"
},
{
"allocation_pools": [
{
"end": "10.56.7.254",
"start": "10.56.4.2"
}
],
"cidr": "10.56.4.0/22",
"dns_nameservers": [],
"enable_dhcp": true,
"gateway_ip": "10.56.4.1",
"host_routes": [],
"id": "b0e7435c-1512-45fb-aa9e-9a7c5932fb30",
"ip_version": 4,
"name": "",
"network_id": "64239a54-dcc4-4b39-920b-b37c2144effa",
"tenant_id": "d19231fc08ec4bc4829b668040d34512"
}
]
}<?xml version='1.0' encoding='UTF-8'?>
<subnets xmlns="http://openstack.org/quantum/api/v2.0"
xmlns:quantum="http://openstack.org/quantum/api/v2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<subnet>
<name>test_subnet_1</name>
<enable_dhcp quantum:type="bool">True</enable_dhcp>
<network_id>a3775a7d-9f8b-4148-be81-c84bbd0837ce</network_id>
<tenant_id>60cd4f6dbc2f491982a284e7b83b5be3</tenant_id>
<dns_nameservers quantum:type="list"/>
<allocation_pools>
<allocation_pool>
<start>10.0.0.2</start>
<end>10.255.255.254</end>
</allocation_pool>
</allocation_pools>
<host_routes quantum:type="list"/>
<ip_version quantum:type="int">4</ip_version>
<gateway_ip>10.0.0.1</gateway_ip>
<cidr>10.0.0.0/8</cidr>
<id>bd3fd365-fe19-431a-be63-07017a09316c</id>
</subnet>
<subnet>
<name>test_subnet_2</name>
<enable_dhcp quantum:type="bool">True</enable_dhcp>
<network_id>a3775a7d-9f8b-4148-be81-c84bbd0837ce</network_id>
<tenant_id>60cd4f6dbc2f491982a284e7b83b5be3</tenant_id>
<dns_nameservers quantum:type="list"/>
<allocation_pools>
<allocation_pool>
<start>192.168.0.2</start>
<end>192.168.255.254</end>
</allocation_pool>
</allocation_pools>
<host_routes quantum:type="list"/>
<ip_version quantum:type="int">4</ip_version>
<gateway_ip>192.168.0.1</gateway_ip>
<cidr>192.168.0.0/16</cidr>
<id>86e7c838-fb75-402b-9dbf-d68166e3f5fe</id>
</subnet>
</subnets>
The UUID for the subnet of
interest to you.Shows information for a specified
subnet.You can control which attributes are returned by
using the fields query parameter. For information, see
Filtering and Column Selection in the
OpenStack Networking API v2.0
Reference.The subnet name.The ID of the attached network.The ID of the tenant who owns the network. Only administrative users can specify a tenant ID other than their own.The start and end addresses for the allocation pools.The gateway IP address.The IP version, which is 4 or 6.The CIDR.The ID of the subnet.Set to true if DHCP is enabled and false if DHCP is disabled.{
"subnet": {
"name": "my_subnet",
"enable_dhcp": true,
"network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
"tenant_id": "4fd44f30292945e481c7b8a0c8908869",
"dns_nameservers": [],
"allocation_pools": [
{
"start": "192.0.0.2",
"end": "192.255.255.254"
}
],
"host_routes": [],
"ip_version": 4,
"gateway_ip": "192.0.0.1",
"cidr": "192.0.0.0/8",
"id": "54d6f61d-db07-451c-9ab3-b9609b6b6f0b"
}
}<?xml version='1.0' encoding='UTF-8'?>
<subnet xmlns="http://openstack.org/quantum/api/v2.0"
xmlns:quantum="http://openstack.org/quantum/api/v2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<name>test_subnet_1</name>
<enable_dhcp quantum:type="bool">True</enable_dhcp>
<network_id>d32019d3-bc6e-4319-9c1d-6722fc136a22</network_id>
<tenant_id>4fd44f30292945e481c7b8a0c8908869</tenant_id>
<dns_nameservers quantum:type="list"/>
<allocation_pools>
<allocation_pool>
<start>192.0.0.2</start>
<end>192.255.255.254</end>
</allocation_pool>
</allocation_pools>
<host_routes quantum:type="list"/>
<ip_version quantum:type="long">4</ip_version>
<gateway_ip>192.0.0.1</gateway_ip>
<cidr>192.0.0.0/8</cidr>
<id>54d6f61d-db07-451c-9ab3-b9609b6b6f0b</id>
</subnet>
Updates a specified subnet.Some attributes, such as IP version (ip_version),
and CIDR (cidr) cannot be updated. Attempting to
update these attributes results in a 400 Bad
Request error.The subnet name.The ID of the attached network.The ID of the tenant who owns the network. Only administrative users can specify a tenant ID other than their own.The start and end addresses for the allocation pools.The gateway IP address.The ID of the subnet.Set to true if DHCP is enabled and false if DHCP is disabled.{
"subnet": {
"name": "my_subnet"
}
}<?xml version="1.0" encoding="UTF-8"?>
<subnet>
<name>my_subnet</name>
</subnet>
The subnet name.The ID of the attached network.The ID of the tenant who owns the network. Only administrative users can specify a tenant ID other than their own.The start and end addresses for the allocation pools.The gateway IP address.The IP version, which is 4 or 6.The CIDR.The ID of the subnet.Set to true if DHCP is enabled and false if DHCP is disabled.{
"subnet": {
"name": "private-subnet",
"enable_dhcp": true,
"network_id": "db193ab3-96e3-4cb3-8fc5-05f4296d0324",
"tenant_id": "26a7980765d0414dbc1fc1f88cdb7e6e",
"dns_nameservers": [],
"allocation_pools": [
{
"start": "10.0.0.2",
"end": "10.0.0.254"
}
],
"host_routes": [],
"ip_version": 4,
"gateway_ip": "10.0.0.1",
"cidr": "10.0.0.0/24",
"id": "08eae331-0402-425a-923c-34f7cfe39c1b"
}
}<?xml version='1.0' encoding='UTF-8'?>
<subnet xmlns="http://openstack.org/quantum/api/v2.0"
xmlns:quantum="http://openstack.org/quantum/api/v2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<name>my_subnet</name>
<enable_dhcp quantum:type="bool">True</enable_dhcp>
<network_id>d32019d3-bc6e-4319-9c1d-6722fc136a22</network_id>
<tenant_id>4fd44f30292945e481c7b8a0c8908869</tenant_id>
<dns_nameservers quantum:type="list"/>
<allocation_pools>
<allocation_pool>
<start>192.0.0.2</start>
<end>192.255.255.254</end>
</allocation_pool>
</allocation_pools>
<host_routes quantum:type="list"/>
<ip_version quantum:type="long">4</ip_version>
<gateway_ip>192.0.0.1</gateway_ip>
<cidr>192.0.0.0/8</cidr>
<id>54d6f61d-db07-451c-9ab3-b9609b6b6f0b</id>
</subnet>
Deletes a specified subnet.The operation fails if subnet IP addresses are still
allocated.