Overview
You can call this API to modify the IP allowlist of an instance. The IP allowlist includes the name and IP list of the IP allowlist group. The modified configuration may take some time to take effect.
API details
Constraints
The caller must have an AccessKey for accessing APIs of OceanBase Cloud. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.
Request path
PUT /api/v2/instances/{instanceId}/securityIpGroups
Request parameters
Path
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| instanceId | String | Yes | The ID of the instance. | obcluster-***** |
Query
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| requestId | String | Yes | The request ID, which is used for tracing. | dc302d76-66b5-48d8-ab53-a035******** |
Body
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| instanceId | String | Yes | The ID of the instance. | obcluster-***** |
| securityIps | String | Yes | The IP allowlist. It is a JSON array. Each object in the array is an IP address or an IP segment. The maximum number of objects is 40. | ["192.168.0.0/20", "192.169.1.1"] |
| securityIpGroupName | String | Yes | The name of the IP allowlist group. The name must be 2 to 32 characters in length, start with a lowercase letter, and end with a lowercase letter or a digit. It can contain only lowercase letters, digits, and underscores. | all |
Response parameters
| Name | Type | Description | Example value |
|---|---|---|---|
| data | object | The return result of the request. | See the following table. |
| instanceId | String | The ID of the instance. | obcluster-***** |
| securityIpGroupName | String | The name of the IP allowlist group. | all |
| securityIps | String | The IP allowlist. | ["127.0.0.1"] |
| requestId | String | The request ID. | 5955b710-cb29-4056-81b4-0832b048e0c4 |
| success | Boolean | Indicates whether the request was successful. | true |
Examples
Request example
curl --digest -u '<Your AccessKey ID:AccessKey secret>' \
-X PUT \
'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/securityIpGroups?requestId={requestId}' \
-H 'Content-Type: application/json' \
-d '{
"instanceId": "obcluster-*****",
"securityIpGroupName": "all",
"securityIps": "[\"192.168.0.0/20\", \"192.169.1.1\"]"
}'
Response example
JSON format
{
"data": {
"instanceId": "obcluster-*****",
"securityIpGroupName": "all",
"securityIps": "[\"192.168.0.0/20\", \"192.169.1.1\"]"
},
"requestId": "5955b710-cb29-4056-81b4-0832b048e0c4",
"success": true
}
