After creating a network profile with a VLAN transport zone, you can provision a VLAN private network.

With VLAN IDs in your private network definition, Automation Assembler allocates the cloud template to a network profile with a VLAN transport zone specified. If no VLAN ID is specified, the cloud template is allocated to a network profile with an overlay transport zone.

Prerequisites

Procedure

  1. Assign your project ID variable.
    project_id='<your_project_id>'
  2. Provision the network with VLAN IDs that you choose.
    curl -X POST \
      $url/iaas/api/networks?apiVersion=$api_version \
      -H "Authorization: Bearer $access_token" \
      -H 'Content-Type: application/json' \
      -d '{
        "name": "<your_network_name>",
        "description": "<your_description>",
        "projectId": "'$project_id'",
        "customProperties": {
          "networkType": "PRIVATE",
          "vlanIds": "<integer_values_0_to_4094>"
      }
    }' | jq "."
    The response includes a selfLink value.
    {
      "progress": 0,
      "status": "INPROGRESS",
      "name": "Provisioning",
      "id": "example-selfLink-alphanumeric-string",
      "selfLink": "/iaas/api/request-tracker/example-selfLink-alphanumeric-string"
    }
  3. Assign the selfLink variable.
    selfLink_id='example-selfLink-alphanumeric-string'
  4. Use the selfLink variable to track the request.
    curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/request-tracker/$selfLink_id | jq "."

Example: Provision a VLAN Private Network

Provision a VLAN private network for a project ID

Assign variables.

Note: If your organization uses an API service that is hosted outside of the United States, your URL variable must include a country abbreviation. See Regional Endpoints for VMware Aria Automation APIs.
$ url='https://api.mgmt.cloud.vmware.com'
$ api_version='2021-07-15'

Assign the project ID.

$ project_id='5944aacb-91de-4541-bb9e-ef2a5403f81b'

Provision the VLAN private network.

curl -X POST \
  $url/iaas/api/networks?apiVersion=$api_version \
  -H "Authorization: Bearer $access_token" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "example-vlan-network",
    "description": "Example VLAN Network created using API",
    "projectId": "'$project_id'",
    "customProperties": {
      "networkType": "PRIVATE",
      "vlanIds": "1004, 1005"
  }
}' | jq "."

The response includes a selfLink.

{
  "progress": 0,
  "status": "INPROGRESS",
  "name": "Provisioning",
  "id": "dab1fe2f-4104-4fce-b534-e7ab5c172788",
  "selfLink": "/iaas/api/request-tracker/dab1fe2f-4104-4fce-b534-e7ab5c172788",
  "deploymentId": "8964a3f6-e829-40ad-b07c-0177abb7b4f4"
}

Assign the selfLink variable.

selfLink_id='dab1fe2f-4104-4fce-b534-e7ab5c172788'

Use the selfLink variable to track the request.

curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/request-tracker/$selfLink_id | jq "."

When the request completes successfully, the response shows the network has been created.

{
    "progress": 100,
    "message": "success",
    "status": "FINISHED",
    "resources": [
        "/iaas/api/networks/3f3b4f87-3e0d-48e8-a484-a8f2890977df"
    ],
    "name": "example-vlan-network Allocation",
    "id": "1cca9d9c-1e93-40d6-8bab-fa92dd89566a",
    "selfLink": "/iaas/api/request-tracker/1cca9d9c-1e93-40d6-8bab-fa92dd89566a",
    "deploymentId": "8b8eef00-e159-4ba9-9e78-09089a3f5786"
}