Updated on 2023-08-29 GMT+08:00

Creating a Metadata Migration Task

Function

This API is used to create a metadata migration task.

URI

POST /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

overwrite

Yes

String

true: Configurations in the metadata file with the same name as the uploaded file will be overwritten. false: An error is reported when a topic or group already exists.

name

Yes

String

Migration task name. For details about the naming rules, see the API for creating an instance.

type

Yes

String

Migration task type. The value can be rocketmq or rabbitToRocket.

Request Parameters

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

CreateRocketMqMigrationTaskRequestBody

Yes

String

Metadata JSON file.

Response Parameters

None

Example Requests

Creating a metadata migration task

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

{
  "rabbit_version" : "3.8.35",
  "rabbitmq_version" : "3.8.35",
  "product_name" : "RabbitMQ",
  "product_version" : "3.8.35",
  "users" : [ {
    "name" : "root",
    "password_hash" : "password_hash",
    "hashing_algorithm" : "rabbit_password_hashing_sha256",
    "tags" : "administrator",
    "limits" : { }
  } ],
  "vhosts" : [ {
    "name" : "DeleteVhost123"
  } ],
  "permissions" : [ {
    "name" : "root",
    "vhost" : "DeleteVhost123",
    "configure" : ".*",
    "write" : ".*",
    "read" : ".*"
  } ],
  "topic_permissions" : [ ],
  "parameters" : [ ],
  "global_parameters" : [ {
    "name" : "internal_cluster_id",
    "value" : "rabbitmq-cluster-id-123"
  } ],
  "policies" : [ ],
  "queues" : [ {
    "name" : "test-001",
    "vhost" : "/",
    "durable" : false,
    "auto_delete" : false,
    "arguments" : { }
  } ],
  "exchanges" : [ {
    "name" : "direct",
    "vhost" : "/",
    "durable" : false,
    "auto_delete" : false,
    "internal" : false,
    "arguments" : { }
  } ],
  "bindings" : [ {
    "source" : "direct",
    "vhost" : "/",
    "destination" : "test-001",
    "destination_type" : "queue",
    "routing_key" : "test-001",
    "arguments" : { }
  } ]
}

Example Responses

Status code: 200

Status code.

6cf4dcd3-8471-4139-8b5b-8a3a71f704c7

Status Codes

Status Code

Description

200

Status code.

Error Codes

See Error Codes.