REST API - create

vcenter namespace management load balancers: create

Create a load balancer config to associate a user provisioned load balancer with a 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}/load-balancers/
{
    "ha_proxy_config_create_spec"{
        "password""secret string",
        "servers"[
            {
                "port"1,
                "host""string"
            },
            {
                "port"1,
                "host""string"
            }
        ],
        "certificate_authority_chain""string",
        "username""string"
    },
    "address_ranges"[
        {
            "address""string",
            "count"1
        },
        {
            "address""string",
            "count"1
        }
    ],
    "provider""HA_PROXY",
    "id""obj-103"
}

Path Parameters

Name Type Description
Required
cluster string Identifier of the cluster the load balancer is associated with.

Body Parameters:

Name Type Description
bold = required
- config_spec Information about the load balancer object to be created.
-.id string An identifier that identifies a load balancer and can be used to query or configure load balancer properties via these resources. The identifier has DNS_LABEL restrictions as specified in . This must be an alphanumeric (a-z and 0-9) string, with a maximum length of 63 characters and with the '-' character allowed anywhere except the first or last character. This name is unique across all Namespaces in this vCenter server. 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.LoadBalancerConfig. 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.LoadBalancerConfig.

-.address_ranges IP_range[] List of address ranges that will be used to derive frontend IP addresses for L4 virtual servers. At least one range must be provided. This attribute was added in vSphere API 7.0.1.0.

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

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

-.provider string The provider selects a provider from the list of available providers to be used with vSphere Namespaces. This attribute was added in vSphere API 7.0.1.0.

The provider enumerates the kinds of load balancers supported by vSphere Namespaces. This enumeration was added in vSphere API 7.0.1.0. Value is one of:
HA_PROXY: This constant was added in vSphere API 7.0.1.0.

-.ha_proxy_config_create_spec HA_proxy_config_create_spec The HA_proxy_config_create_spec is a conditional configuration made available upon selecting the HA_PROXY load balancer provider. It is used to configure the load balancer at run time. This attribute was added in vSphere API 7.0.1.0.

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

-.ha_proxy_config_create_spec.servers server[] Servers is a list of the addresses for the data plane API servers used to configure Virtual Servers. This attribute was added in vSphere API 7.0.1.0.

-.ha_proxy_config_create_spec.servers[].host string Load balancer hostname or IPv4 address. This attribute was added in vSphere API 7.0.1.0.

-.ha_proxy_config_create_spec.servers[].port long Load balancer port. This attribute was added in vSphere API 7.0.1.0.

-.ha_proxy_config_create_spec.username string An administrator user name for accessing the HAProxy Data Plane API server. This attribute was added in vSphere API 7.0.1.0.

-.ha_proxy_config_create_spec.password secret The password for the administrator user. This attribute was added in vSphere API 7.0.1.0.

-.ha_proxy_config_create_spec.certificate_authority_chain string CertificateAuthorityChain contains PEM-encoded CA chain which is used to verify x509 certificates received from the server. 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 the load balancer config exists already.
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 cannot be authenticated.
403 unauthorized if the user does not have Namespaces.Manage privilege.
400 unsupported if the specified cluster does not have vSphere Namespaces enabled.