El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.
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.
URI
POST /v2/{project_id}/periodic/subscribe/order
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. |
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. |
Content-Type |
No |
String |
MIME type of the request body. |
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. |
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. Creates a desktop in the specified AZ. If this parameter is not specified, the default AZ is used. |
product_id |
Yes |
String |
Package ID. |
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 SecurityGroup 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 |
Parameters used for creating a desktop. The value contains 1 to 50 characters. Currently, a batch of desktops cannot have different configurations. The configurations of all desktops must be the same as those of the first desktop. If no parameter is specified for the first desktop, the outer parameters with the same name are used. |
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 |
Tags. |
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. |
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. |
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. |
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. |
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. The value can be 5_bgp (dynamic BGP) or 5_sbgp (static BGP). |
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. |
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. |
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. |
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_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 |
---|---|---|---|
user_id |
No |
String |
If type is set to USER, enter the user ID. If type is set to GROUP, enter the user group ID. The backend service checks whether the group ID exists. |
user_name |
No |
String |
Name of the object assigned with a desktop. If type is set to USER, enter the username. If type is set to GROUP, enter the user group name.
|
user_group |
No |
String |
Specifies the user group to which the desktop user belongs.
|
type |
No |
String |
Object type. Options:
|
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. Create a desktop in the specified AZ. If this parameter is not specified, the default AZ is used. |
product_id |
Yes |
String |
Package ID. |
flavor_id |
No |
String |
Product specification ID. This parameter is mandatory when the AZ is an edge AZ. |
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 SecurityGroup 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 |
Tags. |
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. |
resource_spec_code |
No |
String |
Specifications. |
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. |
user_group |
Yes |
String |
Specifies the user permission group to which the desktop user belongs.
|
created_at |
No |
String |
Creation time. The value is in UTC format, for example, 2022-05-11T11:45:42.000Z. |
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 |
When the number of idle desktops is less than the value of this parameter, desktops are automatically created. |
once_auto_created |
No |
Integer |
Number of desktops that can be automatically created at a time. |
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 User 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 description. |
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 description. |
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, 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