Updated on 2024-09-26 GMT+08:00

Updating a Backend Server Group

Function

This API is used to update a backend server group.

Constraints

The backend server group can be updated only when the provisioning status of the associated load balancer is ACTIVE.

Calling Method

For details, see Calling APIs.

URI

PUT /v3/{project_id}/elb/pools/{pool_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

pool_id

Yes

String

Specifies the backend server group ID.

project_id

Yes

String

Specifies the project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the token used for IAM authentication.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

pool

Yes

UpdatePoolOption object

Specifies the backend server group.

Table 4 UpdatePoolOption

Parameter

Mandatory

Type

Description

admin_state_up

No

Boolean

Specifies the administrative status of the backend server group. The value can only be updated to true.

description

No

String

Provides supplementary information about the backend server group.

lb_algorithm

No

String

Specifies the load balancing algorithm used by the load balancer to route requests to backend servers in the associated backend server group.

The value can be one of the following:

  • ROUND_ROBIN: weighted round robin

  • LEAST_CONNECTIONS: weighted least connections

  • SOURCE_IP: source IP hash

  • QUIC_CID: connection ID

Notes and constraints:

  • If the value is SOURCE_IP or QUIC_CID, the weight parameter will not take effect for backend servers.

  • QUIC_CID is supported only when the protocol of the backend server group is QUIC.

name

No

String

Specifies the backend server group name.

session_persistence

No

UpdatePoolSessionPersistenceOption object

Specifies the sticky session.

slow_start

No

UpdatePoolSlowStartOption object

Specifies slow start details. After you enable slow start, new backend servers added to the backend server group are warmed up, and the number of requests they can receive increases linearly during the configured slow start duration.

This parameter can be used when the protocol of the backend server group is HTTP or HTTPS. An error will be returned if the protocol is not HTTP or HTTPS.

member_deletion_protection_enable

No

Boolean

Specifies whether to enable removal protection for the load balancer.

  • true: Enable removal protection.

  • false: Disable removal protection.

NOTE:

Disable removal protection for all your resources before deleting your account.

vpc_id

No

String

Specifies the ID of the VPC where the backend server group works.

This parameter can be updated only when vpc_id is left blank.

type

No

String

Specifies the type of the backend server group.

The value can be:

  • instance: Any type of backend servers can be added. vpc_id is mandatory.

  • ip: Only IP as backend servers can be added. vpc_id cannot be specified.

  • "": Any type of backend servers can be added.

Note:

This parameter can be updated only when type is left blank.

protection_status

No

String

Specifies the protection status.

The value can be:

  • nonProtection (default): The resource is not protected against being modified by accident.

  • consoleProtection: The resource is protected against being modified by accident.

protection_reason

No

String

Specifies why the modification protection function is enabled.

NOTE:

This parameter is valid only when protection_status is set to consoleProtection.

any_port_enable

No

Boolean

Specifies whether to enable any_port_enable for a backend server group. If this option is enabled, the listener routes the requests to the backend server over the same port as the frontend port. If this option is disabled, the listener routes the requests over the port specified by protocol_port.

The value can be:

  • false: Disable this option.

  • true: Enable this option.

Notes and constraints: This option is available only for TCP, UDP, or QUIC backend server groups.

pool_health

No

PoolHealth object

Specifies the configurations of the pool health feature.

Table 5 UpdatePoolSessionPersistenceOption

Parameter

Mandatory

Type

Description

cookie_name

No

String

Specifies the cookie name.

For shared load balancers, the name can contain a maximum of 64 characters, including letters, digits, underscores (_), and hyphens (-).

For dedicated load balancers, the name can contain a maximum of 255 characters, including letters, digits, underscores (_), hyphens (-), and periods (.).

Note:

This parameter will take effect only when type is set to APP_COOKIE. Otherwise, an error will be returned.

type

No

String

Specifies the sticky session type.

The value can be SOURCE_IP, HTTP_COOKIE, or APP_COOKIE.

Notes and constraints:

  • If the protocol of the backend server group is TCP or UDP, only SOURCE_IP takes effect.

  • If the protocol of the backend server group is HTTP or HTTPS, the value can be HTTP_COOKIE or APP_COOKIE.

  • If the backend server group protocol is QUIC, sticky session must be enabled with type set to SOURCE_IP.

persistence_timeout

No

Integer

Specifies the stickiness duration, in minutes. This parameter will not take effect when type is set to APP_COOKIE.

  • If the protocol of the backend server group is TCP, UDP, or QUIC, the value ranges from 1 to 60, and the default value is 1.

  • If the protocol of the backend server group is HTTP or HTTPS, the value ranges from 1 to 1440, and the default value is 1440.

Table 6 UpdatePoolSlowStartOption

Parameter

Mandatory

Type

Description

enable

No

Boolean

Specifies whether to enable slow start.

  • true: Enable slow start.

  • false: Disable slow start.

duration

No

Integer

Specifies the slow start duration, in seconds.

The value ranges from 30 to 1200, and the default value is 30.

Table 7 PoolHealth

Parameter

Mandatory

Type

Description

minimum_healthy_member_count

No

Integer

Specifies the minimum number of healthy backend servers. If the number of healthy backend servers is less than the value specified for this parameter, the backend server group is considered as unhealthy.

The value can be 0 (disabled) or 1 (enabled). The default value is 0.

Response Parameters

Status code: 200

Table 8 Response body parameters

Parameter

Type

Description

request_id

String

Specifies the request ID.

Note: The value is automatically generated.

pool

Pool object

Specifies the backend server group.

Table 9 Pool

Parameter

Type

Description

admin_state_up

Boolean

Specifies the administrative status of the backend server group.

description

String

Provides supplementary information about the backend server group.

healthmonitor_id

String

Specifies the ID of the health check configured for the backend server group.

id

String

Specifies the backend server group ID.

lb_algorithm

String

Specifies the load balancing algorithm used by the load balancer to route requests to backend servers in the associated backend server group.

The value can be one of the following:

  • ROUND_ROBIN: weighted round robin

  • LEAST_CONNECTIONS: weighted least connections

  • SOURCE_IP: source IP hash

  • QUIC_CID: connection ID

Notes and constraints:

  • If the value is SOURCE_IP or QUIC_CID, the weight parameter will not take effect for backend servers.

  • QUIC_CID is supported only when the protocol of the backend server group is QUIC.

listeners

Array of ListenerRef objects

Specifies the IDs of the listeners with which the backend server group is associated.

loadbalancers

Array of LoadBalancerRef objects

Specifies the IDs of the load balancers with which the backend server group is associated.

members

Array of MemberRef objects

Specifies the IDs of the backend servers in the backend server group.

name

String

Specifies the backend server group name.

project_id

String

Specifies the project ID.

protocol

String

Specifies the protocol used by the backend server group to receive requests.

The value can be TCP, UDP, TLS, HTTP, HTTPS, gRPC, or QUIC.

Notes and constraints:

  • If the listener's protocol is UDP, the protocol of the backend server group must be UDPor QUIC.

  • If the listener's protocol is TCP, the protocol of the backend server group must be TCP.

  • If the listener's protocol is HTTP, the protocol of the backend server group must be HTTP.

  • If the listener's protocol is HTTPS, the protocol of the backend server group can be HTTP, HTTPS, or gRPC.

  • If the listener's protocol is TERMINATED_HTTPS, the protocol of the backend server group must be HTTP.

  • If the listener's protocol is QUIC, the protocol of the backend server group can be HTTP, HTTPS, or gRPC.

  • If the listener's protocol is TLS, the protocol of the backend server group can be TLS or TCP.

  • If protocol of the backend server group is QUIC, session_persistence must be set to true, with type set to SOURCE_IP.

  • If protocol of the backend server group is gRPC, http2_enable of the listener must be set to true.

  • If protocol of the backend server group is TCP, the ip_version must be set to v4.

session_persistence

SessionPersistence object

Specifies the sticky session.

ip_version

String

Specifies the IP address version supported by the backend server group.

  • Shared load balancers: The value is fixed at v4.

  • Dedicated load balancers: The value can be dualstack or v4. If the protocol of the backend server group is TCP, UDP, or QUIC, the value is dualstack. If the protocol of the backend server group is HTTP or HTTPS, the value is v4.

slow_start

SlowStart object

Specifies slow start details. After you enable slow start, new backend servers added to the backend server group are warmed up, and the number of requests they can receive increases linearly during the configured slow start duration.

This parameter can be used when the protocol of the backend server group is HTTP or HTTPS. An error will be returned if the protocol is not HTTP or HTTPS.

member_deletion_protection_enable

Boolean

Specifies whether to enable removal protection.

The value can be:

  • true: Enable removal protection.

  • false: Disable removal protection.

NOTE:

Disable removal protection for all your resources before deleting your account.

created_at

String

Specifies the time when the forwarding policy was added.

The format is yyyy-MM-dd'T'HH:mm:ss'Z' (UTC time).

This is a new field in this version, and it will not be returned for resources associated with existing dedicated load balancers and for resources associated with existing and new shared load balancers.

updated_at

String

Specifies the time when the forwarding policy was updated.

The format is yyyy-MM-dd'T'HH:mm:ss'Z' (UTC time).

This is a new field in this version, and it will not be returned for resources associated with existing dedicated load balancers and for resources associated with existing and new shared load balancers.

vpc_id

String

Specifies the ID of the VPC where the backend server group works.

type

String

Specifies the type of the backend server group.

The value can be:

  • instance: Any type of backend servers can be added. vpc_id is mandatory.

  • ip: Only IP as backend servers can be added. vpc_id cannot be specified.

  • "": Any type of backend servers can be added.

protection_status

String

Specifies the protection status.

The value can be:

  • nonProtection (default): The resource is not protected against being modified by accident.

  • consoleProtection: The resource is protected against being modified by accident.

protection_reason

String

Specifies why the modification protection function is enabled.

Notes and constraints: This parameter is valid only when protection_status is set to consoleProtection.

any_port_enable

Boolean

Specifies whether to enable any_port_enable for a backend server group. If this option is enabled, the listener routes the requests to the backend server over the same port as the frontend port. If this option is disabled, the listener routes the requests over the port specified by protocol_port.

The value can be:

  • false: Disable this option.

  • true: Enable this option.

Notes and constraints: This option is available only for TCP, UDP, or QUIC backend server groups.

enterprise_project_id

String

Specifies the enterprise project ID of the IP address group.

Table 10 ListenerRef

Parameter

Type

Description

id

String

Specifies the listener ID.

Table 11 LoadBalancerRef

Parameter

Type

Description

id

String

Specifies the load balancer ID.

Table 12 MemberRef

Parameter

Type

Description

id

String

Specifies the backend server ID.

Table 13 SessionPersistence

Parameter

Type

Description

cookie_name

String

Specifies the cookie name.

Notes and constraints:

  • This parameter will take effect only when type is set to APP_COOKIE. Otherwise, an error will be returned.

Value ranges:

  • For shared load balancers, the name can contain a maximum of 64 characters, including letters, digits, underscores (_), and hyphens (-).

  • For dedicated load balancers, the name can contain a maximum of 255 characters, including letters, digits, underscores (_), hyphens (-), and periods (.).

type

String

Specifies the sticky session type.

The value can be SOURCE_IP, HTTP_COOKIE, or APP_COOKIE.

Notes and constraints:

  • If the protocol of the backend server group is TCP or UDP, only SOURCE_IP takes effect.

  • For dedicated load balancers, if the protocol of the backend server group is HTTP or HTTPS, the value can only be HTTP_COOKIE. For shared load balancers, if the protocol of the backend server group is HTTP or HTTPS, the value can be HTTP_COOKIE or APP_COOKIE.

  • If the backend server group protocol is QUIC, sticky session must be enabled with type set to SOURCE_IP.

persistence_timeout

Integer

Specifies the stickiness duration, in minutes. This parameter will not take effect when type is set to APP_COOKIE.

Value ranges:

  • If the protocol of the backend server group is TCP, UDP, or QUIC, the value ranges from 1 to 60, and the default value is 1.

  • If the protocol of the backend server group is HTTP or HTTPS, the value ranges from 1 to 1440, and the default value is 1440.

Table 14 SlowStart

Parameter

Type

Description

enable

Boolean

Specifies whether to enable slow start.

The value can be:

  • true: Enable slow start.

  • false (default): Disable slow start.

duration

Integer

Specifies the slow start duration, in seconds.

The value ranges from 30 to 1200, and the default value is 30.

Example Requests

Changing the load balancing algorithm of a backend server group

PUT https://{ELB_Endpoint}/v3/99a3fff0d03c428eac3678da6a7d0f24/elb/pools/36ce7086-a496-4666-9064-5ba0e6840c75

{
  "pool" : {
    "name" : "My pool.",
    "description" : "My pool update",
    "lb_algorithm" : "LEAST_CONNECTIONS"
  }
}

Example Responses

Status code: 200

Successful request.

{
  "pool" : {
    "type" : "",
    "vpc_id" : "",
    "lb_algorithm" : "LEAST_CONNECTIONS",
    "protocol" : "TCP",
    "description" : "My pool update",
    "admin_state_up" : true,
    "member_deletion_protection_enable" : false,
    "loadbalancers" : [ {
      "id" : "098b2f68-af1c-41a9-8efd-69958722af62"
    } ],
    "project_id" : "99a3fff0d03c428eac3678da6a7d0f24",
    "session_persistence" : null,
    "healthmonitor_id" : null,
    "listeners" : [ {
      "id" : "0b11747a-b139-492f-9692-2df0b1c87193"
    }, {
      "id" : "61942790-2367-482a-8b0e-93840ea2a1c6"
    }, {
      "id" : "fd8f954c-f0f8-4d39-bb1d-41637cd6b1be"
    } ],
    "members" : [ ],
    "id" : "36ce7086-a496-4666-9064-5ba0e6840c75",
    "name" : "My pool.",
    "ip_version" : "dualstack",
    "pool_health" : {
      "minimum_healthy_member_count" : 0
    }
  },
  "request_id" : "8f40128b-c72b-4b64-986a-f7e2c633d75f"
}

Status Codes

Status Code

Description

200

Successful request.

Error Codes

See Error Codes.