Overview
You can call this API to create multiple tags for the same tag key in the current organization in one call.
API details
Constraints
The caller must have an AccessKey for accessing the multi-cloud API. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.
Request path
POST /api/v2/tags
Request parameters
Query
| Parameter | Type | Required | Description | Example value |
|---|---|---|---|---|
| Action | String | Yes | The API action. Value: CreateIamTags | CreateIamTags |
Body
| Parameter | Type | Required | Description | Example value |
|---|---|---|---|---|
| orgId | String | Yes | The ID of the organization. | ukp31txz9tmk6yqckhoxl356 |
| tagValueList | Array | Yes | The list of tags to be created. | - |
| tagValueList[].tagKey | String | Yes | The tag key. | bxtest-key |
| tagValueList[].tagValue | String | Yes | The tag value. | bxtest-value |
Response parameters
| Parameter | Type | Description | Example value |
|---|---|---|---|
| requestId | String | The ID of the request. | - |
| data | Array | The list of created tags. | - |
| data[].id | Integer | The ID of the tag key. | 217 |
| data[].tagKey | String | The value of the tag key. | bxtest-key |
| data[].tagValueList | Array | The list of values corresponding to the tag key. | - |
| data[].tagValueList[].id | Integer | The ID of the tag value. | 244 |
| data[].tagValueList[].tagKey | String | The tag key. | bxtest-key |
| data[].tagValueList[].tagValue | String | The tag value. | bxtest-value |
| success | Boolean | Indicates whether the call was successful. | true |
Examples
Request example
curl --digest -u 'ak:sk' \
-X POST \
'https://dev-api-cloud-cn.oceanbase.com/api/v2/tags?Action=CreateIamTags' \
-H "Content-Type: application/json" \
-d '{
"orgId": "ukp31txz9tmk6yqckhoxl356",
"tagValueList": [
{
"tagKey": "bxtest-key",
"tagValue": "bxtest-value"
}
]
}'
Response example
JSON format
{
"data": [
{
"id": 217,
"tagKey": "bxtest-key",
"tagValueList": [
{
"id": 244,
"tagKey": "bxtest-key",
"tagValue": "bxtest-value"
}
]
}
],
"requestId": "",
"success": true
}