• Elastic Load Balancing

elb
  1. Help Center
  2. Elastic Load Balancing
  3. API Reference
  4. Enhanced Load Balancer APIs
  5. Whitelist
  6. Adding a Whitelist

Adding a Whitelist

Function

This API is used to add a whitelist.

URI

POST /v2.0/lbaas/whitelists

Constraints

None

Request

  • Request parameters
    Table 1 Parameter description

    Parameter

    Type

    Mandatory

    Description

    whitelist

    Dict

    Yes

    Specifies the whitelist.

    Table 2 whitelist field description

    Parameter

    Type

    Mandatory

    Description

    tenant_id

    String (255)

    No

    Specifies the project ID.

    listener_id

    uuid-str

    Yes

    Specifies the listener ID. Only one whitelist can be created for a listener.

    enable_whitelist

    Bool

    No

    Specifies whether to enable access control.

    whitelist

    String

    No

    Lists the IP addresses in the whitelist.

  • Example request
    POST/v2.0/lbaas/whitelists 
    { 
        "whitelist": { 
            "listener_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" 
        } 
    }

Response

  • Response parameters
    Table 3 Parameter description

    Parameter

    Type

    Description

    whitelist

    Dict

    Specifies the whitelist.

    Table 4 whitelist field description

    Parameter

    Type

    Description

    id

    uuid-str

    Specifies the whitelist ID.

    tenant_id

    String (255)

    Specifies the project ID.

    listener_id

    uuid-str

    Specifies the listener ID.

    enable_whitelist

    Bool

    Specifies whether to enable access control.

    whitelist

    String

    Lists the IP addresses in the whitelist.

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

Return Codes

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