Help Center/ Distributed Message Service for RocketMQ/ API Reference/ APIs V2 (Recommended)/ Metadata Migration/ Querying All Migration Tasks or a Specified Migration Task of an Instance
Updated on 2025-12-18 GMT+08:00

Querying All Migration Tasks or a Specified Migration Task of an Instance

Function

This API is used to query all migration tasks or a specified migration task of an instance.

URI

GET /v2/{project_id}/instances/{instance_id}/metadata

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain it, see Obtaining a Project ID.

instance_id

Yes

String

Instance ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

id

No

String

Task ID.

type

No

String

Definition

Query type.

Constraints

N/A

Range

  • vhost: virtual host

  • exchange

  • queue

  • all

Default Value

N/A

offset

No

Integer

Current page number, which starts from 1.

limit

No

Integer

Current page size.

name

No

String

  • When the vhost list is queried, this field can be left empty.

  • When the exchange list is queried, set this field to the name of the vhost to which the exchange belongs.

  • When the queue list is queried, set this field to vhost of the queue's exchange-queue's exchange, for example, vhost1-exchange1.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

total

Integer

Total number of metadata migration tasks.

task

Array of MetadataTask objects

List of metadata migration tasks.

Table 4 MetadataTask

Parameter

Type

Description

id

String

ID of a metadata migration task.

name

String

Name of a metadata migration task.

start_date

String

Start time of a metadata migration task.

status

String

Definition

Status of a metadata migration task.

Range

  • creating

  • starting: The migration is in progress.

  • failed

  • finished

type

String

Definition

Metadata migration type.

Range

  • rocketmq: from RocketMQ to RocketMQ.

  • rabbitToRocket: from RabbitMQ to RocketMQ.

Example Requests

Querying all migration tasks of a RocketMQ instance

GET https://{endpoint}/v2/{project_id}/instances/{instance_id}/metadata

Example Responses

Status code: 200

Returned status code.

{
  "total" : 1,
  "task" : [ {
    "id" : "6cf4dcd3-8471-4139-8b5b-8a3a71f704c7",
    "name" : "task-932331847",
    "start_date" : "2023-03-13 19:43:32.12",
    "status" : "finished",
    "type" : "rabbitToRocket"
  } ]
}

Status Codes

Status Code

Description

200

Returned status code.

Error Codes

See Error Codes.