Overview
You can call this API to create a security IP group for an instance.
API details
Constraints
The caller must have an AccessKey for accessing APIs. 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 OceanBase cluster. | obcluster-***** |
Query
| Parameter | Type | Required | Description | Example Value |
|---|---|---|---|---|
| requestId | String | Yes | The request ID, which is used for tracing. | dc302d76-66b5-48d8-ab53-a035******** |
Body
| Parameter | Type | Required | Description | Example Value |
|---|---|---|---|---|
| securityIpGroupName | String | Yes | The name of the security IP group. | all |
| securityIps | String | Yes | The IP addresses or CIDR blocks in the security IP group. It is a JSON array. 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 returned result. | ||
| instanceId | String | The ID of the instance. | obxxx | |
| securityIpGroupName | String | The name of the security IP group. | all | |
| securityIps | String | The list of security IP addresses, in the JSON array format. | ["127.0.0.1"] | |
| requestId | String | The request ID. | 5955b710-cb29-4056-81b4-0832b048e0c4 | |
| success | Boolean | Indicates whether the call is successful. | true | 1 |
Examples
Request example
curl --digest -u '<Your ak:sk>' \
--request POST \
https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/securityIpGroups?requestId={requestId} \
--header 'Content-Type: application/json' \
--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 the public cloud
The securityIps parameter is a string in the JSON array format. Make sure to escape the characters.
