Adding or Deleting Resource Tags in Batches
Function
This API is used to add tags to or delete tags from a specified DB instance in batches.
Constraints
This API supports the following types of instances:
- GeminiDB Cassandra
- GeminiDB Mongo
- GeminiDB Influx
- GeminiDB Redis
A maximum of 20 tags can be added to an instance. The tag key must be unique.
If the request body contains duplicated keys, an error message will be reported when the API is called.
If the key in the request body is the same as an existing key in a specified instance, the value of the value parameter that corresponds to the existing key is overwritten.
If the tag to be deleted does not exist, the system deems the deletion operation successful by default but does not check whether the tag key and value meets character set rules.
URI
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/tags/action
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID of a tenant in a region. To obtain this value, see Obtaining a Project ID. |
instance_id |
Yes |
String |
Instance ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
action |
Yes |
String |
Operation identifier. The value can be:
|
tags |
Yes |
Array of BatchTagActionTagOption objects |
All tags. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Tag key. It can contain a maximum of 128 Unicode characters. The key value cannot be null, an empty string, or spaces. Before using key, delete spaces before and after the value. It is case-sensitive and can contain digits, letters, underscores (_), and hyphens (-). |
value |
No |
String |
Tag value. The tag value can contain a maximum of 255 Unicode characters and can be an empty string. It is case-sensitive and can contain digits, letters, underscores (_), periods (.), and hyphens (-).
NOTE:
If value is specified, tags are deleted by key and value. If value is not specified, tags are deleted by key. |
Response Parameters
Status code: 200
No response parameters
Example Requests
- URI example
POST https://gaussdb-nosql.ap-southeast-1.myhuaweicloud.com/v3/375d8d8fad1f43039e23d3b6c0f60a19/instances/9136fd2a9fcd405ea4674276ce36dae8in02/tags/action
- Adding two tags
{ "action" : "create", "tags" : [ { "key" : "key1", "value" : "value1" }, { "key" : "key2", "value" : "value2" } ] }
- Deleting two tags
{ "action" : "delete", "tags" : [ { "key" : "key1" }, { "key" : "key2", "value" : "value3" } ] }
Example Responses
Status code: 200
Success
{ }
Status Codes
For details, see Status Codes.
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot