Reviewed-by: Gladkov, Maksim <mgladkov@noreply.gitea.eco.tsi-dev.otc-service.com> Co-authored-by: wangdengke2 <wangdengke2@huawei.com> Co-committed-by: wangdengke2 <wangdengke2@huawei.com>
19 KiB
Creating a Schema (a V3 API)
Function
This API is used to create a schema.
Constraints
Before creating a schema, ensure that an RDS instance has been created, is in the normal state, and is not associated with other DDM instances.
URI
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|
project_id |
String |
Yes |
Project ID of a tenant in a region. |
instance_id |
String |
Yes |
DDM instance ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token. |
Content-Type |
Yes |
String |
MIME type of the request body. Value range:
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
name |
Yes |
String |
Schema name, which:
|
shard_mode |
Yes |
String |
Sharding mode of the schema. The value can be:
Enumerated values:
|
shard_number |
Yes |
Integer |
Number of shards in the same working mode. The value must be greater than or equal to the number of associated RDS instances and less than or equal to the product of the associated RDS instances multiplied by 64. |
dn_instances |
Yes |
Array of DatabaseDnInstanceInfo objects |
RDS instances associated with the schema |
Example Request
- Creating a schema and associating it with an existing DDM account
POST https://ddm.eu-de.otc.t-systems.com/v3/619d3e78f61b4be68bc5aa0b59edcf7b/instances/1f5c9fd6cd984056ba89c8c87cc03278in09/databases { "name": "mytestdb", "shard_mode": "cluster", "shard_number": 8, "dn_instances": [ { "id": "f296c394f13f48449d715bf99af07e59in01", "user_name": "root", "user_password": "PassWord_234" } ] }
Response
- Normal response
Table 5 Response body parameters Parameter
Type
Description
job_id
String
ID of the job for deleting a schema
name
String
Schema name
- Normal response example
{ "job_id": "eff1d289-xxxx-xxxx-8b9f-463ea07c000c", "name": "mytestdb" }
- Abnormal response
For details, see Abnormal Request Results.
Status Codes
- Normal
- Abnormal
For details, see Status Codes.
Error Codes
For details, see Error Codes.