Adding a Tag to a Specific Resource
Function
This API is used to add a tag to a specific 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
dns:tag:set
Tagging
zone
g:ResourceTag/<tag-key>
-
-
ptr
g:ResourceTag/<tag-key>
URI
POST /v2/{project_id}/{resource_type}/{resource_id}/tags
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID |
|
resource_type |
Yes |
String |
Resource type. The value can be DNS-public_zone, DNS-private_zone, DNS-public_recordset, DNS-private_recordset, or DNS-ptr_record. |
|
resource_id |
Yes |
String |
Resource ID |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition The user token. The token can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token. For details about how to obtain a user token, seeObtaining a User Token. Constraints N/A Range N/A Default Value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
tag |
Yes |
tag object |
Resource tag. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
key |
Yes |
String |
Definition The tag key. Range
|
|
value |
No |
String |
Definition The tag value. Range
|
Response Parameters
Status code: 204
Response to the request for adding a tag to a resource
None
Example Requests
Adding a tag to a specified resource
POST https://{endpoint}/v2/{project_id}/{resource_type}/{resource_id}/tags
{
"tag" : {
"key" : "key1",
"value" : "value1"
}
}
Example Responses
None
Status Codes
|
Status Code |
Description |
|---|---|
|
204 |
Response to the request for adding a tag to a resource |
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.