Buying a DDM Instance
Function
This API is used to buy a DDM instance.
DDM runs in VPCs. Before buying a DDM instance, ensure that there is a VPC available and the required subnet and security group have been configured.
URI
POST /v1/{project_id}/instances
| Parameter | Mandatory | Description |
|---|---|---|
| project_id | Yes | Project ID of a tenant in a region |
Request
Request parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| instance | Yes | Object | Instance information |
| extend_param | No | Object | Extended parameter, which is available only when you create a yearly/monthly instance. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | Yes | String | Name of a DDM instance, which:
|
| flavor_id | Yes | String | Specification ID. |
| node_num | Yes | Integer | Number of nodes |
| engine_id | Yes | String | Engine ID. |
| enterprise_project_id | No | String | Enterprise project ID |
| available_zones | Yes | Array | AZ code The value cannot be empty. For details about how to obtain this parameter value, see Regions and Endpoints. |
| vpc_id | Yes | String | VPC ID |
| security_group_id | Yes | String | Security group ID |
| subnet_id | Yes | String | Subnet ID |
| param_group_id | No | String | Parameter group ID |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| charge_mode | No | String | Billing mode. The value can be:
Default value: postPaid |
| period_type | No | String | Subscription period. The value can be:
This parameter is mandatory if charge_mode is set to prePaid. |
| period_num | No | Integer | Subscription duration
This parameter is mandatory if charge_mode is set to prePaid. |
| is_auto_renew | No | String | Whether the instance is automatically renewed when it expires. The value can be:
This parameter is available if charge_mode is set to prePaid. The instance is automatically renewed by default if no value is specified. |
| is_auto_pay | No | String | Whether the order is paid from the customer's account balance. The value can be:
This parameter is available if charge_mode is set to prePaid. The order needs to be paid manually by default if no value is specified. |
Response
Response parameters
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| id | String | false | Instance ID. This parameter is returned only when a pay-per-use instance is created. |
| order_id | String | false | Order ID. This parameter is returned when a yearly/monthly instance is created. |
Example
Buy a DDM Instance
The following is an example of creating a DDM instance named ddm-test-001.
- Example request (pay-per-use, without extended parameters)
{ "instance": { "name": "ddm-test-001", "flavor_id": "a615922f-0ed8-369e-aad4-a595185febba", "node_num": 1, "engine_id": "31e09c2f-b38a-39f1-8f5d-dd30a6557475", "enterprise_project_id": "0", "available_zones": ["az1xahz"], "vpc_id":"e1d886ec-cfe7-4cd4-b748-fc55a10b4172", "subnet_id":"f942f970-1a02-4eee-8927-e8670ce5a882", "security_group_id":"035b70ed-319b-4086-9fd7-62a2e8548b2e" } } - Example request(pay-per-use, with extended parameters)
{ "instance": { "name": "ddm-test-001", "flavor_id": "a615922f-0ed8-369e-aad4-a595185febba", "node_num": 1, "engine_id": "31e09c2f-b38a-39f1-8f5d-dd30a6557475", "enterprise_project_id": "0", "available_zones": ["az1xahz"], "vpc_id":"e1d886ec-cfe7-4cd4-b748-fc55a10b4172", "subnet_id":"f942f970-1a02-4eee-8927-e8670ce5a882", "security_group_id":"035b70ed-319b-4086-9fd7-62a2e8548b2e" }, "extend_param": { "charge_mode": "postPaid" } }
- Example request (yearly/monthly)
{ "instance": { "name": "ddm-test-001", "flavor_id": "a615922f-0ed8-369e-aad4-a595185febba", "node_num": 1, "engine_id": "31e09c2f-b38a-39f1-8f5d-dd30a6557475", "enterprise_project_id": "0", "available_zones": ["az1xahz"], "vpc_id":"e1d886ec-cfe7-4cd4-b748-fc55a10b4172", "subnet_id":"f942f970-1a02-4eee-8927-e8670ce5a882", "security_group_id":"035b70ed-319b-4086-9fd7-62a2e8548b2e" }, "extend_param": { "charge_mode": "prePaid", "period_type": "month", "period_num": 1, "is_auto_renew": "false", "is_auto_pay": "true" } }
- Example response (pay-per-use)
{ "id":"abf441ff-8e5f-4fd4-8199-0b7d44203e65", "order_id":"null" }
- Example response (yearly/monthly)
{ "id":"null", "order_id":"CS1810251738L8VVD" }
Status Code
For details, see Status Codes.
Last Article: APIs for Managing DDM Instances
Next Article: Querying DDM Instances

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.