Updated on 2024-03-27 GMT+08:00

Querying Tags of a Specified Project

Function

This API is used to query the tags of all resources owned by a tenant in a specified project.

URI

GET /v5/{project_id}/{resource_type}/tags

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

For details, see Obtaining a Project ID.

resource_type

Yes

String

Resource type.

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

Enumerated values:

  • migration
  • sync
  • cloudDataGuard
  • subscription
  • backupMigration
  • replay

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

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.

The default value is application/json.

X-Auth-Token

Yes

String

User token obtained from IAM. It is a response to the API for obtaining a user token. After a request is processed, the value of X-Subject-Token in the header is the token value.

X-Language

No

String

Request language type.

Default value: en-us

Enumerated values:

  • en-us
  • zh-cn

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

tags

Array of objects

Tag list.

For details, see Table 4.

Table 4 Data structure description of field tags

Parameter

Type

Description

key

String

Tag key.

values

Array of strings

Tag value.

Example Request

Querying all tags of a real-time synchronization task

 https://{endpoint}/v5/246765b9f59445c3919fce121ea801f4/sync/tags

Example Response

Status code: 200

OK

{
  "tags" : [ {
    "key" : "key1",
    "values" : [ "value1", "value2" ]
  }, {
    "key" : "key2",
    "values" : [ "value1", "value2" ]
  } ]
}

Status Code

Status Code

Description

200

OK

Error Code

For details, see Error Code.