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

Batch Updating Forwarding Policy Priorities

Function

This API is used to batch update the priorities of forwarding policies.

Constraints

This API is only used to update the priorities of forwarding policies added to a listener of a dedicated load balancer when action is set to REDIRECT_TO_POOL.

Calling Method

For details, see Calling APIs.

URI

POST /v3/{project_id}/elb/l7policies/batch-update-priority

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

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

l7policies

No

Array of BatchUpdatePriorityRequestBody objects

Specifies the forwarding policy.

Table 4 BatchUpdatePriorityRequestBody

Parameter

Mandatory

Type

Description

id

Yes

String

Specifies the ID of the forwarding policy.

Minimum: 1

Maximum: 36

priority

Yes

Integer

Specifies the forwarding policy priority. A smaller value indicates a higher priority. The value must be unique for each forwarding policy of the same listener.

This parameter is available only for dedicated load balancers and will take effect when enhance_l7policy_enable is set to true. If this parameter is passed and enhance_l7policy_enable is set to false, an error will be returned.

  • If action is set to REDIRECT_TO_LISTENER, the value can only be 0, indicating that REDIRECT_TO_LISTENER has the highest priority.

  • If enhance_l7policy_enable is set to false, forwarding policies are automatically prioritized based on the original sorting logic. Forwarding policy priorities are independent of each other regardless of domain names. If forwarding policies use the same domain name, their priorities follow the order of exact match (EQUAL_TO), prefix match (STARTS_WITH), and regular expression match (REGEX). If prefix match is used for matching, the longer the path, the higher the priority. If a forwarding policy contains only a domain name without a path specified, the path is /, and prefix match is used by default.

  • If enhance_l7policy_enable is set to true and this parameter is not passed, the priority will set to a sum of 1 and the highest priority of existing forwarding policy in the same listener by default. There will be two cases:

a) If the highest priority of existing forwarding policies is the maximum (10,000), the forwarding policy will fail to create because the final priority for creating the forwarding policy is the sum of 1 and 10,000, which exceeds the maximum. In this case, please specify a value or adjust the priorities of existing forwarding policies.

b) If no forwarding policies exist, the highest priority of existing forwarding policies will be set to 1 by default.

For shared load balancers, this parameter is unsupported.

Minimum: 1

Maximum: 10000

Response Parameters

Status code: 202

Table 5 Response body parameters

Parameter

Type

Description

request_id

String

Specifies the backend server.

Example Requests

Batch updating the priorities of forwarding policies

POST https://{ELB_Endpoint}/v3/060576782980d5762f9ec014dd2f1148/elb/l7policies/batch-update-priority

{
  "l7policies" : [ {
    "id" : "1fe93e12-6e07-47a9-8f81-3346c015601d",
    "priority" : 11
  } ]
}

Example Responses

Status code: 202

Created

{
  "request_id" : "e5c07525-1470-47b6-9b0c-567527a036aa"
}

Status Codes

Status Code

Description

202

Created

Error Codes

See Error Codes.