Creating an Order
Function
Creates an order.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
workspace:orders:create
Write
-
-
- ims:images:list
- vpc:vpcs:get
- vpc:networks:get
- vpc:subnets:get
- vpc:ports:get
- bss:order:update
- kms:cmk:createGrant
- kms:cmk:listGrants
- kms:cmk:get
- kms:cmk:list
- iam:agencies:pass
URI
POST /v1/{project_id}/bundles/subscribe/order
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Unique ID of a project |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | No | String | User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| resources | Yes | Array of Resource objects | Yearly/Monthly resource object. |
| type | Yes | String | createApps (adding a cloud application). |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| add_volumes | No | AddVolumes object | Disk order request. |
| cloud_service_console_url | No | String | URL displayed after payment. |
| create_services | Yes | CreateServices object | Structure of cloud service order placement. |
| is_auto_renew | No | Integer | Indicates whether the subscription is automatically renewed. 0: no; 1: yes. |
| period_num | No | Integer | The number of subscription periods is greater than 0. |
| period_type | No | Integer | Mandatory. There are multiple subscription period options. 2: monthly; 3: yearly; 4: hourly (only for bandwidth add-on packages); 5: absolute time (for supplemented resources such as EVS disks attached to ECSs); 6: once-off (chargingMode set to 1). |
| subscription_num | Yes | Integer | Subscription quantity. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| service_id | No | String | Service ID. |
| volumes | No | Array of Volume objects | Disk order details. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| availability_zone | No | String | AZ. |
| data_volumes | No | Array of Volume objects | Data disk. |
| nics | No | Array of Nic objects | NIC information. This field is not used yet. |
| ou_name | No | String | OU name, which is used for connecting to the AD. An OU must be created in the AD in advance. |
| product_id | Yes | String | Product ID. |
| flavor_id | No | String | Specification ID. |
| os_type | No | String | OS type. Currently, only Windows is supported. |
| root_volume | Yes | Volume object | Default system volume size. Options: minLength: 10; maxLength: 1024. |
| server_group_id | Yes | String | Server group ID, which is generated when a service group is created for a cloud application. |
| service_type | No | String | Specifies the cloud service type. The value is fixed to DEDICATED for Workspace. |
| subnet_id | Yes | String | Subnet ID. |
| vpc_id | Yes | String | This parameter is transferred during the first registration of the LiteAS during automatic registration. |
| security_groups | No | Array of SecurityGroup objects | Security group used by the server. If not specified, the security group specified in the server agent is used by default. ⚠ Warning: This attribute is reserved and is not used currently. |
| update_access_agent | No | Boolean | Indicates whether to enable automatic HDA upgrade. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| type | Yes | String | Disk type. For details about how to obtain available disk types, see parameter ListVolumeType. Options: ESSD: Extreme SSD SSD: Ultra-high I/O GPSSD: General-purpose SSD SAS: High I/O SATA: Common I/O |
| size | Yes | Integer | Disk capacity (a multiple of 10, in GB). Options: |
| cluster_id | No | String | ID of the storage pool used by the ECS system disk. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| order_id | String | Order ID. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 404
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 405
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 503
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Example Requests
{
"resources" : [ {
"add_volumes" : {
"service_id" : "string",
"volumes" : [ {
"type" : "SSD",
"size" : 10,
"cluster_id" : "c950ee97-587c-4f24-8a74-3367e3da570f"
} ]
},
"cloud_service_console_url" : "http://10.*.*.0:8003/v1/{project_id}/bundles/services/create",
"create_services" : {
"availability_zone" : "cn-north-5a",
"data_volumes" : [ {
"type" : "SSD",
"size" : 10,
"cluster_id" : "c950ee97-587c-4f24-8a74-3367e3da570f"
} ],
"nics" : [ {
"ip_address" : "string",
"subnet_id" : "197c1aa4-2611-48bd-a3af-ac4ce2c17c4c"
} ],
"ou_name" : "string",
"product_id" : "workspacehost.s.large2.p01",
"flavor_id" : "c3.large.4",
"os_type" : "Windows",
"root_volume" : {
"type" : "SSD",
"size" : 10,
"cluster_id" : "c950ee97-587c-4f24-8a74-3367e3da570f"
},
"server_group_id" : "1",
"service_type" : "string",
"subnet_id" : "197c1aa4-2611-48bd-a3af-ac4ce2c17c4c",
"vpc_id" : "string",
"security_groups" : [ {
"id" : "string",
"name" : "string"
} ],
"update_access_agent" : "true"
},
"is_auto_renew" : 1,
"period_num" : 3,
"period_type" : 3,
"subscription_num" : 3
} ],
"type" : "createApps"
} Example Responses
Status code: 200
Response to a successful request.
{
"order_id" : "CS23060117315YQ6Z"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Response to a successful request. |
| 400 | The request cannot be understood by the server due to malformed syntax. |
| 401 | Authentication failed. |
| 403 | Permissions required. |
| 404 | Resources not found. |
| 405 | The method specified in the request is not allowed. |
| 500 | An internal service error occurred. For details, see the error code description. |
| 503 | Service unavailable. |
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot