Overview
You can call this API to create a security IP group.
API details
Constraints
The caller must have an AccessKey for accessing APIs of multiple clouds. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.
Request path
POST /api/v2/instances/{instanceId}/securityIpGroups
Request parameters
Path
| Parameter | Type | Required | Description | Example value |
|---|---|---|---|---|
| instanceId | String | Yes | The ID of the instance. | obxxx |
Body
| Parameter | Type | Required | Description | Example value |
|---|---|---|---|---|
| securityIpGroupName | String | Yes | The name of the IP security allowlist group. | all |
| securityIps | String | Yes | The IP addresses or CIDR blocks in the IP allowlist group. The value is a JSON array string. Each object in the array is an IP address or CIDR block.
|
["192.168.0.0/20", "192.169.1.1"] |
Response parameters
| Parameter | Type | Description | Example value | |
|---|---|---|---|---|
| data | object | The return result. | ||
| instanceId | String | The ID of the instance. | obxxx | |
| securityIpGroupName | String | The name of the IP security allowlist group. | all | |
| securityIps | String | The IP security allowlist, in the JSON array string format. | ["127.0.0.1"] | |
| requestId | String | The ID of the request. | 5955b710-cb29-4056-81b4-0832b048e0c4 | |
| success | Boolean | Indicates whether the request was successful. | true | 1 |
Examples
Request example
curl --digest -u 'ak:sk' \
--request POST \
https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/securityIpGroups \
--data '{
"securityIpGroupName":"all",
"securityIps": "[\"127.0.0.1\"]"
}'
Response example
JSON format
{
"data":{
"instanceId":"obxxx",
"securityIpGroupName":"all",
"securityIps":"[\"127.0.0.1\"]"
},
"requestId":"5955b710-cb29-4056-81b4-0832b048e0c4",
"success":true
}
Differences from public cloud
The securityIps parameter is a JSON array string. Note that you must escape the characters.