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

Querying Forwarding Policies

Function

This API is used to query all the forwarding policies. Filter query and pagination query are supported. Unless otherwise specified, exact match is applied.

URI

GET /v2/{project_id}/elb/l7policies

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

marker

No

String

Specifies the ID of the forwarding policy from which pagination query starts, that is, the ID of the last forwarding policy on the previous page.

This parameter must be used together with limit.

limit

No

Integer

Specifies the number of forwarding policies on each page. If this parameter is not set, all forwarding policies are queried by default.

page_reverse

No

Boolean

Specifies the page direction. The value can be true or false, and the default value is false. The last page in the list requested with page_reverse set to false will not contain the "next" link, and the last page in the list requested with page_reverse set to true will not contain the "previous" link.

This parameter must be used together with limit.

id

No

String

Specifies the forwarding policy ID.

tenant_id

No

String

Specifies the ID of the project where the forwarding policy is used.

The value contains a maximum of 255 characters.

name

No

String

Specifies the forwarding policy name.

The value contains a maximum of 255 characters.

admin_state_up

No

Boolean

Specifies the administrative status of the forwarding policy.

This parameter is reserved, and the default value is true.

description

No

String

Provides supplementary information about the forwarding policy.

The value contains a maximum of 255 characters.

listener_id

No

String

Specifies the ID of the listener to which the forwarding policy is added.

action

No

String

Specifies whether requests are forwarded to another backend server group or redirected to an HTTPS listener.

The value range varies depending on the protocol of the backend server group:

  • REDIRECT_TO_POOL: Requests are forwarded to the backend server group specified by redirect_pool_id.
  • REDIRECT_TO_LISTENER: Requests are redirected from the HTTP listener specified by listener_id to the HTTPS listener specified by redirect_listener_id.

redirect_pool_id

No

String

Specifies the ID of the backend server group to which traffic is forwarded.

redirect_listener_id

No

String

Specifies the ID of the listener to which the traffic is redirected.

redirect_url

No

String

Specifies the URL to which traffic is redirected.

This parameter is reserved.

The value contains a maximum of 255 characters.

position

No

Integer

Specifies the forwarding priority. The value ranges from 1 to 100. The default value is 100.

This parameter is reserved.

provisioning_status

No

String

This parameter is reserved, and its value can only be ACTIVE.

It specifies the provisioning status of the forwarding policy.

enterprise_project_id

No

String

Specifies the enterprise project ID. Enterprise projects are used for fine-grained authentication.

  • If listener_id is passed, the ID of the enterprise project to which the load balancer belongs is used for authentication.
  • If listener_id is not passed, the ID of the enterprise project to which the forwarding policy belongs is used for authentication.
  • If neither listener_id nor enterprise_project_id is passed, fine-grained authentication is performed. The elb:loadbalancers:list permissions must be assigned to the user group.

Request

None

Response

Table 3 Response parameters

Parameter

Type

Description

l7policies

Array of L7policies objects

Lists the forwarding policies. For details, see Table 4.

Table 4 l7policy parameter description

Parameter

Type

Description

id

String

Specifies the forwarding policy ID.

tenant_id

String

Specifies the ID of the project where the forwarding policy is used.

name

String

Specifies the forwarding policy name.

admin_state_up

Boolean

Specifies the administrative status of the forwarding policy.

This parameter is reserved. The value can be true or false.

  • true: Enabled
  • false: Disabled

description

String

Provides supplementary information about the forwarding policy.

listener_id

String

Specifies the ID of the listener to which the forwarding policy is added.

action

String

Specifies whether requests are forwarded to another backend server group or redirected to an HTTPS listener.

The value range varies depending on the protocol of the backend server group:

  • REDIRECT_TO_POOL: Requests are forwarded to the backend server group specified by redirect_pool_id.
  • REDIRECT_TO_LISTENER: Requests are redirected from the HTTP listener specified by listener_id to the HTTPS listener specified by redirect_listener_id.

redirect_pool_id

String

Specifies the ID of the backend server group to which traffic is forwarded.

redirect_listener_id

String

Specifies the ID of the listener to which the traffic is redirected.

redirect_url

String

Specifies the URL to which traffic is redirected.

This parameter is reserved.

rules

Array of Rules objects

Lists the forwarding rules of the forwarding policy. For details, see Table 7.

position

Integer

Specifies the forwarding priority. The value ranges from 1 to 100. The default value is 100.

This parameter is reserved.

provisioning_status

String

This parameter is reserved, and its value can only be ACTIVE.

It specifies the provisioning status of the forwarding policy.

Table 5 rules parameter description

Parameter

Type

Description

id

String

Specifies the ID of the associated forwarding rule.

Example Request

  • Example request 1: Querying all forwarding policies
    GET https://{Endpoint}/v2/a31d2bdcf7604c0faaddb058e1e08819/elb/l7policies
  • Example request 2: Querying forwarding policies through which requests are forwarded to the backend server group
    GET https://{Endpoint}/v2/a31d2bdcf7604c0faaddb058e1e08819/elb/l7policies?action=REDIRECT_TO_POOL

Example Response

  • Example response 1
    {
        "l7policies": [
            {
                "redirect_pool_id": "431a03eb-81bb-408e-ae37-7ce19023692b", 
                "redirect_listener_id": null,  
                "description": "", 
                "admin_state_up": true, 
                "rules": [
                    {
                        "id": "67d8a8fa-b0dd-4bd4-a85b-671db19b2ef3"
                    }, 
                    {
                        "id": "f02b3bca-69d2-4335-a3fa-a8054e996213"
                    }
                ], 
                "tenant_id": "a31d2bdcf7604c0faaddb058e1e08819",
                "listener_id": "26058b64-6185-4e06-874e-4bd68b7633d0", 
                "redirect_url": null, 
                "action": "REDIRECT_TO_POOL", 
                "position": 2,
                "provisioning_status": "ACTIVE", 
                "id": "5ae0e1e7-5f0f-47a1-b39f-5d4c428a1586", 
                "name": ""
            }, 
            {
                "redirect_pool_id": "59eebd7b-c68f-4f8a-aa7f-e062e84c0690", 
                "redirect_listener_id": null,  
                "description": "", 
                "admin_state_up": true, 
                "rules": [
                    {
                        "id": "f4499f48-de3d-4efe-926d-926aa4d6aaf5"
                    }
                ], 
                "tenant_id": "a31d2bdcf7604c0faaddb058e1e08819",
                "listener_id": "e1310063-00de-4867-ab55-ccac4d9db364", 
                "redirect_url": null, 
                "action": "REDIRECT_TO_POOL", 
                "position": 1, 
                "provisioning_status": "ACTIVE",
                "id": "6cfd9d89-1d7e-4d84-ae1f-a8c5ff126f72", 
                "name": ""
            }
        ]
    }
  • Example response 2
    {
        "l7policies": [
            {
                "redirect_pool_id": "431a03eb-81bb-408e-ae37-7ce19023692b", 
                "redirect_listener_id": null,  
                "description": "", 
                "admin_state_up": true, 
                "rules": [
                    {
                        "id": "67d8a8fa-b0dd-4bd4-a85b-671db19b2ef3"
                    }, 
                    {
                        "id": "f02b3bca-69d2-4335-a3fa-a8054e996213"
                    }
                ], 
                "tenant_id": "a31d2bdcf7604c0faaddb058e1e08819",
                "listener_id": "26058b64-6185-4e06-874e-4bd68b7633d0", 
                "redirect_url": null, 
                "action": "REDIRECT_TO_POOL", 
                "position": 2,
                "provisioning_status": "ACTIVE", 
                "id": "5ae0e1e7-5f0f-47a1-b39f-5d4c428a1586", 
                "name": ""
            }, 
            {
                "redirect_pool_id": "59eebd7b-c68f-4f8a-aa7f-e062e84c0690", 
                "redirect_listener_id": null,  
                "description": "", 
                "admin_state_up": true, 
                "rules": [
                    {
                        "id": "f4499f48-de3d-4efe-926d-926aa4d6aaf5"
                    }
                ], 
                "tenant_id": "a31d2bdcf7604c0faaddb058e1e08819",
     
                "listener_id": "e1310063-00de-4867-ab55-ccac4d9db364", 
                "redirect_url": null, 
                "action": "REDIRECT_TO_POOL", 
                "position": 1, 
                "provisioning_status": "ACTIVE",
                "id": "6cfd9d89-1d7e-4d84-ae1f-a8c5ff126f72", 
                "name": ""
            }
        ]
    }

Status Code

For details, see Status Codes.