You can call this operation to create or modify the IP whitelist and security groups of a specified Apsara PolarDB cluster.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. You can use OpenAPI Explorer to search for APIs, call APIs, and dynamically generate SDK example code.

Request parameters

Parameter Type Required Example Description
Action String No ModifyDBClusterAccessWhitelist

The operation that you want to perform. Set the value to ModifyDBClusterAccessWhitelist.

DBClusterId String Yes pc-xxxxxxxxx

The ID of the Apsara PolarDB cluster.

WhiteListType String No IP

The type of the whitelist. Valid values:

  • IP: IP whitelist
  • SecurityGroup: security group

Default value: IP.

DBClusterIPArrayName String No default

The name of the IP whitelist. It must be 2 to 120 characters in length and can contain lowercase letters and digits. It must start with a letter, and end with a letter or digit.

  • This operation creates a whitelist if the whitelist with the specified name does not exist.
  • This operation modifies a whitelist if the whitelist with the specified name already exists.
  • If you do not specify this parameter, the default whitelist is modified.
Note
  • You can create up to 50 IP whitelists for an Apsara PolarDB cluster.
  • This parameter takes effect only when WhiteListType is set to IP.
DBClusterIPArrayAttribute String No hidden

The attribute of the IP whitelist. Set this parameter to hidden to hide the IP whitelists in the console.

Note
  • IP whitelists displayed in the console cannot be hidden.
  • This parameter takes effect only when WhiteListType is set to IP.
SecurityIps String No 127.0.0.1

The IP addresses or CIDR blocks in the IP whitelist. Each IP whitelist can contain a maximum of 1,000 IP addresses or CIDR blocks. Separate multiple addresses with commas (,). The following two formats are supported

  • Standard IP address format, such as 10.23.12.24.
  • Standard CIDR block format, such as 10.23.12.24/24. The value 24 indicates that the prefix of the CIDR block is 24 bits in length. You can replace 24 with a value from 1 to 32.
Note This parameter takes effect only when WhiteListType is set to IP.
ModifyMode String No Cover

The method for modifying the IP whitelist. Valid values:

  • Cover: overwrites the IP whitelist.(recommended) .
  • Append: adds one or more IP addresses.
  • Delete: deletes one or more IP addresses.
Note The parameter takes effect only when WhiteListType is set to IP.
SecurityGroupIds String No sg-xxxxxxxxx

The ID of the security group. Separate multiple security groups with commas (,).

Note
  • You can add up to three security groups to a cluster.
  • The parameter takes effect only when WhiteListType is set to SecurityGroup.

Response parameters

Parameter Type Example Description
RequestId String D0CEC6AC-7760-409A-A0D5-E6CD8660E9CC

The ID of the request.

Example

Sample requests

http(s)://[Endpoint]/? Action=ModifyDBClusterAccessWhitelist
&DBClusterId=pc-xxxxxxxxx
&<Common request parameters>

Sample success responses

XML format

<ModifyDBClusterAccessWhitelistResponse>  
      <RequestId>D0CEC6AC-7760-409A-A0D5-E6CD8660E9CC</RequestId>
</ModifyDBClusterAccessWhitelistResponse>

JSON format

{
  "RequestId": "D0CEC6AC-7760-409A-A0D5-E6CD8660E9CC"
}

Error codes

For a list of error codes, visit the API Error Center.