GET'> PUT'> POST'> DELETE'> '> '> ]>
Network API Operations Use the &APIv2; with the provider extended attributes to get information about, create, and update networks. The provider-prefixed extended attributes for networks are:
provider Extended Attributes for Networks
Attribute Description
provider:network_type The type of physical network that maps to this networks resource. Examples are flat, vlan, vxlan, local, and gre.
provider:physical_network The physical network on which this network object is implemented. The &APIv2; does not provide a way to list available physical networks. For example, the Open vSwitch plug-in configuration file defines a symbolic name that maps to specific bridges on each Compute host.
provider:segmentation_id An isolated segment on the physical network. The network_type attribute defines the segmentation model. For example, if network_type is vlan, this ID is a vlan identifier. If network_type is gre, this ID is a gre key.
List Networks Verb URI Description &GET; /networks Lists networks. The provider extended attributes are visible to only administrative users. Normal Response Code: 200 OK Error Response Codes: 401 Unauthorized This operation lists network attributes including provider extended attributes. The provider extended attributes are visible to only administrative users. List Networks with provider extended attributes: JSON Response List Networks with provider extended attributes: XML Response
Show Network Verb URI Description &GET; /networks/network_id Shows information for a specified network. The provider extended attributes are visible to only administrative users. Normal Response Code: 200 OK Error Response Code: 401 Unauthorized, 404 Not Found This operation shows information for a specified network. The provider extended attributes are visible to only administrative users. Show Network with provider extended attributes: JSON Response Show Network with provider extended attributes: XML Response
Create Network Verb URI Description &POST; /networks Creates a network. Only administrative users can add the provider extended attributes. Normal Response Code: 200 OK Error Response Code: 400 Bad Request, 401 Unauthorized, 403 Forbidden This operation enables administrative users to create a network and define how it is mapped on the underlying network infrastructure. If the user submitting the request is not allowed to set provider networks attributes, a 403 Forbidden response is returned. As stated earlier in this chapter, the semantics of the various provider networks attribute vary with the particular plug-in employed. The following example shows how to create a network mapped to a specific vlan tag (the example refers to an OpenStack Networking deployment which uses the Open vSwitch plug-in). Create Network with provider extended attributes: JSON Request Create Network with provider extended attributes: XML Request
Update Network Verb URI Description &PUT; /networks/network_id Updates a network. Only administrative users can update the provider extended attributes. Normal Response Code: 200 OK Error Response Code: 400 Bad Request, 401 Unauthorized, 404 Not Found, 403 Forbidden When the provider networks extension is enabled, and the user submitting the request is authorized to see provider networks mapping, this operation allows for specifying how an existing network should be mapped on the underlying network infrastructure. If the user submitting the request is not allowed to set provider networks attributes, a 403 Forbidden response is returned. As stated earlier in this chapter, the semantics of the various provider networks attribute vary with the particular plug-in employed. The following example shows how to update a network to map it to a flat network (such as, the no vlan tag); the example refers to an OpenStack Networking deployment that uses the Open vSwitch plug-in. Update Network with provider extended attributes: JSON Request Update Network with provider extended attributes: XML Request