Creating an Instance
Function
This API is used to create an instance in the pay-per-use or yearly/monthly mode.
Calling Method
For details, see Calling APIs.
URI
POST /v2/{engine}/{project_id}/instances
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
engine |
Yes |
String |
Definition: Message engine. Constraints: N/A Range: rabbitmq: RabbitMQ engine. Default Value: N/A |
|
project_id |
Yes |
String |
Definition Project ID. For details, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
Definition: Instance name. Constraints: A username must start with a letter. It can contain 4 to 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. Range: N/A Default Value: N/A |
|
description |
No |
String |
Definition: Description of an instance. Constraints: 0–1,024 characters The backslash () and quotation mark (") are special characters for JSON messages. When using these characters in a parameter value, add the escape character () before the characters, for example, \\ and \". Range: N/A Default Value: N/A |
|
engine |
Yes |
String |
Definition: Message engine. Constraints: N/A Range: rabbitmq: RabbitMQ engine. Default Value: N/A |
|
engine_version |
Yes |
String |
Definition Message engine version. Constraints N/A Range Default Value N/A |
|
enable_acl |
No |
Boolean |
Definition: ACL Constraints: Available only for the AMQP version. Range: Default Value: N/A |
|
storage_space |
Yes |
Integer |
Definition Message storage space, in GB. Constraints The disk capacity can be only set to an integer multiple of 100. Range Default Value N/A |
|
access_user |
No |
String |
Definition: Authentication username. Constraints: Starts with a letter, consists of 4 to 64 characters, and contains only letters, digits, hyphens (-), and underscores (_). This parameter is mandatory when ssl_enable is set to true. This parameter is invalid when ssl_enable is set to false. Range: N/A Default Value: N/A |
|
password |
No |
String |
Definition: Instance password. Constraints:
Range: N/A Default Value: N/A |
|
vpc_id |
Yes |
String |
Definition VPC ID. To obtain the VPC ID, call the API for querying the VPC list by referring to Virtual Private Cloud API Reference. Constraints N/A Range N/A Default Value N/A |
|
security_group_id |
Yes |
String |
Definition Security group to which the instance belongs. To obtain the security group ID, call the API for querying the security group list by referring to Virtual Private Cloud API Reference. Constraints N/A Range N/A Default Value N/A |
|
subnet_id |
Yes |
String |
Definition Subnet information. To obtain the subnet ID, call the API for querying the subnet list by referring to Virtual Private Cloud API Reference. Constraints N/A Range N/A Default Value N/A |
|
available_zones |
Yes |
Array of strings |
Definition: ID of the AZ where instance brokers reside and which has available resources. Obtain the AZ ID by referring to Listing AZ Information. Constraints: This parameter cannot be empty or null. A RabbitMQ instance should be deployed in 1 AZ or at least 3 AZs. If the instance is deployed in multiple AZs, separate the AZ IDs with commas (,). |
|
product_id |
Yes |
String |
Definition: Product ID. Obtain the product ID from Querying Product Specifications List. Constraints: N/A Range: N/A Default Value: N/A |
|
broker_num |
No |
Integer |
Definition: Number of brokers. Constraints: If the product is of the single-node type, there can be only 1 broker. If the product is of the cluster type, there can be 3, 5, or 7 brokers. Range: Default Value: N/A |
|
maintain_begin |
No |
String |
Definition: Start time of the maintenance time window. Constraints: The value is in HH:mm format. Range: N/A Default Value: N/A |
|
maintain_end |
No |
String |
Definition: End time of the maintenance time window. Constraints: The value is in HH:mm format. Range: N/A Default Value: N/A |
|
enable_publicip |
No |
Boolean |
Definition: Whether to enable public access. Constraints: N/A Range: Default Value: false |
|
publicip_id |
No |
String |
Definition ID of the EIP bound to the instance. To obtain the EIP ID, call the API for querying the EIP list by referring to Elastic IP API Reference. Constraints Use commas (,) to separate multiple EIP IDs. This parameter is mandatory if public access is enabled (that is, enable_publicip is set to true). Range N/A Default Value N/A |
|
ssl_enable |
No |
Boolean |
Definition: Whether to enable SSL. Constraints: N/A Range: Default Value: N/A |
|
storage_spec_code |
Yes |
String |
Definition Storage I/O specification. For details, see Disk Types and Disk Performance. Constraints N/A Range Default Value N/A |
|
enterprise_project_id |
No |
String |
Definition: Enterprise project ID. Constraints: This parameter is mandatory for an enterprise project account. Range: N/A Default Value: N/A |
|
tags |
No |
Array of TagEntity objects |
Definition: Tag list. Constraints: A maximum of 20 tags can be added to a RabbitMQ instance. |
|
bss_param |
No |
BssParam object |
Definition: Parameter related to the yearly/monthly billing mode. Constraints: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
key |
No |
String |
Definition: Tag key. Range: N/A |
|
value |
No |
String |
Definition: Tag value. Range: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
is_auto_renew |
No |
Boolean |
Definition: Indicates whether auto-renewal is enabled. Constraints: N/A Range: Default Value: false |
|
charging_mode |
No |
String |
Definition: Billing mode. Constraints: N/A Range: Default Value: postPaid |
|
is_auto_pay |
No |
Boolean |
Definition: Whether the order is automatically or manually paid. Constraints: N/A Range: Default Value: false |
|
period_type |
No |
String |
Definition: Subscription period type. Constraints: This parameter is valid and mandatory only when chargingMode is set to prePaid. Range: Default Value: N/A |
|
period_num |
No |
Integer |
Definition: Number of subscription periods. Constraints: This parameter is valid and mandatory only when chargingMode is set to prePaid. Range: Default Value: N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
instance_id |
String |
Definition: Instance ID. Range: N/A |
Example Requests
-
Creating a pay-per-use RabbitMQ instance whose version is 3.8.35, specifications are 2 vCPUs | 4 GB x 1, and storage space is 100 GB
POST https://{endpoint}/v2/{engine}/{project_id}/instances { "name" : "rabbitmq-demo", "description" : "", "engine" : "RabbitMQ", "engine_version" : "3.8.35", "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" : "c6.2u4g.single", "ssl_enable" : false, "enable_publicip" : false, "publicip_id" : "", "storage_spec_code" : "dms.physical.storage.high.v2" } -
Creating a yearly/monthly RabbitMQ instance whose version is 3.8.35, specifications are 2 vCPUs | 4 GB x 1, and storage space is 100 GB
POST https://{endpoint}/v2/{engine}/{project_id}/instances { "name" : "rabbitmq-demo", "description" : "", "engine" : "RabbitMQ", "engine_version" : "3.8.35", "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" : "c6.2u4g.single", "ssl_enable" : false, "enable_publicip" : false, "publicip_id" : "", "storage_spec_code" : "dms.physical.storage.high.v2", "bss_param" : { "charging_mode" : "prePaid", "period_type" : "month", "period_num" : 1, "is_auto_pay" : true } } -
Creating a RabbitMQ instance with AMQP-0-9-1, amqp.b1.large.1, and 100 GB
POST https://{endpoint}/v2/{engine}/{project_id}/instances { "name" : "rabbitmq-aor-demo", "description" : "", "engine" : "RabbitMQ", "engine_version" : "AMQP-0-9-1", "storage_space" : 100, "vpc_id" : "05590544-f553-4158-be38-c791589ad303", "security_group_id" : "030f635d-b407-4ffb-b530-6b4eaf8edc03", "subnet_id" : "89c1cb26-787b-4d66-a6e4-1bd887f19183", "available_zones" : [ "9f1c5806706d4c1fb0eb72f0a9b18c77" ], "product_id" : "amqp.b1.large.1", "broker_num" : 1, "ssl_enable" : false, "enable_publicip" : false, "storage_spec_code" : "dms.physical.storage.high.v2", "enable_acl" : true, "enterprise_project_id" : 0 }
Example Responses
Status code: 200
Instance created successfully.
{
"instance_id" : "8959ab1c-7n1a-yyb1-a05t-93dfc361b32d"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Instance created successfully. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.