• Elastic Load Balancing

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

Modifying a Whitelist

Function

This API is used to update a whitelist. You can enable or disable the whitelist function or update IP addresses in the whitelist.

URI

PUT /v2.0/lbaas/whitelists/{whitelist_id}

Table 1 Parameter description

Parameter

Type

Mandatory

Description

whitelist_id

Uuid

Yes

Specifies the whitelist ID.

Request

  • Request parameters
    Table 2 Parameter description

    Parameter

    Type

    Mandatory

    Description

    whitelist

    Dict

    Yes

    Specifies the whitelist. For details, see Table 3.

    Table 3 whitelist field description

    Parameter

    Type

    Mandatory

    Description

    enable_whitelist

    Bool

    No

    Specifies whether to enable access control.

    true: Access control is enabled.

    false: Access control is disabled.

    The default value is true.

    whitelist

    String

    No

    Specifies the IP addresses in the whitelist. Use commas (,) to separate the multiple IP addresses.

    You can specify an IP address, for example, 192.168.11.1.

    You can also specify a network segment, for example, 192.168.0.1/24.

    The default value is an empty string.

  • Example request
    PUT https://{Endpoint}/v2.0/lbaas/whitelists/dcaf46f1-037c-4f63-a31f-e0c4c18032c7 
    
    { 
        "whitelist": { 
            "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 4 Parameter description

    Parameter

    Type

    Description

    whitelist

    Dict

    Specifies the whitelist. For details, see Table 5.

    Table 5 whitelist field description

    Parameter

    Type

    Description

    id

    Uuid

    Specifies the whitelist ID.

    tenant_id

    String (255)

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

    listener_id

    Uuid

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

    enable_whitelist

    Bool

    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 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" 
        } 
    }

Response Codes

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