REST API - create

vcenter namespace management networks: create

Create a vSphere Namespaces network object associated with the given cluster. Warning: This operation is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Request:

HTTP request

POST https://{server}/api/vcenter/namespace-management/clusters/{cluster}/networks
{
    "vsphere_network"{
        "portgroup""obj-103",
        "address_ranges"[
            {
                "address""string",
                "count"1
            },
            {
                "address""string",
                "count"1
            }
        ],
        "subnet_mask""string",
        "gateway""string"
    },
    "network_provider""NSXT_CONTAINER_PLUGIN",
    "network""obj-103"
}

Path Parameters

Name Type Description
Required
cluster string Identifier for the cluster.

Body Parameters:

Name Type Description
bold = required
- create_spec Information about the network object to be created.
-.network string Identifier of the network. This has DNS_LABEL restrictions as specified in . This must be an alphanumeric (a-z and 0-9) string and with maximum length of 63 characters and with the '-' character allowed anywhere except the first or last character. This name must be unique within a cluster. This attribute was added in vSphere API 7.0.1.0.

When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: com.vmware.vcenter.namespace_management.Network. When operations return a value of this structure as a result, the field will be an identifier for the resource type: com.vmware.vcenter.namespace_management.Network.

-.network_provider string The network provider that will manage the vSphere Namespaces network object. This attribute was added in vSphere API 7.0.1.0.

Identifies the network plugin that cluster networking functionalities for this vSphere Namespaces Cluster. Value is one of:
NSXT_CONTAINER_PLUGIN: NSX-T Container Plugin.
VSPHERE_NETWORK: vSphere Networking. This constant was added in vSphere API 7.0.1.0.

-.vsphere_network vsphere_DVPG_network_create_spec The create spec for a DVPG-backed Namespaces network object, supported by VSPHERE_NETWORK network provider. This attribute was added in vSphere API 7.0.1.0.

Optional. It is only relevant when network_provider has value VSPHERE_NETWORK. This field is optional and it is only relevant when the value of network_provider is VSPHERE_NETWORK.

-.vsphere_network.portgroup string Identifier of the vSphere Distributed Portgroup backing the vSphere network object. This attribute was added in vSphere API 7.0.1.0.

When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: Network. When operations return a value of this structure as a result, the field will be an identifier for the resource type: Network.

-.vsphere_network.address_ranges IP_range[] Usable IP pools on this network. This attribute was added in vSphere API 7.0.1.0.

-.vsphere_network.address_ranges[].address string The starting address of the range. This attribute was added in vSphere API 7.0.1.0.

-.vsphere_network.address_ranges[].count long The number of IP addresses in the range. This attribute was added in vSphere API 7.0.1.0.

-.vsphere_network.gateway string Gateway for the network. This attribute was added in vSphere API 7.0.1.0.

-.vsphere_network.subnet_mask string Subnet mask of the network. This attribute was added in vSphere API 7.0.1.0.

Response:

HTTP Status Code: 204

Headers:

None

Type:

None

Errors:

HTTP Status Code Type Description
400 already_exists if a network by the name as specified in the create_spec already exists.
500 error if the system reports an error while responding to the request.
400 not_allowed_in_current_state if the associated cluster is being disabled.
404 not_found if cluster cannot be located.
401 unauthenticated if the user can not be authenticated.
403 unauthorized if the user does not have Namespaces.Manage privilege.