You can call the ModifySecurityIps operation to modify an IP address whitelist of an ApsaraDB RDS instance.

An IP address whitelist contains the IP addresses of the devices that are granted access to the instance. For more information, see Configure an IP address whitelist for an ApsaraDB RDS for MySQL instance.

Note Before you call this operation, make sure that the instance is in the Running state.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ModifySecurityIps

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

DBInstanceId String Yes rm-uf6wjk5xxxxxxx

The ID of the instance.

SecurityIps String Yes 10.23.12.24

The IP address whitelist that you want to modify for the instance. If the IP address whitelist contains more than one entry, separate these entries with commas (,). Each entry in the IP address whitelist must be unique. For more information, see Configure an IP address whitelist for an ApsaraDB RDS for MySQL instance. The following two formats are supported:

  • IP addresses, such as 10.23.12.24.
  • Classless Inter-Domain Routing (CIDR) blocks, such as 10.23.12.0/24. In this case, 24 indicates that the prefix of each IP address is 24-bit long. You can replace 24 with a value within the range of 1 to 32.
Note A maximum of 1,000 IP addresses and CIDR blocks can be configured for each instance. If you want to add a large number of IP addresses, we recommend that you merge these IP addresses into CIDR blocks, such as 10.23.12.0/24.
DBInstanceIPArrayName String No test

The name of the IP address whitelist. Default value: Default.

Note A maximum of 200 IP address whitelists can be configured for each instance.
DBInstanceIPArrayAttribute String No hidden

The attribute of the IP address whitelist. By default, this parameter is empty.

Note The IP address whitelists that have the hidden attribute are not displayed in the ApsaraDB RDS console. These IP address whitelists are used to access Alibaba Cloud services, such as Data Transmission Service (DTS).
SecurityIPType String No IPv4

The type of IP address in the IP address whitelist.

WhitelistNetworkType String No Classic

The network type of the IP address whitelist. Valid values:

  • Classic: classic network in enhanced whitelist mode
  • VPC: virtual private cloud (VPC) in enhanced whitelist mode
  • MIX: standard whitelist mode

Default value: MIX.

Note In standard whitelist mode, IP addresses and CIDR blocks can be added only to the default IP address whitelist. In enhanced whitelist mode, IP addresses and CIDR blocks can be added to both IP address whitelists of the classic network type and those of the VPC network type.
ModifyMode String No Cover

The method that is used to modify the IP address whitelist. Valid values:

  • Cover: Use the value of the SecurityIps parameter to overwrite the existing entries in the IP address whitelist.
  • Append: Add the IP addresses and CIDR blocks that are specified in the SecurityIps parameter to the IP address whitelist.
  • Delete: Delete IP addresses and CIDR blocks that are specified in the SecurityIps parameter from the IP address whitelist. You must retain at least one IP address or CIDR block.

Default value: Cover.

Response parameters

Parameter Type Example Description
RequestId String 1AD222E9-E606-4A42-BF6D-8A4442913CEF

The ID of the request.

TaskId String 115855279

The ID of the task.

Examples

Sample requests

http(s)://rds.aliyuncs.com/?Action=ModifySecurityIps
&DBInstanceId=rm-uf6wjk5xxxxxxx
&SecurityIps=10.23.12.24
&<Common request parameters>

Sample success responses

XML format

<ModifySecurityIpsResponse>
	  <RequestId> 1AD222E9-E606-4A42-BF6D-8A4442913CEF</RequestId>
	  <TaskId>115855279</TaskId>
</ModifySecurityIpsResponse>

JSON format

{
    "RequestId": " 1AD222E9-E606-4A42-BF6D-8A4442913CEF",
    "TaskId": 115855279
}

Error codes

HTTP status code Error code Error message Description
400 InvalidIPArrayAttribute.Format The format of the IP attribute is invalid. The error message returned because the attribute of the IP address whitelist is in an invalid format.

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