Updated on 2026-09-07 GMT+08:00

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

Table 1 URI parameters

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

  • migration: real-time migration
  • sync: real-time synchronization
  • cloudDataGuard: real-time disaster recovery
  • subscription: data subscription
  • backupMigration: backup migration
  • replay: workload replay

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

Table 2 Request header 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

  • en-us: English
  • zh-cn: Chinese

Default Value

en-us

Response Parameters

Status code: 200

Table 3 Response body parameters

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

Table 4 Data structure description of field tags

Parameter

Type

Description

key

String

Definition

Tag key.

Constraints

  • It must consist of 1 to 128 Unicode characters.
  • It can contain letters, digits, spaces, and special characters _.:=+-@. However, it cannot start or end with a space, or start with _sys_.

Range

N/A

value

String

Definition

Tag value. This parameter is optional for deleting a tag.

Constraints

  • Each tag value can contain a maximum of 255 Unicode characters.
  • It can contain letters, digits, spaces, and special characters _.:=+-@

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"
  } ]
}

Status Code

Status Code

Description

200

OK

For other statuses, see Status Code.

Error Code

For details, see Error Code.