Adding Tags to a Resource
Function
This API is used to add tags to a resource.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
ga:tag:create
Tagging
accelerator
g:ResourceTag/<tag-key>
-
-
listener
g:ResourceTag/<tag-key>
-
-
g:RequestTag/<tag-key>
-
g:TagKeys
-
URI
POST /v1/{resource_type}/{resource_id}/tags/create
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
resource_type |
Yes |
Object |
Resource type. Value range:
|
|
resource_id |
Yes |
String |
Specifies the resource ID. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Specifies the user token. The token can be obtained by calling the IAM API. The value of X-Subject-Token in the response header is the user token. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
tags |
Yes |
Array of ResourceTag objects |
Specifies the tags. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
key |
Yes |
String |
The tag key.
|
|
value |
Yes |
String |
The tag value.
|
Response Parameters
Status code: 204
|
Parameter |
Type |
Description |
|---|---|---|
|
request_id |
String |
Specifies the request ID. |
Example Requests
Adding tags to a resource
POST https://{ga_endpoint}/v1/{resource_type}/{resource_id}/tags/create
{
"tags" : [ {
"key" : "tagKey",
"value" : "tagValue"
} ]
}
Example Responses
Status code: 204
Operation succeeded.
{
"request_id" : "915a14a6-867b-4af7-83d1-70efceb146f9"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
204 |
Operation succeeded. |
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