Adding a Resource Tag
Function
- A resource can have a maximum of 10 tags.
- This API is idempotent.
- If a to-be-created tag has the same key as an existing tag, the tag will be created and overwrite the existing one.
URI
POST /v3/{project_id}/{resource_type}/{resource_id}/tags
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Specifies the project ID. |
resource_id |
Yes |
String |
Specifies the resource ID. |
resource_type |
Yes |
String |
Specifies the Direct Connect resource type.
Enumeration values:
|
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
tag |
Yes |
Tag object |
Specifies the resource tag. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Specifies the tag key. The key can contain a maximum of 36 Unicode characters, including letters, digits, hyphens (-), and underscores (_). Minimum: 0 Maximum: 36 |
value |
No |
String |
Specifies the tag value. The value can contain a maximum of 43 Unicode characters, including letters, digits, hyphens (-), underscores (_), and periods (.). Minimum: 0 Maximum: 43 |
Response Parameters
None
Example Requests
Adding tags to a resource
POST https://{endpoint}/v3/cfa563efb77d4b6d9960781d82530fd8/dc-vgw/3320166e-b937-40cc-a35c-02cd3f2b3ee2/tags { "tag" : { "key" : "key1", "value" : "value1" } }
Example Responses
None
Status Codes
Status Code |
Description |
---|---|
204 |
No Content |
Error Codes
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