Network operations#
This section describes the API operations for networks. For general information about networks, see Networks concepts.
Retrieve list of networks#
GET /v2.0/networks
This operation retrieves list of networks to which the specified tenant has access.
You can control which attributes are returned by using the fields
query
parameter. For more information, see
Filtering Requests.
This table shows the possible response codes for this operation:
Response Code |
Name |
Description |
---|---|---|
200 |
Success |
Request succeeded. |
401 |
Unauthorized |
The user is unauthorized to make this request. |
Request#
This operation does not accept a request body.
Response#
This table shows the body parameters for the response:
Name |
Type |
Description |
---|---|---|
networks |
Array |
The array of networks. |
networks.status |
String |
The network status. The
default value is
|
networks.subnets |
Dict |
The associated subnets. |
networks.name |
String |
The network name. |
networks.admin_state_up |
Bool |
The administrative state
of the network. The
default value is
|
networks.tenant_id |
Uuid |
The tenant ID. |
networks.id |
Uuid |
The network ID. |
networks.shared |
Bool |
Indicates whether this
network is shared across
all tenants. The default
value is |
Example Retrieve list of networks: JSON response
Status Code: 200 OK
Content-Length: 370
Content-Type: application/json; charset=UTF-8
Date: Thu, 19 Feb 2015 20:41:20 GMT, Thu, 19 Feb 2015 20:41:21 GMT
Server: Jetty(9.2.z-SNAPSHOT)
Via: 1.1 Repose (Repose/6.2.0.2)
{
"networks": [
{
"admin_state_up": true,
"id": "00000000-0000-0000-0000-000000000000",
"name": "public",
"shared": true,
"status": "ACTIVE",
"subnets": [],
"tenant_id": "rackspace"
},
{
"admin_state_up": true,
"id": "11111111-1111-1111-1111-111111111111",
"name": "private",
"shared": true,
"status": "ACTIVE",
"subnets": [],
"tenant_id": "rackspace"
},
{
"admin_state_up": true,
"id": "2993e407-5531-4ca8-9d2a-0d13b5cac904",
"name": "RackNet",
"shared": false,
"status": "ACTIVE",
"subnets": [
"017d8997-70ec-4448-91d9-a8097d6d60f3"
],
"tenant_id": "123456"
}
]
}
Create network#
POST /v2.0/networks
This operation creates a network.
The tenant ID that you specify in the URI is the tenant who creates the network.
Note
Only one IPv4
and one IPv6
subnet can be specified per network.
This table shows the possible response codes for this operation:
Response Code |
Name |
Description |
---|---|---|
201 |
Success |
Request succeeded. |
400 |
Error |
A general error has occured. |
401 |
Unauthorized |
The user is unauthorized to make this request. |
Request#
This table shows the body parameters for the request:
Name |
Type |
Description |
---|---|---|
network |
Object |
The container for the network details. |
network.admin_state_up |
Bool (Optional) |
The administrative state
of the network. The
default value is
|
network.name |
String (Optional) |
The network name. Currently, network names should be 40 characters or fewer. |
network.shared |
Bool (Optional) |
Admin only. Indicates
whether this network is
shared across all
tenants. The default
value is |
network.tenant_id |
Uuid (Optional) |
The ID of the tenant who owns the network. |
Example Create network: JSON request
{
"network":
{
"name": "testnet-3",
"shared": false,
"tenant_id": "123456"
}
}
Response#
This table shows the body parameters for the response:
Name |
Type |
Description |
---|---|---|
networks |
Array |
The array of networks. |
networks.status |
String |
The network status. The
default value is
|
networks.subnets |
Dict |
The associated subnets. |
networks.name |
String |
The network name. |
networks.admin_state_up |
Bool |
The administrative state
of the network. The
default value is
|
networks.tenant_id |
Uuid |
The tenant ID. |
networks.id |
Uuid |
The network ID. |
networks.shared |
Bool |
Indicates whether this
network is shared across
all tenants. The default
value is |
Example Create network: JSON response
{
"network":
{
"admin_state_up": true,
"id": "4d4e772a-98e7-4409-8a3c-4fed4324da26",
"name": "testnet-3",
"shared": false,
"status": "ACTIVE",
"subnets": [],
"tenant_id": "123456"
}
}
Show network#
GET /v2.0/networks/{network_id}
This operation retrieves information for a specified network.
You can control which attributes are returned by using the fields
query
parameter. For more information, see
Filtering Requests.
This table shows the possible response codes for this operation:
Response Code |
Name |
Description |
---|---|---|
200 |
Success |
Request succeeded. |
401 |
Unauthorized |
The user is unauthorized to make this request. |
404 |
Not Found |
Item not found. |
Request#
This table shows the URI parameters for the request:
Name |
Type |
Description |
---|---|---|
{network_id} |
Uuid |
The UUID for the network. |
This operation does not accept a request body.
Response#
This table shows the body parameters for the response:
Name |
Type |
Description |
---|---|---|
parameters.networks |
Array |
The array of networks. |
parameters.networks.status |
String |
The network status. The
default value is
|
parameters.networks.subnets |
Dict |
The associated subnets. |
parameters.networks.name |
String |
The network name. |
parameters.networks.admin_state_up |
Bool |
The administrative state
of the network. The
default value is
|
parameters.networks.tenant_id |
Uuid |
The tenant ID. |
parameters.networks.id |
Uuid |
The network ID. |
parameters.networks.shared |
Bool |
Indicates whether this
network is shared across
all tenants. The default
value is |
Example Show network: JSON response
{
"network":
{
"admin_state_up": true,
"id": "4d4e772a-98e7-4409-8a3c-4fed4324da26",
"name": "sameer-3",
"shared": false,
"status": "ACTIVE",
"subnets": [],
"tenant_id": "546428"
}
}
Update network#
PUT /v2.0/networks/{network_id}
This operation allows you to update certain network attributes.
Warning
Network IDs "00000000-0000-0000-0000-000000000000"
and
"11111111-1111-1111-1111-111111111111"
correspond to the PublicNet and
ServiceNet networks of Rackspace. Changes to these networks are not
supported.
This table shows the possible response codes for this operation:
Response Code |
Name |
Description |
---|---|---|
200 |
Success |
Request succeeded. |
400 |
Error |
A general error has occured. |
401 |
Unauthorized |
The user is unauthorized to make this request. |
403 |
Forbidden |
The request is forbidden. |
404 |
Not Found |
Item not found. |
Request#
This table shows the URI parameters for the request:
Name |
Type |
Description |
---|---|---|
{network_id} |
Uuid |
The UUID for the network. |
This table shows the body parameters for the request:
Name |
Type |
Description |
---|---|---|
network |
Object |
The container for the network details. |
networks.name |
String (Optional) |
The network name. |
Example Update network: JSON request
{
"network":
{
"name": "sample_network_5_updated"
}
}
Response#
This table shows the body parameters for the response:
Name |
Type |
Description |
---|---|---|
networks |
Array |
The array of networks. |
networks.status |
String |
The network status. The
default value is
|
networks.subnets |
Dict |
The associated subnets. |
networks.name |
String |
The network name. |
networks.admin_state_up |
Bool |
The administrative state
of the network. The
default value is
|
networks.tenant_id |
Uuid |
The tenant ID. |
networks.id |
Uuid |
The network ID. |
networks.shared |
Bool |
Indicates whether this
network is shared across
all tenants. The default
value is |
Example Update network: JSON response
{
"network":{
"status":"ACTIVE",
"subnets":[],
"name":"sample_network_5_updated",
"admin_state_up":true,
"tenant_id":"4fd44f30292945e481c7b8a0c8908869",
"shared":false,
"id":"1f370095-98f6-4079-be64-6d3d4a6adcc6",
}
}
Delete network#
DELETE /v2.0/networks/{network_id}
This operation deletes a specified network and its associated resources.
This table shows the possible response codes for this operation:
Response Code |
Name |
Description |
---|---|---|
204 |
Success |
Request succeeded. |
401 |
Unauthorized |
The user is unauthorized to make this request. |
404 |
Not Found |
Item not found. |
409 |
conflict |
There is a resource conflict. |
Request#
This table shows the URI parameters for the request:
Name |
Type |
Description |
---|---|---|
{network_id} |
Uuid |
The UUID for the network. |
This operation does not accept a request body.
Response#
Example Delete network: JSON response
Content-Type: application/json
Accept: application/json
status: 204