Creates a PolarDB-X 1.0 database.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateDrdsDB

The operation that you want to perform. Set the value to CreateDrdsDB.

DrdsInstanceId String Yes drdshbgal154****

The ID of the PolarDB-X 1.0 instance on which you want to create the database.

DbName String No testdb

The name of the PolarDB-X 1.0 database you want to create.

Encode String No drds_sample_encode

The encoding method that is used by the database.

Password String No drds_sample_password

The password that is used to log on to the database.

Type String No HORIZONTAL

The partitioning mode of the database. Valid values:

  • HORIZONTAL: The database is horizontally partitioned (sharded).
  • VERTICAL: The database is vertically partitioned.
DbInstType String No RDS

The type of the storage instances that are used by the PolarDB-X 1.0 database. Set the value to RDS.

DbInstanceIsCreating Boolean No false

Specifies whether the required ApsaraDB RDS for MySQL instance is being created.

AccountName String No drds_sample_account

The name of the account that has permissions to access all databases on the ApsaraDB RDS for MySQL instance.

This parameter is required only when the Type parameter is set to VERTICAL.

RdsInstance.N String No ["drds_sample_rds_id1", "drds_sample_rds_id2"]

This parameter is required only when the Type parameter is set to HORIZONTAL. The value of this parameter is a JSON array string.

RdsSuperAccount.N.Password String No drds_sample_rds_super_password

The password of the super administrator account that is used to connect to the ApsaraDB RDS instance.

RdsSuperAccount.N.DbInstanceId String No drds_sample_rds_id

The ID of ApsaraDB RDS instance.

RdsSuperAccount.N.AccountName String No drds_sample_rds_super_account

The account name of the super administrator that is used to connect to the ApsaraDB RDS for MySQL instance.

InstDbName.N.DbInstanceId String No drds_sample_rds_id

The ID of the ApsaraDB RDS for MySQL instance on which the databases need to be vertically partitioned. This parameter is required only when the Type parameter is set to VERTICAL.

InstDbName.N.ShardDbName.N String No ["db1", "db2"]

The list of databases that need to be vertically partitioned on the ApsaraDB RDS for MySQL instance. The value of this parameter is a JSON array string.

This parameter is required only when the Type parameter is set to VERTICAL.

Response parameters

Parameter Type Example Description
Success Boolean true

The result of the request.

RequestId String FF13E47D-4E38-4A5A-BA68-32A554******

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateDrdsDB
&DrdsInstanceId=drdshbgal154****
&DbName=testdb
&Encode=drds_sample_encode
&Password=drds_sample_password
&Type=HORIZONTAL
&DbInstType=RDS
&DbInstanceIsCreating=false
&AccountName=drds_sample_account
&RdsInstance=["[\"drds_sample_rds_id1\", \"drds_sample_rds_id2\"]"]
&RdsSuperAccount=[{"Password":"drds_sample_rds_super_password","DbInstanceId":"drds_sample_rds_id","AccountName":"drds_sample_rds_super_account"}]
&InstDbName=[{"DbInstanceId":"drds_sample_rds_id","ShardDbName":["[\"db1\", \"db2\"]"]}]
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateDrdsDBResponse>
    <Success>true</Success>
    <RequestId>FF13E47D-4E38-4A5A-BA68-32A554******</RequestId>
</CreateDrdsDBResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Success" : true,
  "RequestId" : "FF13E47D-4E38-4A5A-BA68-32A554******"
}

Error codes

HttpCode Error code Error message Description
500 InternalError The request processing has failed due to some unknown error. The error message returned because an internal error has occurred and the request failed.

For a list of error codes, visit the API Error Center.