Updated on 2026-05-30 GMT+08:00

Importing Schema Metadata (a V3 API)

Function

This API is used to import distribution information of physical shards in all schemas and use it to create schemas that contain the same physical shards and distribution relationship.

URI

POST /v3/{project_id}/instances/{instance_id}/schema-metadata

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region

To obtain this value, see Obtaining a Project ID.

instance_id

Yes

String

DDM instance ID

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

compressed_databases_info

Yes

String

Distribution information of physical shards in a schema. This information is compressed and encoded. For details about how to obtain the information, see Exporting Schema Metadata (a V3 API).

dn_instance

Yes

Array of DNInstance objects

Information about associated backend data nodes

Table 4 DNInstance

Parameter

Mandatory

Type

Description

dn_instance_id

Yes

String

ID of the backend data node

admin_user

Yes

String

Account for logging in to the backend data node

admin_password

Yes

String

Password of the account for logging in to the backend data node

Response Parameters

Status code: 202

Table 5 Response body parameters

Parameter

Type

Description

instance_id

String

Instance ID

instance_name

String

Instance name

job_id

String

Job ID

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error message

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error message

Example Request

POST https://{endpoint}/v3/619d3e78f61b4be68bc5aa0b59edcf7b/instances/1f5c9fd6cd984056ba89c8c87cc03278in09/schema-metadata 
{
  "compressed_databases_info" : "H4sIAAAAAAAAAN3cTW/bRhgE4P/Csw7aL4rUtQUKX3wo0lMQCPxYNQJsOjApIIWR/17K1RvDPgQ9...",
  "dn_instance" : [ {
    "dn_instance_id" : "91b1272b09364ddeb999f1295bf0506ain01",
    "admin_user" : "root",
    "admin_password" : "xxxxxxx"
  } ]
}

Example Response

Status code: 202

{
  "job_id":"441d5677-b76a-4dd4-a97a",
  "instance_id":"91b1272b09364ddeb999f1295bf0506ain09",
  "instance_name":"ddm-test-01"
}

Status code: 400

Bad request

{
  "error_msg" : "Parameter error.",
  "error_code" : "DBS.280001"
}

Status code: 500

Server error

{
  "error_msg" : "Parameter error.",
  "error_code" : "DBS.280001"
}

Status Codes

Status Codes

Description

202

OK

400

Bad request

500

Server error

Error Codes

For details, see Error Codes.