Querying Tags of a Task
Function
This API is used to query tags of a specified task.
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 and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, no identity policy-based permissions are required for calling this API.
URI
GET /v5/{project_id}/{resource_type}/{resource_id}/tags
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID of a tenant in a region. For details about how to obtain the project ID, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
| resource_type | Yes | String | Definition DRS resource type, which is used to specify the service type of the resource whose tags are to be queried. Different resource types correspond to different DRS task types. When querying tags, enter a value based on the actual task type. Constraints N/A Range
Default Value N/A |
| resource_id | Yes | String | Definition Resource ID, which uniquely identifies a DRS task. This parameter is used to locate the specific task whose tags are to be queried in the tag management API. Constraints N/A Range N/A Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | Yes | String | Definition MIME type of the request body. Use the default value application/json. For APIs used to upload objects or images, the value varies depending on the flow type. Constraints N/A Range application/json Default Value application/json |
| X-Auth-Token | Yes | String | Definition User token obtained from IAM. It is a response to the API for obtaining a user token. This API is the only one that does not require authentication. The token is the value of X-Subject-Token in the response header. Constraints N/A Range N/A Default Value N/A |
| X-Language | No | String | Definition Request language type. Constraints N/A Range
Default Value en-us |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| tags | Array of objects | Definition Resource tag list, which includes key-value pairs of all tags of the instance. For details, see Table 4. Constraints N/A Range N/A |
| Parameter | Type | Description |
|---|---|---|
| key | String | Definition Tag key. Constraints
Range N/A |
| value | String | Definition Tag value. This parameter is optional for deleting a tag. Constraints
Range N/A |
Example Request
Querying tags of a real-time synchronization task
https://{endpoint}/v5/246765b9f59445c3919fce121ea801f4/jobs/sync/e6842695-3ade-4937-827b-ff92776jb20a/tags Example Response
Status code: 200
OK
{
"tags" : [ {
"key" : "key1",
"value" : "value1"
}, {
"key" : "key2",
"value" : "value3"
} ]
} Error Code
For details, see Error Code.
What is your overall rating for this page?
Thank 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