Updated on 2023-12-18 GMT+08:00

Querying Whitelists

Function

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

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.

URI

GET /v2/{project_id}/elb/whitelists

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 whitelist from which pagination query starts, that is, the ID of the last whitelist on the previous page.

This parameter must be used with limit.

limit

No

Integer

Specifies the number of whitelists on each page. If this parameter is not set, all whitelists 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 with limit.

id

No

String

Specifies the whitelist ID.

tenant_id

No

String

Specifies the ID of the project where the whitelist is used.

The value contains a maximum of 255 characters.

listener_id

No

String

Specifies the ID of the listener to which the whitelist is added.

enable_whitelist

No

Boolean

Specifies whether to enable access control.

true: Access control is enabled.

false: Access control is disabled.

whitelist

No

String

Specifies the IP addresses in the whitelist.

Request

None

Response

Table 3 Parameter description

Parameter

Type

Description

whitelists

Array of Whitelists objects

Specifies the whitelist. For details, see Table 4.

Table 4 whitelists parameter description

Parameter

Type

Description

id

String

Specifies the whitelist ID.

tenant_id

String

Specifies the ID of the project where the whitelist is used.

The value contains a maximum of 255 characters.

listener_id

String

Specifies the ID of the listener to which the whitelist is added.

enable_whitelist

Boolean

Specifies whether to enable access control.

true: Access control is enabled.

false: Access control is disabled.

whitelist

String

Specifies the IP addresses in the whitelist.

Example Request

  • Example request 1: Querying all whitelists
    GET https://{Endpoint}/v2/eabfefa3fd1740a88a47ad98e132d238/elb/whitelists
  • Example request 2: Querying the whitelists added to listener eabfefa3fd1740a88a47ad98e132d230
    GET https://{Endpoint}/v2/eabfefa3fd1740a88a47ad98e132d238/elb/whitelists?listener_id=eabfefa3fd1740a88a47ad98e132d230

Example Response

  • Example response 1
    { 
        "whitelists": [ 
            { 
                "id": "eabfefa3fd1740a88a47ad98e132d238",  
                "listener_id": "eabfefa3fd1740a88a47ad98e132d238",  
                "tenant_id": "eabfefa3fd1740a88a47ad98e132d238",  
                "enable_whitelist": true,  
                "whitelist": "192.168.11.1,192.168.0.1/24,192.168.201.18/8,100.164.0.1/24" 
            },  
            { 
                "id": "eabfefa3fd1740a88a47ad98e132d326",  
                "listener_id": "eabfefa3fd1740a88a47ad98e132d327",  
                "tenant_id": "eabfefa3fd1740a88a47ad98e132d436",  
                "enable_whitelist": true,  
                "whitelist": "192.168.12.1,192.168.1.1/24,192.168.203.18/8,100.164.5.1/24" 
            } 
        ] 
    }
  • Example response 2
    { 
        "whitelists": [ 
            { 
                "id": "eabfefa3fd1740a88a47ad98e132d238",  
                "listener_id": "eabfefa3fd1740a88a47ad98e132d230",  
                "tenant_id": "eabfefa3fd1740a88a47ad98e132d239",  
                "enable_whitelist": true,  
                "whitelist": "192.168.11.1,192.168.0.1/24,192.168.201.18/8,100.164.0.1/24" 
            },  
            { 
                "id": "eabfefa3fd1740a88a47ad98e132d326",  
                "listener_id": "eabfefa3fd1740a88a47ad98e132d327",  
                "tenant_id": "eabfefa3fd1740a88a47ad98e132d439",  
                "enable_whitelist": true,  
                "whitelist": "192.168.12.1,192.168.1.1/24,192.168.203.18/8,100.164.5.1/24" 
            } 
        ] 
    }

Status Code

For details, see Status Codes.