create virtual networks

Creating a resource

To create a resource, a POST has to be issued on the collection URL. So for a resource of type example-resource,

METHOD: POST

URLhttp://<ip>:<port>/example_resources/

BODY: JSON representation of example-resource type

RESPONSE: UUID and href of created resource

curl -X POST -H "X-Auth-Token: $OS_TOKEN" -H "Content-Type: application/json; charset=UTF-8" -d '{"virtual-network": {"parent_type": "project", "fq_name": ["default-domain", "admin", "vn-blue"], "network_ipam_refs": [{"attr": {"ipam_subnets": [{"subnet": {"ip_prefix": "10.1.1.0", "ip_prefix_len": 24}}]}, "to": ["default-domain", "default-project", "default-network-ipam"]}]}}' http://10.84.14.2:8082/virtual-networks

 

{ "virtual-network": { "parent_type": "project", "fq_name": [ "default-domain", "admin", "vn-blue" ], "network_ipam_refs": [ { "attr": { "ipam_subnets": [ { "subnet": { "ip_prefix": "10.1.1.0", "ip_prefix_len": 24 } } ] }, "to": [ "default-domain", "default-project", "default-network-ipam" ] } ] } }