Adding Tags to the Specified Resource
Function
This API is used to add tags to the specified resource.
Authorization Information
Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
URI
POST /v5/{resource_type}/{resource_id}/tags/create
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| resource_type | Yes | String | Definition: Resource type. Range: |
| resource_id | Yes | String | Definition: Unique identifier of a resource. You can call the ListFindings API to retrieve the analysis finding list generated by a specified analyzer. The response of this API contains an analysis result list. Each analysis result object in the list contains information about the analyzed resource. The resource field is the unique identifier (resource ID) of the resource. Range: 1 to 36 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| tags | Yes | Array of Tag objects | Definition: List of custom tags. Constraints: N/A Range: Array length: 1 to 20. Default Value: N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| key | Yes | String | Definition: Tag key. Constraints: Cannot start with sys and cannot start or end with a space. Range: 1 to 128 characters. The value can contain Unicode letters, digits, spaces, and the following special characters: _.:=+-@. Default Value: N/A |
| value | Yes | String | Definition: String value associated with the tag key. Constraints: N/A Range: 0 to 255 characters. The value can contain Unicode letters, digits, spaces, and the following special characters: _.:/=+-@. Default Value: N/A |
Response Parameters
Status code: 200
OK
None
Example Requests
Adding a tag to the specified resource
POST https://{hostname}/v5/{resource_type}/{resource_id}/tags/create
{
"tags" : [ {
"key" : "key-1",
"value" : "value-1"
} ]
} Example Responses
None
Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
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