Creating a DB instance

Function

This API is used to create a GaussDB(for MySQL) DB instance

URI

Request

Table 2 Parameter description

Name

Mandatory

Type

Description

charge_info

No

Object

Billing mode.

For details, see Table 3.

name

Yes

String

DB instance name.

DB instances of the same type can have same names under the same tenant.

The value must be 4 to 64 characters in length and start with a letter. It is case-sensitive and can contain only letters, digits, hyphens (-), and underscores (_).

datastore

Yes

Object

Database information.

For details, see Table 4.

mode

Yes

String

DB instance type. Currently, only the cluster type is supported.

flavor_ref

Yes

String

Specification code.

vpc_id

Yes

String

VPC ID. To obtain this value, use either of the following methods:

  • Method 1: Log in to the VPC console and view the VPC ID on the VPC details page.
  • Method 2: See "Querying VPCs" in the Virtual Private Cloud API Reference.

subnet_id

Yes

String

Network ID. To obtain this value, use either of the following methods:

  • Method 1: Log in to the VPC console and click the target subnet on the Subnets page. You can view the network ID on the displayed page.
  • Method 2: See "Querying Subnets" in the Virtual Private Cloud API Reference.

security_group_id

No

String

Security group ID.

If the network ACL is enabled for the subnet used by the created DB instance, this parameter is optional. If the network ACL is not enabled, this parameter is mandatory.

  • Method 1: Log in to VPC console. Choose Access Control > Security Groups in the navigation pane on the left. On the displayed page, click the target security group. You can view the security group ID on the displayed page.
  • Method 2: See "Querying Security Groups" in the Virtual Private Cloud API Reference.

configuration_id

No

String

Parameter template ID.

password

Yes

String

Database password.

Valid value:

The password is 8 to 32 characters long and must contain at least three types of the following: uppercase letters, lowercase letters, digits, and special characters (~!@#%^*-_=+?).

You are advised to enter a strong password to improve security and prevent security risks such as brute force cracking. If you enter a weak password, the system automatically determines that the password is invalid.

backup_strategy

No

Object

Automated backup policy.

For details, see Table 5.

time_zone

No

String

UTC time zone.

  • If this parameter is not specified, UTC is used by default.
  • If this parameter is specified, the value ranges from UTC-12:00 to UTC+12:00 at the full hour. For example, the parameter can be UTC+08:00 rather than UTC+08:30.

availability_zone_mode

Yes

String

AZ type. The value can be single or multi.

master_availability_zone

If availability_zone_mode is set to multi, this parameter is mandatory.

If availability_zone_mode is set to single, this parameter cannot be specified.

String

Primary AZ.

slave_count

Yes

Integer

Number of read-only nodes from 1 to 9. A DB instance can have a maximum of 15 read-only nodes.

region

Yes

String

Region ID.

The value cannot be empty. To obtain this value, see Regions and Endpoints.

enterprise_project_id

No

String

Enterprise project ID. This parameter is mandatory only when the enterprise project is enabled.

Table 3 charge_info field data structure description

Name

Mandatory

Type

Description

charge_mode

Yes

String

Billing mode.

Value: postPaid

Table 4 datastore field data structure description

Name

Mandatory

Type

Description

type

Yes

String

DB engine. Currently, only gaussdb-mysql is supported.

version

Yes

String

DB version.

For details about supported DB versions, see section Querying Version Information About a DB Engine.

Table 5 backup_strategy field data structure description

Name

Mandatory

Type

Description

start_time

Yes

String

Automated backup start time. The automatic backup will be triggered within one hour after the time specified by this parameter.

The value of region in the following is used as an example.

Response

The values of region and master_availability_zone are used as examples.

Status Code

For details, see Status Codes.

Error Code

For details, see Error Codes.