Updated on 2023-07-20 GMT+08:00

Creating an Instance

This API is an out-of-date version and may not be maintained in the future. Please use the API described in Creating an Instance.

Function

This API is used to create a pay-per-use instance.

URI

POST /v1.0/{project_id}/instances

Table 1 describes the parameter.

Table 1 Parameter description

Parameter

Type

Mandatory

Description

project_id

String

Yes

Indicates the ID of a project.

Request

Request parameters

Table 2 describes the request parameters.

Table 2 Parameter description

Parameter

Type

Mandatory

Description

name

String

Yes

Indicates the instance name.

An instance name starts with a letter, consists of 4 to 64 characters, and supports only letters, digits, and hyphens (-).

description

String

No

Indicates the description of an instance.

It is a character string containing not more than 1024 characters.

NOTE:

The backslash (\) and quotation mark (") are special characters for JSON packets. When using these characters in a parameter value, add the escape character (\) before these characters, for example, \\ and \".

engine

String

Yes

Indicates the message engine. Value: rabbitmq

engine_version

String

No

Indicates the version of the message engine.

storage_space

Integer

Yes

Indicates the message storage space.

Unit: GB

  • Single-node RabbitMQ instance: 100–90,000 GB
  • Cluster RabbitMQ instance: 100 GB x Number of nodes to 90,000 GB, 200 GB x Number of nodes to 90,000 GB, and 300 GB x Number of nodes to 90,000 GB

access_user

String

Yes

Indicates a username. A username consists of 4 to 64 characters and supports only letters, digits, and hyphens (-).

password

String

Yes

Indicates an instance password.

An instance password must meet the following complexity requirements:

  • Must be a string consisting of 8 to 32 characters.
  • Must contain at least two of the following character types:
    • Lowercase letters
    • Uppercase letters
    • Digits
    • Special characters `~!@#$%^&*()-_=+\|[{}];:',<.>/?

vpc_id

String

Yes

Indicates the ID of a VPC.

security_group_id

String

Yes

Indicates the ID of a security group.

subnet_id

String

Yes

Indicates the ID of a subnet.

available_zones

Array

Yes

Indicates the ID of an AZ. The parameter value cannot be an empty array or an empty array. For details, see Querying AZ Information.

product_id

String

Yes

Indicates the product ID.

For details, see Querying Product Specifications.

maintain_begin

String

No

Indicates the time at which a maintenance time window starts.

Format: HH:mm.

  • The start time and end time of the maintenance time window must indicate the time segment of a supported maintenance time window. For details about how to query the time segments of supported maintenance time windows, see Querying Maintenance Time Windows.
  • The start time must be set to 22:00, 02:00, 06:00, 10:00, 14:00, or 18:00.
  • Parameters maintain_begin and maintain_end must be set in pairs. If parameter maintain_begin is left blank, parameter maintain_end is also left blank. In this case, the system automatically set the start time to 02:00.

maintain_end

String

No

Indicates the time at which a maintenance time window ends.

Format: HH:mm.

  • The start time and end time of the maintenance time window must indicate the time segment of a supported maintenance time window. For details about how to query the time segments of supported maintenance time windows, see Querying Maintenance Time Windows.
  • The end time is four hours later than the start time. For example, if the start time is 22:00, the end time is 02:00.
  • Parameters maintain_begin and maintain_end must be set in pairs. If parameter maintain_end is left blank, parameter maintain_start is also left blank. In this case, the system automatically set the end time to 06:00.

enable_publicip

Boolean

No

Indicates whether to enable public access for a RabbitMQ instance.

  • true: enable
  • false: disable

publicip_id

String

No

Indicates the ID of the elastic IP address (EIP) bound to a RabbitMQ instance.

This parameter is mandatory if public access is enabled (that is, enable_publicip is set to true).

ssl_enable

Boolean

No

Indicates whether to enable SSL-encrypted access.

  • true: enable
  • false: disable

storage_spec_code

String

Yes

Indicates storage I/O specification.

Options:

  • dms.physical.storage.normal
  • dms.physical.storage.high
  • dms.physical.storage.ultra

enterprise_project_id

String

No

Indicates the enterprise project ID.

Example request for creating a RabbitMQ instance

{
	"name": "rabbitmq-demo",
	"description": "",
	"engine": "RabbitMQ",
	"engine_version": "3.x.x",
	"storage_space": 100,
	"access_user": "******",
	"password": "******",
	"vpc_id": "1e93f86e-13af-46c8-97d6-d40fa62b76c2",
	"security_group_id": "0aaa0033-bf7f-4c41-a6c2-18cd04cad2c8",
	"subnet_id": "b5fa806c-35e7-4299-b659-b39398dd4718",
	"available_zones": ["d573142f24894ef3bd3664de068b44b0"],
	"product_id": "00300-30109-0--0",
	"maintain_begin": "22:00",
	"maintain_end": "02:00",
	"ssl_enable": false,
	"enable_publicip": false,
	"publicip_id": "",
	"enterprise_project_id": "0",
	"storage_spec_code": "dms.physical.storage.ultra"
}

Response

Response parameters

Table 3 describes the response parameter.

Table 3 Parameter description

Parameter

Type

Description

instance_id

String

Indicates the instance ID.

Example response

{  
    "instance_id": "8959ab1c-7n1a-yyb1-a05t-93dfc361b32d"  
}

Status Code

Table 4 describes the status code of successful operations. For details about other status codes, see Status Code.

Table 4 Status code

Status Code

Description

200

The instance is created successfully.