Create vCloud Organization Network

To create an organization network, use the following request:

1
2
POST /org_networks.xml
POST /org_networks.json

You can create the following types of organization networks:

Create Direct Network

XML Request Example

1
curl -i -X POST -u user:userpass --url http://onapp.test/org_networks.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<org_network><label>test</label><vdc_id>13</vdc_id><fence_mode>bridged</fence_mode><parent_network_id>4</parent_network_id><shared>0</shared></org_network>'

JSON Request Example

1
curl -i -X POST -u user:userpass --url http://onapp.test/org_networks.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"org_network": {"label": "test", "vdc_id": "13", "fence_mode": "bridged", "parent_network_id": "4", "shared": "0"}}'

The HTTP 201 response is returned on the successful creation of a direct NSX-T network with the shared parameter set to 0. The HTTP 422 response is returned upon failure to create a direct NSX-T network with the shared parameter set to 1.

Where:

  • label - the name of the network
  • vdc_id - the ID of the resource pool to which the network will be connected
  • fence_mode - the type of the organization network, in this case, it is bridged
  • parent_network_id - the ID of the external network with which the direct organization network will be associated
  • shared - set 1 to make the direct organization network shared; otherwise, set 0

Create Routed Network

XML Request Example

1
curl -i -X POST -u user:userpass --url http://onapp.test/org_networks.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<org_network><label>test</label><vdc_id>13</vdc_id><fence_mode>natRouted</fence_mode><parent_network_id>991</parent_network_id><network_gateway_cidr>11.0.0.2/22</network_gateway_cidr><shared>0</shared><primary_dns>191.170.0.2</primary_dns><secondary_dns>191.170.0.3</secondary_dns><dns_suffix>24</dns_suffix><ip_ranges_attributes type="array"><ip_ranges_attribute><start_address>11.0.0.2</start_address><end_address>11.0.0.6</end_address></ip_ranges_attribute></ip_ranges_attributes><edge_gateway>4</edge_gateway></org_network>'

JSON Request Example

1
curl -i -X POST -u user:userpass --url http://onapp.test/org_networks.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"org_network": {"label": "test", "vdc_id": "13", "fence_mode": "natRouted", "parent_network_id": "991", "network_gateway_cidr": "11.0.0.2/22", "shared": "0", "use_gateway_dns": "0", "primary_dns": "191.170.0.2", "secondary_dns": "191.170.0.3", "dns_suffix": "24", "ip_ranges_attributes": [{"start_address": "11.0.0.2", "end_address": "11.0.0.6"}], "edge_gateway": "4"}}'

The HTTP 201 response is returned on the successful creation of a routed NSX-T network with the shared parameter set to 0. The HTTP 422 response is returned upon failure to create a routed NSX-T network with the shared parameter set to 1.

Where:

  • label - the name of the network
  • vdc_id - the ID of the resource pool to which the network will be connected
  • fence_mode - the type of the organization network, in this case, it is ’natRouted'
  • parent_network_id - the ID of the external network with which the routed organization network will be associated
  • network_gateway_cidr - specify a network address (CIDR address format with gateway address)
  • shared - set 1 to make the routed organization network shared; otherwise, set 0
  • primary_dns - the IP address of the primary domain name system (DNS) server
  • secondary_dns - the IP address of the secondary domain name system (DNS) server
  • dns_suffix - the DNS suffix
  • ip_ranges_attributes - an array of static IP pools (applicable to isolated and routed org networks)
  • ip_ranges_attribute - а static IP pool (applicable to isolated and routed org networks)
    • start_address - specify the start IP address
    • end_address - specify the end IP address
  • edge_gateway - the edge gateway to which the network will be connected

Create Isolated Network

XML Request Example

1
curl -i -X POST -u user:userpass --url http://onapp.test/org_networks.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<org_network><label>test</label><vdc_id>13</vdc_id><fence_mode>isolated</fence_mode><parent_network_id>993</parent_network_id><network_gateway_cidr>10.0.0.1/22</network_gateway_cidr><shared>0</shared><primary_dns>10.0.0.2</primary_dns><secondary_dns>10.0.0.3</secondary_dns><dns_suffix>24</dns_suffix><ip_ranges_attributes><ip_ranges_attribute><start_address>10.0.0.4</start_address><end_address>10.0.0.8</end_address></ip_ranges_attribute></ip_ranges_attributes><edge_gateway>5</edge_gateway><organization><organization_id>1640</organization_id></organization></org_network>'

JSON Request Example

1
curl -i -X POST -u user:userpass --url http://onapp.test/org_networks.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"org_network": {"label": "test", "vdc_id": "13", "fence_mode": "isolated", "parent_network_id": "993", "network_gateway_cidr": "11.0.0.2/22", "shared": "0", "primary_dns": "10.0.0.2", "secondary_dns": "10.0.0.3", "dns_suffix": "24", "ip_ranges_attributes": [{"start_address": "11.0.0.3", "end_address": "11.0.0.6"}],"edge_gateway": "5", "organization": [{"organization_id": "1640"]}}'

The HTTP 201 response is returned on the successful creation of an isolated NSX-T network with the shared parameter set to 0. The HTTP 422 response is returned upon failure to create an isolated NSX-T network with the shared parameter set to 1.

Where:

  • label - the name of the network
  • vdc_id - the ID of the resource pool to which the network will be connected
  • fence_mode - the type of the organization network, in this case, it is isolated
  • parent_network_id - the ID of the external network with which the isolated organization network will be associated
  • network_gateway_cidr - specify a network address (CIDR address format with gateway address)
  • shared - set 1 to make the isolated organization network shared; otherwise, set 0
  • primary_dns - the IP address of the primary domain name system (DNS) server
  • secondary_dns - the IP address of the secondary domain name system (DNS) server
  • dns_suffix - the DNS suffix
  • ip_ranges_attributes - an array of static IP pools (applicable to isolated and routed org networks)
  • ip_ranges_attribute - а static IP pool (applicable to isolated and routed org networks)
    • start_address - specify the start IP address
    • end_address - specify the end IP address
  • edge_gateway - the edge gateway to which the network will be connected
  • organization_id - the ID of the organization