Updating a Load Balancer

Function

This API is used to update a load balancer.

URI

PUT /v3/{project_id}/elb/loadbalancers/{loadbalancer_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

loadbalancer_id

Yes

String

Specifies the load balancer ID.

Minimum: 0

Maximum: 36

project_id

Yes

String

Specifies the project ID.

Minimum: 0

Maximum: 36

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the token used for IAM authentication.

Minimum: 0

Maximum: 4096

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

loadbalancer

Yes

UpdateLoadBalancerOption object

Specifies the load balancer.

Table 4 UpdateLoadBalancerOption

Parameter

Mandatory

Type

Description

name

No

String

Specifies the load balancer name.

Minimum: 0

Maximum: 255

admin_state_up

No

Boolean

Specifies the administrative status of the load balancer. The value can only be true.

This parameter is unsupported. Please do not use it.

description

No

String

Provides supplementary information about the load balancer.

Minimum: 0

Maximum: 255

ipv6_vip_virsubnet_id

No

String

Specifies the ID of the IPv6 subnet where the load balancer resides. You can query parameter id in the response by calling the API (GET https://{VPC_Endpoint}/v1/{project_id}/subnets).

The IPv6 subnet can be updated using ipv6_vip_virsubnet_id, and the private IPv6 address of the load balancer will be changed accordingly.

Note:

  • This parameter will be passed only when IPv6 is enabled for the subnet. The subnet specified by ipv6_vip_virsubnet_id must be in the VPC specified by vpc_id.

  • This parameter can be updated only when guaranteed is set to true.

  • The value will become null if the IPv6 address is unbound from the load balancer.

  • The IPv4 subnet will not change, if IPv6 subnet is updated.

vip_subnet_cidr_id

No

String

Specifies the ID of the IPv4 subnet where the load balancer resides. You can query parameter neutron_subnet_id in the response by calling the API (GET https://{VPC_Endpoint}/v1/{project_id}/subnets).

  • The IPv4 subnet can be updated using vip_subnet_cidr_id, and the private IPv4 address of the load balancer will be changed accordingly.

  • If vip_address is also specified, the IP address specified by vip_address must be in the subnet specified by vip_subnet_cidr_id and will be used as the private IPv4 address of the load balancer.

  • The IPv4 subnet must be in the VPC where the load balancer resides.

  • This parameter can be updated only when guaranteed is set to true.

  • The value will become null if the private IPv4 address is unbound from the load balancer.

  • The IPv6 subnet will not change, if IPv4 subnet is updated.

Note:

Minimum: 1

Maximum: 36

vip_address

No

String

Specifies the private IPv4 address bound to the load balancer. The IP address must be from the IPv4 subnet where the load balancer resides and should not be occupied by other services.

vip_address can be updated only when guaranteed is set to true.

Minimum: 1

Maximum: 36

l4_flavor_id

No

String

Specifies the ID of a flavor at Layer 4.

Note:

  • This parameter can be updated only when guaranteed is set to true.

  • The value cannot be changed from null to a specific value, or in the other way around.

  • If you change the flavor, you can select only a higher or lower one. If you select a lower one, part of persistent connections will be interrupted.

  • If L7_elastic_max is specified, the load balancer uses the elastic specifications.

Minimum: 1

Maximum: 255

l7_flavor_id

No

String

Specifies the ID of a flavor at Layer 7.

Note:

  • This parameter can be updated only when guaranteed is set to true.

  • The value cannot be changed from null to a specific value, or in the other way around.

  • If you change the flavor, you can select only a higher or lower one. If you select a lower one, part of persistent connections will be interrupted.

  • If L7_elastic_max is specified, the load balancer uses the elastic specifications.

Minimum: 1

Maximum: 36

ipv6_bandwidth

No

BandwidthRef object

Specifies the ID of the bandwidth used by an IPv6 address. This parameter is available only when you create or update a load balancer with a public IPv6 address. If you use a new IPv6 address and specify a shared bandwidth, the IPv6 address will be added to the shared bandwidth.

ip_target_enable

No

Boolean

Specifies whether to enable IP as a Backend Server.

If you enable this function, you can add servers in a peer VPC connected through a VPC peering connection, or in an on-premises data center at the other end of a Direct Connect or VPN connection, by using their IP addresses.

This function is supported only by dedicated load balancers.

The value can be true (enable IP as a Backend Server) or false (disable IP as a Backend Server).

The value can only be update to true.

elb_virsubnet_ids

No

Array of strings

Specifies the IDs of subnets on the downstream plane. You can query parameter neutron_network_id in the response by calling the API (GET https://{VPC_Endpoint}/v1/{project_id}/subnets).

  • If the IDs of the subnets required by the load balancer are specified in elb_virsubnet_ids, the subnets will still be bound to the load balancer.

  • If the IDs of the subnets required by the load balancer are not specified in elb_virsubnet_ids, the subnets will be unbound from the load balancers. Do not unbound the subnets that have been used by the load balancer. Otherwise, an error will be returned.

  • If the IDs of the subnets are specified in elb_virsubnet_ids, but not on the downstream plane, a new load balancer will be bound to the downstream plane.

Note:

  • All subnets belong to the same VPC where the load balancer resides.

  • Edge subnets are not supported.

Minimum: 1

Maximum: 64

Array Length: 0 - 64

deletion_protection_enable

No

Boolean

Specifies whether to enable deletion protection for the load balancer.

  • true: Enable deletion protection.

  • false: Disable deletion protection.

NOTE:
Disable deletion protection for all your resources before deleting your account.

waf_failure_action

No

String

Specifies traffic distributing policies when the WAF is faulty.

  • discard: Traffic will not be distributed.

  • forward: Traffic will be distributed to the default backend servers.

Note: This parameter takes effect only when WAF is enabled for the load balancer.

This parameter is unsupported. Please do not use it.

Minimum: 0

Maximum: 36

protection_status

No

String

Specifies the protection status.

Value options:

  • nonProtection: The load balancer is not protected.

  • consoleProtection: Modification Protection is enabled on the console.

protection_reason

No

String

Specifies why the modification protection is enabled.

Note: This parameter is valid only when protection_status is set to consoleProtection. If protection_status is set to nonProtection, the value of protection_reason is removed. The value can contain a maximum of 255 Unicode characters, excluding angle brackets (<>).

Minimum: 0

Maximum: 255

Table 5 BandwidthRef

Parameter

Mandatory

Type

Description

id

Yes

String

Specifies the shared bandwidth ID.

Response Parameters

Status code: 200

Table 6 Response body parameters

Parameter

Type

Description

loadbalancer

LoadBalancer object

Specifies the load balancer.

request_id

String

Specifies the request ID. The value is automatically generated.

Minimum: 0

Maximum: 36

Table 7 LoadBalancer

Parameter

Type

Description

id

String

Specifies the load balancer ID.

description

String

Provides supplementary information about the load balancer.

Minimum: 1

Maximum: 255

provisioning_status

String

Specifies the provisioning status of the load balancer. The value can be one of the following:

  • ACTIVE: The load balancer is successfully provisioned.

  • PENDING_DELETE: The load balancer is being deleted.

admin_state_up

Boolean

Specifies the administrative status of the load balancer. The value can only be true.

provider

String

Specifies the provider of the load balancer. The value can only be vlb.

pools

Array of PoolRef objects

Lists the IDs of backend server groups associated with the load balancer.

listeners

Array of ListenerRef objects

Lists the IDs of listeners added to the load balancer.

operating_status

String

Specifies the operating status of the load balancer. The value can only be ONLINE, indicating that the load balancer is running normally.

name

String

Specifies the load balancer name.

project_id

String

Specifies the project ID of the load balancer.

vip_subnet_cidr_id

String

Specifies the ID of the IPv4 subnet where the load balancer resides.

vip_address

String

Specifies the private IPv4 address bound to the load balancer.

vip_port_id

String

Specifies the ID of the port bound to the private IPv4 address of the load balancer.

The default security group associated with the port will take effect only after at least one backend server is associated with load balancer.

tags

Array of Tag objects

Lists the tags added to the load balancer.

created_at

String

Specifies the time when the load balancer was created, in the format of yyyy-MM-dd''T''HH:mm:ss''Z''.

updated_at

String

Specifies the time when the load balancer was updated, in the format of yyyy-MM-dd''T''HH:mm:ss''Z''.

guaranteed

Boolean

Specifies whether the load balancer is a dedicated load balancer.

  • true (default): The load balancer is a dedicated load balancer.

  • false: The load balancer is a shared load balancer.

vpc_id

String

Specifies the ID of the VPC where the load balancer resides.

eips

Array of EipInfo objects

Specifies the EIP bound to the load balancer. Only one EIP can be bound to a load balancer.

This parameter has the same meaning as publicips.

ipv6_vip_address

String

Specifies the IPv6 address bound to the load balancer.

ipv6_vip_virsubnet_id

String

Specifies the ID of the IPv6 subnet where the load balancer resides.

ipv6_vip_port_id

String

Specifies the ID of the port bound to the IPv6 address of the load balancer.

availability_zone_list

Array of strings

Specifies the list of AZs where the load balancer is created.

enterprise_project_id

String

Specifies the enterprise project ID.

If this parameter is not passed during resource creation, "0" will be returned, and the resource belongs to the default enterprise project.

"0" is not a valid enterprise project ID and cannot be used in the APIs for creating, updating the load balancer, or querying details of the load balancer.

This parameter is unsupported. Please do not use it.

billing_info

String

Provides resource billing information.

This parameter is unsupported. Please do not use it.

Minimum: 1

Maximum: 1024

l4_flavor_id

String

Specifies the ID of a flavor at Layer 4.

Minimum: 1

Maximum: 255

l4_scale_flavor_id

String

Specifies the ID of the reserved flavor at Layer 4.

This parameter is unsupported. Please do not use it.

Minimum: 1

Maximum: 255

l7_flavor_id

String

Specifies the ID of a flavor at Layer 7.

Minimum: 1

Maximum: 255

l7_scale_flavor_id

String

Specifies the ID of the reserved flavor at Layer 7.

This parameter is unsupported. Please do not use it.

Minimum: 1

Maximum: 255

publicips

Array of PublicIpInfo objects

Specifies the EIP bound to the load balancer. Only one EIP can be bound to a load balancer.

This parameter has the same meaning as eips.

global_eips

Array of GlobalEipInfo objects

Specifies the global EIP bound to the load balancer. Only the first global EIP specified under global_eips will be bound.

This parameter is unsupported. Please do not use it.

elb_virsubnet_ids

Array of strings

Lists the IDs of subnets on the downstream plane.

elb_virsubnet_type

String

Specifies the type of the subnet on the downstream plane.

  • ipv4: IPv4 subnet

  • dualstack: subnet that supports IPv4/IPv6 dual stack

ip_target_enable

Boolean

Specifies whether to enable IP as a Backend Server.

If you enable this function, you can add servers in a peer VPC connected through a VPC peering connection, or in an on-premises data center at the other end of a Direct Connect or VPN connection, by using their IP addresses.

This function is supported only by dedicated load balancers.

The value can be true (enable IP as a Backend Server) or false (disable IP as a Backend Server).

The value can only be update to true.

frozen_scene

String

Specifies the scenario where the load balancer is frozen. Multiple values are separated using commas (,).

This parameter is unsupported. Please do not use it.

ipv6_bandwidth

BandwidthRef object

Specifies the ID of the bandwidth used by an IPv6 address. This parameter is available only when you create or update a load balancer with a public IPv6 address. If you use a new IPv6 address and specify a shared bandwidth, the IPv6 address will be added to the shared bandwidth.

deletion_protection_enable

Boolean

Specifies whether deletion protection is enabled.

  • false: Deletion protection is not enabled.

  • true: Deletion protection is enabled.

NOTE:
Disable deletion protection for all your resources before deleting your account.

This parameter is returned only when deletion protection is enabled at the site.

autoscaling

AutoscalingRef object

Specifies the information about elastic scaling. If elastic scaling is enabled, the load balancer specifications can be automatically adjusted based on incoming traffic.

Note:

  • This parameter is only available for users on the whitelist.

  • If elastic scaling is enabled, l4_flavor_id indicates the ID of the maximmum elastic flavor at Layer 4. l7_flavor_id indicates the ID of the maximmum elastic flavor at Layer 7.

public_border_group

String

Specifies the AZ group to which the load balancer belongs.

waf_failure_action

String

Specifies traffic distributing policies when the WAF is faulty.

  • discard: Traffic will not be distributed.

  • forward: Traffic will be distributed to the default backend servers.

Note: This parameter takes effect only when WAF is enabled for the load balancer.

This parameter is unsupported. Please do not use it.

charge_mode

String

Specifies the charge mode when creating a load balancer.

Value options:

  • flavor: billed by the specification you select.

  • lcu: billed by how many LCUs you have used.

protection_status

String

Specifies the protection status.

Value options:

  • nonProtection (default): The load balancer is not protected.

  • consoleProtection: Modification Protection is enabled on the console.

protection_reason

String

Specifies why the modification protection is enabled.

Note: This parameter is valid only when protection_status is set to consoleProtection. The value can contain a maximum of 255 Unicode characters, excluding angle brackets (<>).

Minimum: 0

Maximum: 255

loadbalancer_type

String

Definition: Specifies the load balancer type.

Range:

  • gateway: gateway load balancers

  • null: other types of load balancers

This parameter is unsupported. Please do not use it.

gw_flavor_id

String

Definition: Specifies the flavor ID of the gateway load balancer.

Range: N/A

This parameter is unsupported. Please do not use it.

Minimum: 1

Maximum: 36

instance_type

String

Definition: Specifies the internal service to which the load balancer belongs.

Range: N/A

This parameter is unsupported. Please do not use it.

Minimum: 1

Maximum: 36

instance_id

String

Definition: Specifies the ID of the instance with which the load balancer is associated.

Range: N/A

This parameter is unsupported. Please do not use it.

Minimum: 1

Maximum: 36

log_group_id

String

Definition: Specifies the ID of the log group that is associated with the load balancer.

Range: N/A

log_topic_id

String

Definition: Specifies the ID of the log topic that is associated with the load balancer.

Range: N/A

custom_qos_limit

CustomQosLimit object

Definition: Specifies the rate limit information of the ELB flavors.

Range: N/A

This parameter is unsupported. Please do not use it.

service_lb_mode

String

Definition: Specifies load balancer mode.

Range:

  • lb: Cross-tenant access is not supported.

This parameter is unsupported. Please do not use it.

Minimum: 1

Maximum: 36

proxy_protocol_extensions

Array of ProxyProtocolExtension objects

Definition: Specifies the proxy protocol extension.

This parameter is unsupported. Please do not use it.

Table 8 PoolRef

Parameter

Type

Description

id

String

Specifies the ID of the backend server group.

Table 9 ListenerRef

Parameter

Type

Description

id

String

Specifies the listener ID.

Table 10 Tag

Parameter

Type

Description

key

String

Specifies the tag key.

Minimum: 1

Maximum: 36

value

String

Specifies the tag value.

Minimum: 0

Maximum: 43

Table 11 EipInfo

Parameter

Type

Description

eip_id

String

eip_id

eip_address

String

eip_address

ip_version

Integer

Specifies the IP version. 4 indicates IPv4, and 6 indicates IPv6.

Table 12 PublicIpInfo

Parameter

Type

Description

publicip_id

String

Specifies the EIP ID.

publicip_address

String

Specifies the IP address.

ip_version

Integer

Specifies the IP version. The value can be 4 (IPv4) or 6 (IPv6).

Table 13 GlobalEipInfo

Parameter

Type

Description

global_eip_id

String

Specifies the ID of the global EIP.

global_eip_address

String

Specifies the global EIP.

ip_version

Integer

Specifies the IP version. The value can be 4 and 6. 4 indicates an IPv4 address, and 6 indicates an IPv6 address.

Table 14 BandwidthRef

Parameter

Type

Description

id

String

Specifies the shared bandwidth ID.

Table 15 AutoscalingRef

Parameter

Type

Description

enable

Boolean

Specifies whether to enable elastic scaling for the load balancer.

  • true: Enable elastic scaling.

  • false: Disable elastic scaling.

Default: false

min_l7_flavor_id

String

Specifies the ID of the minimum elastic flavor at Layer 7. This parameter cannot be left blank if there are HTTP or HTTPS listeners.

Minimum: 1

Maximum: 36

Table 16 CustomQosLimit

Parameter

Type

Description

l4

L4Limit object

Definition: Specifies the rate limit information of the ELB flavors at Layer 4.

l7

L7Limit object

Definition: Specifies the rate limit information of the ELB flavors at Layer 7.

Table 17 L4Limit

Parameter

Type

Description

connection

Integer

Definition: Specifies the maximum number of concurrent connections at Layer 4.

Range: N/A

cps

Integer

Definition: Specifies the maximum number of new connections per second at Layer 4.

Range: N/A

Table 18 L7Limit

Parameter

Type

Description

connection

Integer

Definition: Specifies the maximum number of concurrent connections at Layer 7.

Range: N/A

cps

Integer

Definition: Specifies the maximum number of new connections per second at Layer 7.

Range: N/A

Table 19 ProxyProtocolExtension

Parameter

Type

Description

vip_address

String

Definition: Specifies the IPv4 address.

Constraints: N/A

Range: N/A

Default value: N/A

ipv6_vip_address

String

Definition: Specifies the IPv6 address.

Constraints: N/A

Range: N/A

Default value: N/A

extension

Extension object

Definition: Specifies the proxy protocol extension.

Constraints: N/A

Table 20 Extension

Parameter

Type

Description

ep_id

String

Definition: Specifies the VPC endpoint ID.

Constraints: N/A

Range: N/A

Default value: N/A

ep_service_id

String

Definition: Specifies the VPC endpoint service ID.

Constraints: N/A

Range: N/A

Default value: N/A

Example Requests

Updating a load balancer

PUT https://{ELB_Endpoint}/v3/{project_id}/elb/loadbalancers/{loadbalancer_id}

{
  "loadbalancer" : {
    "description" : "loadbalancer",
    "name" : "loadbalancer-update"
  }
}

Example Responses

Status code: 200

Successful request.

{
  "request_id" : "010dad1e-32a3-4405-ab83-62a1fc5f8722",
  "loadbalancer" : {
    "id" : "2e073bf8-edfe-4e51-a699-d915b0b8af89",
    "project_id" : "b2782e6708b8475c993e6064bc456bf8",
    "name" : "loadbalancer-update",
    "description" : "loadbalancer",
    "vip_port_id" : null,
    "vip_address" : null,
    "admin_state_up" : true,
    "provisioning_status" : "ACTIVE",
    "operating_status" : "ONLINE",
    "listeners" : [ {
      "id" : "41937176-bf64-4b58-8e0d-9ff2d0d32c54"
    }, {
      "id" : "abc6ac93-ad0e-4765-bd5a-eec632efde56"
    }, {
      "id" : "b9d8ba97-6d60-467d-838d-f3550b54c22a"
    }, {
      "id" : "fd797ebd-263d-4b18-96e9-e9188d36c69e"
    } ],
    "pools" : [ {
      "id" : "0aabcaa8-c35c-4ddc-a60c-9032d0ac0b80"
    }, {
      "id" : "165d9092-396e-4a8d-b398-067496a447d2"
    } ],
    "tags" : [ ],
    "provider" : "vlb",
    "created_at" : "2019-04-20T03:10:37Z",
    "updated_at" : "2019-05-24T02:11:58Z",
    "vpc_id" : "2037c5bb-e04b-4de2-9300-9051af18e417",
    "enterprise_project_id" : "0",
    "availability_zone_list" : [ "AZ1", "AZ2", "dc3" ],
    "ipv6_vip_address" : null,
    "ipv6_vip_virsubnet_id" : null,
    "ipv6_vip_port_id" : null,
    "eips" : [ ],
    "guaranteed" : true,
    "billing_info" : null,
    "l4_flavor_id" : null,
    "l4_scale_flavor_id" : null,
    "l7_flavor_id" : null,
    "l7_scale_flavor_id" : null,
    "vip_subnet_cidr_id" : null,
    "deletion_protection_enable" : false,
    "public_border_group" : "center",
    "waf_failure_action" : "forward"
  }
}

Status Codes

Status Code

Description

200

Successful request.

Error Codes

See Error Codes.