• Elastic Load Balancing

elb
  1. Help Center
  2. Elastic Load Balancing
  3. API Reference
  4. Enhanced Load Balancer APIs
  5. L7 Policy (Forwarding Policy)
  6. Querying Forwarding Policies

Querying Forwarding Policies

Function

This API is used to query all the forwarding policies. Filter query and pagination query are supported.

URI

GET /v2.0/lbaas/l7policies

Constraints

Parameters marker, limit, and page_reverse are used for pagination query. Parameters marker and page_reverse take effect only when they are used together with parameter limit.

Request

  • Request parameters
    Table 1 Request parameters

    Parameter

    Type

    Mandatory

    Description

    marker

    String

    No

    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

    Int

    No

    Specifies the number of forwarding policies on each page.

    The value ranges from 0 to intmax.

    page_reverse

    Bool

    No

    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

    Uuid

    No

    Specifies the forwarding policy ID.

    tenant_id

    String (255)

    No

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

    name

    String (255)

    No

    Specifies the forwarding policy name.

    admin_state_up

    Bool

    No

    Specifies the administrative status of the forwarding policy.

    The value can be true or false.

    This parameter is reserved and has been not used. The default value is true.

    description

    String (255)

    No

    Provides supplementary information about the forwarding policy.

    listener_id

    Uuid

    No

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

    action

    String

    No

    Specifies the matching action of the forwarding policy.

    The value can be one of the following:

    • REDIRECT_TO_POOL: forwards traffic to the backend server group specified by redirect_pool_id.
    • REDIRECT_TO_LISTENER: redirects traffic from the HTTP listener specified by listener_id to the HTTPS listener specified by redirect_listener_id.

    redirect_pool_id

    Uuid

    No

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

    redirect_listener_id

    Uuid

    No

    Specifies the ID of the listener that forwards the traffic.

    redirect_url

    String (255)

    No

    Specifies the URL to which traffic is redirected.

    This parameter is reserved and has been not used.

    position

    Int

    No

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

    This parameter is reserved and has been not used.

    provisioning_status

    String (16)

    No

    Specifies the provisioning status of the forwarding policy. The value can be ACTIVE, PENDING_CREATE, or ERROR.

    The default value is ACTIVE.

    This parameter is reserved and has been not used.

  • Example request
    GET https://{Endpoint}/v2.0/lbaas/l7policies

Response

  • Response parameters
    Table 2 Parameter description

    Parameter

    Type

    Description

    l7policies

    List

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

    Table 3 l7policy field description

    Parameter

    Type

    Description

    id

    Uuid

    Specifies the forwarding policy ID.

    tenant_id

    String (255)

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

    name

    String (255)

    Specifies the forwarding policy name.

    admin_state_up

    Bool

    Specifies the administrative status of the forwarding policy.

    The value can be true or false.

    This parameter is reserved and has been not used. The default value is true.

    description

    String (255)

    Provides supplementary information about the forwarding policy.

    listener_id

    Uuid

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

    action

    String

    Specifies the matching action of the forwarding policy.

    The value can be one of the following:

    • REDIRECT_TO_POOL: forwards traffic to the backend server group specified by redirect_pool_id.
    • REDIRECT_TO_LISTENER: redirects traffic from the HTTP listener specified by listener_id to the HTTPS listener specified by redirect_listener_id.

    redirect_pool_id

    Uuid

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

    redirect_listener_id

    Uuid

    Specifies the ID of the listener that forwards the traffic.

    redirect_url

    String (255)

    Specifies the URL to which traffic is redirected.

    This parameter is reserved and has been not used.

    rules

    List

    Lists the forwarding rules associated with the forwarding policy.

    position

    Int

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

    This parameter is reserved and has been not used.

    provisioning_status

    String (16)

    Specifies the provisioning status of the forwarding policy. The value can be ACTIVE, PENDING_CREATE, or ERROR.

    NOTE:

    This field has no actual meaning. The default value is ACTIVE.

    l7policies_links

    List

    Provides links to the previous or next page during pagination query, respectively.

    This parameter exists only in the response body of pagination query.

    For details, see Table 4.

    Table 4 l7policies_links field description

    Parameter

    Type

    Description

    href

    string

    Provides links to the previous or next page during pagination query, respectively.

    rel

    String (255)

    Specifies the prompt of the previous or next page.

    The value can be next or previous. The value next indicates the href containing the URL of the next page, and previous indicates the href containing the URL of the previous page.

  • Example response
    {
        "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": ""
            }
        ]
    }

Response Codes

For details, see HTTP Status Codes for Enhanced Load Balancers.