Placing a Yearly/Monthly Order
Function
Places an order for yearly/monthly resources, including desktops, disks.
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 /v2/{project_id}/periodic/subscribe/order
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
type |
Yes |
String |
Order type. createDesktops: creating a desktop; addVolumes: adding a disk; rebuildDesktops: recomposing the system disk; createDesktopPool: creating a desktop pool; expandDesktopPool: expanding the desktop pool capacity; applyDesktopsInternet: enabling the desktop EIP network access; createExclusiveHosts: creating an exclusive host; subscribeUserSharer: subscribing to user collaboration resources; ApplySubnetBandwidth: enabling the Workspace bandwidth |
|
enterprise_project_id |
No |
String |
Enterprise project ID, which is 0 by default. |
|
agency_urn |
No |
String |
URN of the agency authorized to billing services. This parameter is required when you create a yearly/monthly desktop or add a yearly/monthly disk using the RAM shared key. |
|
resources |
Yes |
Array of Resource objects |
Yearly/Monthly resource. |
|
extend_param |
No |
OrderExtendParam object |
Extended parameter of the order. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
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) |
|
period_num |
No |
Integer |
Number of subscription periods. |
|
is_auto_renew |
No |
Integer |
Whether auto-renewal is enabled. |
|
add_volumes |
No |
AddVolumes object |
Disk order request. |
|
create_desktops |
No |
CreateDesktopReq object |
Request for creating a desktop. |
|
rebuild_desktops |
No |
RebuildDesktopsReq object |
Request for recomposing the system disk. |
|
attach_desktops |
No |
AttachInstancesReq object |
Request for assigning a desktop to a user. |
|
create_exclusive_hosts |
No |
CreateExclusiveHostsReq object |
Request body for creating an exclusive host. |
|
resize_exclusive_lites |
No |
ResizeExclusiveLitesReq object |
Request for changing the number of desktops on an exclusive host. |
|
create_desktop_pool |
No |
CreateDesktopPoolReq object |
Request for creating a desktop. |
|
expand_desktop_pool |
No |
ExpandDesktopPoolOrderReq object |
Request for expanding the desktop pool capacity. |
|
apply_desktops_internet |
No |
ApplyDesktopsInternet object |
Request body for enabling desktop network access. |
|
apply_subnet_bandwidth |
No |
ApplySubnetBandwidthReq object |
Request body for enabling Workspace bandwidth. |
|
subscribe_user_sharer |
No |
SubscribeUserSharerReq object |
Request body for subscribing to collaboration. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
desktop_id |
Yes |
String |
Desktop ID. |
|
volumes |
Yes |
Array of Volume objects |
Disk information of the order. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
desktop_type |
Yes |
String |
Specifies the cloud desktop type. |
|
availability_zone |
No |
String |
AZ. Desktops are created in the specified AZ. |
|
product_id |
Yes |
String |
Package ID. |
|
buy_type |
No |
String |
Purchase option on the console. The default value is custom. |
|
image_type |
Yes |
String |
Image type. The default value is private. |
|
image_id |
Yes |
String |
Image ID. This parameter is used together with product_id for creating desktops using custom images. |
|
root_volume |
Yes |
Volume object |
System disk. |
|
data_volumes |
No |
Array of Volume objects |
Data disks. |
|
nics |
No |
Array of Nic objects |
Information about the NIC corresponding to the desktop. If this parameter is not specified, the default NIC is used. |
|
security_groups |
No |
Array of SecurityGroupIdInfo objects |
Security group used by the desktop. If no security group is specified, the security group specified in the desktop agent is used by default. |
|
desktops |
No |
Array of Desktop objects |
List of parameters used for creating a desktop. The value contains 1 to 100 characters. |
|
desktop_name |
No |
String |
This parameter is used together with size. If size is set to 1, this parameter indicates the desktop name, which consists of 1 to 15 characters. If size is set to a value greater than 1, this parameter indicates the desktop name prefix, which consists of 1 to 13 characters. |
|
desktop_ips |
No |
Array of strings |
IP addresses assigned to the desktop. The value ranges from 0 to 100. |
|
size |
No |
Integer |
Number of desktops that are not assigned to users. This parameter cannot be used together with desktops. It is used together with desktop_name. |
|
email_notification |
No |
Boolean |
Whether to send an email to notify the desktop user after a desktop is created. The default value is true. |
|
enterprise_project_id |
No |
String |
Enterprise project ID, which is 0 by default. |
|
tags |
No |
Array of Tag objects |
Tag list. |
|
apply_shared_vpc_dedicated_param |
No |
ApplySharedVpcDedicatedParam object |
Input parameter of the shared VPC Direct Connect. |
|
eip |
No |
Eip object |
EIP information. |
|
desktop_name_policy_id |
No |
String |
Policy ID, which is used to specify the desktop name generation policy. If a desktop name is specified, the specified desktop name is used preferentially. |
|
hour_package_product_id |
No |
String |
Hourly desktop package ID. |
|
hour_package_offering_id |
No |
String |
Offering ID of an hourly desktop package. |
|
if_mount_old_desktop_disk |
No |
Boolean |
Whether to mount the disk of the old desktop as a data disk when a new desktop is provisioned. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
type |
Yes |
String |
Desktop data disk type, which must be the same as the disk type provided by the system. |
|
size |
Yes |
Integer |
Disk capacity in GB. The system disk size ranges from 80 to 32760, and the data disk size ranges from 10 to 32760. The value must be a multiple of 10. |
|
iops |
No |
Integer |
Number of read/write operations performed by an EVS disk per second. |
|
throughput |
No |
Integer |
Amount of data read from and written to an EVS disk per second. |
|
kms_id |
No |
String |
KMS key ID, which is used to encrypt the created disk. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
subnet_id |
Yes |
String |
ID of the subnet on which the NIC works. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
user_name |
Yes |
String |
User to whom a desktop belongs. After a desktop is created, the user can log in to the desktop. Only letters, digits, hyphens (-), and underscores (_) are allowed. When the domain type is LITE_AD, the value contains 1 to 20 characters starting with a letter. When the domain type is LOCAL_AD, the value contains 1 to 32 characters starting with a letter or digit. A Windows desktop username can contain a maximum of 20 characters, and a Linux desktop username can contain a maximum of 32 characters. |
|
domain |
No |
String |
Domain to which the user belongs. |
|
user_email |
No |
String |
Valid user email. After a desktop is created, the system informs users through emails. |
|
user_phone |
No |
String |
Mobile number of a valid user. |
|
user_group |
No |
String |
User group to which the desktop user belongs. |
|
computer_name |
No |
String |
Desktop name, which must be unique. The desktop name can contain 1 to 15 characters in letters, digits, and hyphens (-). It must start with a letter or digit and cannot end with a hyphen (-). |
|
os_host_name |
No |
String |
Computer name in the OS. |
|
desktop_name_prefix |
No |
String |
Desktop name prefix. This parameter takes effect when computer_name is not specified. |
|
copy_volume_desktop_id |
No |
String |
ID of the desktop whose data disk needs to be copied. If this parameter is specified, copy_volume_ids cannot be empty. |
|
copy_volume_ids |
No |
Array of strings |
List of IDs of the data disks that need to be copied. If this parameter is specified, copy_volume_desktop_id cannot be empty, and the disks must belong to the desktop. |
|
if_delete_old_desktop |
No |
Boolean |
Whether to delete the old desktop that is billed on a pay-per-use basis. If this parameter is set to true, the old desktop is deleted after the new desktop is provisioned and the disk is copied. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
address |
No |
String |
Shared VPC Direct Connect address specified by the tenant. |
|
port |
No |
Integer |
Shared VPC Direct Connect address port specified by the tenant. |
|
availability_zone |
No |
Array of strings |
AZ used for subscribing to service resources. By default, two AZs are randomly used. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
id |
No |
String |
ID of the EIP bound to the desktop. If this parameter is specified, the EIP is preferentially bound. |
|
type |
No |
String |
EIP type. |
|
charge_mode |
No |
String |
EIP bandwidth billing mode. |
|
bandwidth_size |
No |
Integer |
Bandwidth size. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
desktop_ids |
Yes |
Array of strings |
Desktop IDs. |
|
image_type |
Yes |
String |
Image type. |
|
image_id |
Yes |
String |
Template ID. |
|
encrypt_type |
No |
String |
Encryption type. |
|
kms_id |
No |
String |
Key ID. This parameter is mandatory when encrypt_type is set to ENCRYPTED. |
|
os_type |
No |
String |
OS type. |
|
delay_time |
No |
Integer |
Time reserved for users to save data during immediate recomposing (unit: minute). |
|
message |
No |
String |
Message sent to the user when a system disk recomposing task is delivered. |
|
order_id |
No |
String |
Order ID, which is used to recompose the system disk of a yearly/monthly-billed desktop. This parameter is mandatory when billed images are used. |
|
enterprise_project_id |
No |
String |
Enterprise project ID, which is 0 by default. |
|
handle_type |
No |
String |
Processing type. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
desktops |
No |
Array of AttachInstancesDesktopInfo objects |
Desktop information list. |
|
image_type |
No |
String |
Image type. This parameter is mandatory only when the image needs to be changed. |
|
image_id |
No |
String |
Template ID: This parameter is mandatory only when the image needs to be changed. |
|
desktop_name_policy_id |
No |
String |
Policy ID, which is used to specify a policy for generating desktop names. If a desktop name is specified, the specified desktop name is used preferentially. |
|
encrypt_type |
No |
String |
Encryption type. |
|
kms_id |
No |
String |
Key ID. This parameter is mandatory when encrypt_type is set to ENCRYPTED. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
desktop_id |
No |
String |
ID of the desktop to be assigned. |
|
user_name |
No |
String |
User to whom a desktop belongs. After a desktop is assigned, the user can log in to the desktop. Only letters, digits, hyphens (-), and underscores (_) are allowed. When the domain type is LITE_AD, the value contains 1 to 20 characters starting with a letter. When the domain type is LOCAL_AD, the value contains 1 to 32 characters starting with a letter or digit. A Windows desktop username can contain a maximum of 20 characters, and a Linux desktop username can contain a maximum of 32 characters. The username cannot be the same as the name of the assigned desktop. This parameter is mandatory when attach_user_infos is left blank. attach_user_infos has a higher priority. |
|
user_id |
No |
String |
User ID. |
|
user_email |
No |
String |
Valid user email. After a desktop is assigned, a notification will be emailed to the user. |
|
user_group |
No |
String |
User group to which the desktop user belongs. This parameter is mandatory when attach_user_infos is left blank. attach_user_infos has a higher priority. |
|
computer_name |
No |
String |
Desktop name, which must be unique. Enter 1 to 15 characters of only letters, digits, hyphens (-), and underscores (_). It must start with a letter and cannot end with a hyphen (-). |
|
is_clear_data |
No |
Boolean |
This parameter is valid only when unbinding and binding are performed on the same user. Whether to clear desktop data during binding. The options are true (yes) and false (no). The default value is true. |
|
attach_user_infos |
No |
Array of AttachInstancesUserInfo objects |
List of users to whom desktops are to be assigned. This parameter is valid only when a multi-user desktop is assigned to multiple users. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
availability_zone |
Yes |
String |
AZ. |
|
name |
No |
String |
Name. |
|
apply_desktop_quantity |
No |
Integer |
Number of desktops to be added. |
|
quantity |
Yes |
Integer |
Purchase quantity. |
|
product_id |
Yes |
String |
Product package ID. |
|
image_volumes |
Yes |
Array of Volume objects |
Image disks. |
|
enterprise_project_id |
No |
String |
Enterprise project ID, which is 0 by default. |
|
memory_volumes |
Yes |
Array of Volume objects |
Storage disks. |
|
vpc_id |
Yes |
String |
VPC ID. |
|
subnet_id |
Yes |
String |
Subnet ID. |
|
resize_exclusive_lites |
No |
ResizeExclusiveLitesReq object |
Request for changing the number of desktops on an exclusive host. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
enterprise_project_id |
No |
String |
Enterprise project ID, which is 0 by default. |
|
product_id |
Yes |
String |
Product package ID. |
|
new_quantity |
Yes |
Integer |
Number of desktops after capacity expansion. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
Desktop pool name, which must be unique. The desktop name can contain 1 to 255 characters, including uppercase letters, lowercase letters, digits, and hyphens (-). |
|
type |
Yes |
String |
Desktop pool type. The options are DYNAMIC (dynamic pool) and STATIC (static pool). |
|
size |
Yes |
Integer |
Desktop pool size: number of desktops to be created in the current desktop pool. |
|
description |
No |
String |
Desktop pool description. |
|
availability_zone |
No |
String |
AZ. Desktops are created in the specified AZ. |
|
product_id |
Yes |
String |
Package ID. |
|
flavor_id |
No |
String |
Product specification ID. |
|
image_type |
Yes |
String |
Specifies the image type. The default value is private. |
|
image_id |
Yes |
String |
Image ID. This parameter is used together with product_id for creating desktops using custom images. |
|
root_volume |
Yes |
VolumeInfo object |
System disk. |
|
data_volumes |
No |
Array of VolumeInfo objects |
Data disks. |
|
vpc_id |
No |
String |
Specifies the VPC ID when the desktop is created. |
|
subnet_ids |
Yes |
Array of strings |
ID of the subnet used for creating a desktop. |
|
security_groups |
No |
Array of SecurityGroupIdInfo objects |
Security group used by the desktop. If no security group is specified, the security group specified in the desktop agent is used by default. |
|
authorized_objects |
No |
Array of AuthorizedObjects objects |
Users or user groups to be authorized. |
|
ou_name |
No |
String |
OU name, which is used for connecting to the AD. An OU must be created in the AD in advance. |
|
tags |
No |
Array of Tag objects |
Tag list. |
|
enterprise_project_id |
No |
String |
Enterprise project ID, which is 0 by default. |
|
disconnected_retention_period |
No |
Integer |
Number of minutes within which the binding relationship between a user and a desktop is retained when the dynamic pool desktop is disconnected. After the binding relationship times out, the user is automatically unbound. |
|
enable_autoscale |
No |
Boolean |
Specifies whether to enable auto scaling for the desktop pool. The value false indicates that auto scaling is disabled, and the value true indicates that auto scaling is enabled. |
|
autoscale_policy |
No |
AutoscalePolicy object |
Auto scaling policy. |
|
desktop_name_policy_id |
No |
String |
Policy ID, which is used to specify the desktop name generation policy. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
id |
No |
String |
Specifies the IDs of the disks to be operated in batches. |
|
type |
Yes |
String |
Desktop data disk type, which must be the same as the disk type provided by the system. |
|
size |
Yes |
Integer |
Disk capacity in GB. |
|
iops |
No |
Integer |
Number of read/write operations performed by an EVS disk per second. |
|
throughput |
No |
Integer |
Amount of data read from and written to an EVS disk per second. |
|
resource_spec_code |
No |
String |
Specifications. |
|
kms_id |
No |
String |
KMS key ID. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
object_type |
Yes |
String |
Enumeration of bound object types. |
|
object_id |
Yes |
String |
User ID or user group ID. |
|
object_name |
Yes |
String |
Username or user group name. |
|
domain |
No |
String |
Domain name of the user/user group. |
|
user_group |
Yes |
String |
Specifies the user permission group to which the desktop user belongs. |
|
created_at |
No |
String |
Creation time. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
key |
Yes |
String |
Specifies the tag key. This parameter cannot be left blank and can contain a maximum of 128 Unicode characters. The value can contain uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_). The value cannot contain the following characters: =*<>,|/. |
|
value |
No |
String |
Value of a tag, which can contain a maximum of 43 Unicode characters. The value can contain uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_). The value cannot contain the following characters: =*<>,|/. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
autoscale_type |
No |
String |
Auto scaling type. The options are as follows: ACCESS_CREATED: created during access; AUTO_CREATED: auto scaling. |
|
max_auto_created |
No |
Integer |
Maximum number of desktops that can be automatically created. |
|
min_idle |
No |
Integer |
Number of reserved idle desktops. |
|
once_auto_created |
No |
Integer |
Number of desktops that can be automatically created at a time. (deprecated) |
|
min_retention |
No |
Integer |
Minimum number of desktops. |
|
idle_retention_duration |
No |
Integer |
Idle desktop reservation duration, in minutes. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
size |
No |
Integer |
Expands the desktop pool capacity. |
|
pool_id |
Yes |
String |
ID of the desktop pool to be expanded. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
desktop_ids |
No |
Array of strings |
IDs of desktops for which network access is to be enabled. |
|
eip_type |
Yes |
String |
For details about the supported types, see types supported by the EIP service. You can call the API (https://support.huaweicloud.com/intl/en-us/api-eip/ShowPublicIpType.html) for query. |
|
eip_charge_mode |
Yes |
String |
EIP bandwidth billing mode. |
|
bandwidth_size |
Yes |
Integer |
Bandwidth size, in Mbit/s. The value ranges from 1 Mbit/s to 2,000 Mbit/s by default. (The specific range may vary by region. You can see the available bandwidth range on the management console.) |
|
count |
No |
Integer |
Number of EIPs to be purchased. This parameter is mandatory when desktop_ids is empty. This parameter is valid when EIPs are purchased separately. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
bandwidth_name |
No |
String |
Workspace bandwidth name. |
|
subnet_id |
Yes |
String |
Subnet ID. |
|
charge_mode |
Yes |
String |
Billing mode. |
|
bandwidth_size |
No |
Integer |
Workspace bandwidth size. |
|
enterprise_project_id |
No |
String |
Enterprise project ID, which is 0 by default. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
user_sharer_sku |
Yes |
String |
User collaboration resource SKU code. |
|
users |
Yes |
Array of SubscribeUserInfo objects |
Users who enable collaboration. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
order_id |
String |
Order ID, which is returned when an order is successfully placed. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code, which is returned upon failure. |
|
error_msg |
String |
Error message. |
|
error_detail |
String |
Error details. |
|
encoded_authorization_message |
String |
Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason. |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code, which is returned upon failure. |
|
error_msg |
String |
Error message. |
|
error_detail |
String |
Error details. |
|
encoded_authorization_message |
String |
Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason. |
Example Requests
-
POST /v2/0bec5db98280d2d02fd6c00c2de791ce/periodic/subscribe/order { "type" : "addVolumes", "enterprise_project_id" : "0", "resources" : [ { "add_volumes" : { "desktop_id" : "8d049b4e-4f1e-4ed5-b3a9-a7f0f15658a7", "volumes" : [ { "type" : "SAS", "size" : 50 } ] } } ] } -
POST /v2/0bec5db98280d2d02fd6c00c2de791ce/periodic/subscribe/order { "type" : "createDesktops", "enterprise_project_id" : "0", "resources" : [ { "period_type" : 2, "period_num" : 1, "create_desktops" : { "desktops" : [ { "user_email" : "test@test.com", "user_name" : "test", "user_group" : "sudo" } ], "desktop_type" : "DEDICATED", "email_notification" : false, "product_id" : "workspace.k.xlarge2.uosv20pro", "image_type" : "private", "image_id" : "e1d65e11-861c-459d-a3a8-ab150d79befc", "root_volume" : { "type" : "SAS", "size" : 80 }, "nics" : [ { "subnet_id" : "197c1aa4-2611-48bd-a3af-ac4ce2c17c4c" } ], "tags" : [ { "key" : "aa", "value" : "bb" } ] } } ] }
Example Responses
Status code: 200
Response body for placing an order in CBC.
{
"order_id" : "CS2108102036B2CAI"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Response body for placing an order in CBC. |
|
400 |
The request cannot be understood by the server due to malformed syntax. |
|
500 |
An internal service error occurred. For details about the error code, see the error code description. |
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