Data Structure for Creating ECSs
Notes
ECS APIs can be of V1 or V1.1. V1 APIs can only be used to create pay-per-use ECSs, while V1.1 APIs can be used to create both pay-per-use and yearly/monthly ECSs.
For the fields described in this section, use V1.1 APIs for yearly/monthly ECSs.
Contents
- publicip Field Description
- security_groups Field Description
- eip Field Description
- bandwidth Field Description
- ipv6_bandwidth Field Description
- extendparam Field Description for Assigning EIPs
- extendparam Field Description for Creating Disks
- extendparam Field Description for Creating ECSs
- metadata Field Description for Creating Disks
- metadata Field Description for Creating ECSs
- os:scheduler_hints Field Description
- server_tags Field Description
publicip Field Description
- Creating ECSs /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
id |
No |
String |
Specifies the ID of the existing EIP assigned to the ECS to be created. The value is in UUID format. Only EIPs in DOWN state can be assigned. |
eip |
No |
Object |
Specifies an EIP that will be automatically assigned to an ECS. For details, see Table 3. |
delete_on_termination |
No |
Boolean |
Specifies whether the EIP is released when the ECS where the EIP is bound is deleted.
The default value is false.
NOTE:
This parameter is available only for pay-per-use EIPs. |
Either id or eip in the publicip field can be configured.
security_groups Field Description
This field is used by the following APIs:
- Creating ECSs /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
id |
No |
String |
Specifies the ID of the security group to which an ECS is to be added. The configuration will take effect on the NICs of the ECS. You need to specify the ID of an existing security group in UUID format. Otherwise, the default security group will be used at the underlying layer. |
eip Field Description
- Creating ECSs /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
iptype |
Yes |
String |
Specifies the EIP type. For details, see the publicip field description in Assigning an EIP. |
bandwidth |
Yes |
Object |
Specifies the bandwidth of an EIP. For details, see bandwidth Field Description. |
bandwidth Field Description
- Creating ECSs /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
size |
No |
Integer |
Specifies the bandwidth size. Specifies the bandwidth (Mbit/s). The value ranges from 1 to 300. The specific range may vary depending on the configuration in each region. You can see the bandwidth range of each region on the management console.
The minimum increment for bandwidth adjustment varies depending on the bandwidth range.
NOTE:
This parameter is mandatory when sharetype is set to PER and is optional when sharetype is set to WHOLE with an ID specified. |
sharetype |
Yes |
String |
Specifies the bandwidth sharing type. Enumerated values: PER (indicates exclusive bandwidth) and WHOLE (indicates sharing) |
chargemode |
No |
String |
Specifies the bandwidth billing mode.
|
ipv6_bandwidth Field Description
- Creating ECSs: /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
id |
No |
String |
Specifies the ID of an IPv6 bandwidth. |
extendparam Field Description for Assigning EIPs
This field is used by the following API:
Creating ECSs /v1.1/{project_id}/cloudservers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
chargingMode |
No |
String |
Specifies the billing mode of an EIP. Options:
|
extendparam Field Description for Creating Disks
This field is used by the following APIs:
- Creating ECSs /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
resourceSpecCode |
No |
String |
Specifies the code of the disk specifications, such as SATA, SAS, or SSD.
NOTE:
This field has been discarded. |
resourceType |
No |
String |
Specifies the resource type.
NOTE:
This field has been discarded. |
snapshotId |
No |
String |
Specifies the snapshot ID or ID of the original data disk contained in the full-ECS image. Application scenarios: This parameter is used if an ECS is created using a full-ECS image, and the image contains one or more data disks. If you use a full-ECS image to create an ECS, the system automatically restores the data type and data from the data disks in the image. The snapshotId parameter allows you to specify the disk type for the original data disk after restoration.
NOTE:
Working rules: snapshotId uniquely identifies an original data disk contained in a full-ECS image. You can use snapshotId to obtain the information of the original data disk for data restoration. Obtaining snapshotId through the management console: Log in to the management console, choose Elastic Volume Service > Snapshot. Then, use the name of the original data disk to find the snapshot ID or the original disk ID. Obtaining snapshotId through the API:
If you have obtained the full-ECS image ID, obtain the Cloud Backup and Recovery (CBR) or Cloud Server Backup Service (CSBS) backup ID associated with the full-ECS image ID by following the instructions provided in the API for querying image details.
|
extendparam Field Description for Creating ECSs
- Creating ECSs /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
chargingMode |
No |
Integer |
Specifies the billing mode.
|
regionID |
No |
String |
Specifies the ID of the region where the ECS resides. |
support_auto_recovery |
No |
Boolean |
Specifies whether automatic recovery is enabled on the ECS.
NOTE:
This parameter is of boolean type. If a non-boolean character is imported, the parameter value is set to false. When support_auto_recovery is set to false and "cond:compute": autorecovery is unavailable in the flavor, automatic recovery is not supported. When support_auto_recovery is set to false and "cond:compute": autorecovery is available in the flavor, automatic recovery is supported. You can query whether "cond:compute": autorecovery is available in the flavor by referring to Querying Details About Flavors and Extended Flavor Information. |
marketType |
No |
String |
Specifies a spot ECS. When creating a spot ECS, set the parameter value to spot.
NOTE:
This parameter takes effect only when chargingMode is set to 0 and marketType is set to spot. |
spotPrice |
No |
String |
Specifies the highest price per hour you accept for a spot ECS.
NOTE:
|
diskPrior |
No |
String |
Specifies whether to support the function of creating a disk and then ECS.
|
spot_duration_hours |
No |
Integer |
Specifies the predefined duration of the spot ECS.
NOTE:
|
spot_duration_count |
No |
Integer |
Specifies the number of durations.
NOTE:
|
interruption_policy |
No |
String |
Specifies the spot ECS interruption policy. The parameter can only be set to immediate currently, meaning that the spot ECSs are released immediately.
NOTE:
This parameter must be set to immediate for spot block ECSs. |
CB_CSBS_BACKUP |
No |
String |
Specifies a CSBS policy ID and CSBS vault ID. For example, a CSBS policy ID obtained on the console is fdcaa27d-5be4-4f61-afe3-09ff79162c04. A CSBS vault ID is 332a9408-463f-436a-9e92-78dad95d1ac4. The CB_CSBS_BACKUP value is "{\"policy_id\":\"fdcaa27d-5be4-4f61-afe3-09ff79162c04\",\"vault_id\":\"332a9408-463f-436a-9e92-78dad95d1ac4\"}". |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
chargingMode |
No |
String |
Specifies the billing mode. Options:
|
regionID |
No |
String |
Specifies the ID of the region where the ECS resides. |
periodType |
No |
String |
Specifies the subscription period. Options:
|
periodNum |
No |
Integer |
Specifies the number of subscription periods. Options:
|
isAutoRenew |
No |
String |
Specifies whether auto renew is enabled.
|
isAutoPay |
No |
String |
Specifies whether the order is automatically or manually paid.
NOTE:
This parameter is valid when chargingMode is set to prePaid. If this parameter is not specified, the order must be manually paid by default. |
support_auto_recovery |
No |
Boolean |
Specifies whether to enable automatic ECS recovery.
NOTE:
This parameter is of boolean type. If a non-boolean character is imported, the parameter value is set to false. |
marketType |
No |
String |
Specifies a spot ECS. When creating a spot ECS, set the parameter value to spot.
NOTE:
This parameter takes effect only when chargingMode is set to postPaid and marketType is set to spot. |
spotPrice |
No |
String |
Specifies the highest price per hour you accept for a spot ECS.
NOTE:
|
metadata Field Description for Creating Disks
This field is used by the following APIs:
- Creating ECSs /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
__system__encrypted |
No |
String |
Specifies encryption in metadata. The value can be 0 (encryption disabled) or 1 (encryption enabled). If this parameter does not exist, the disk will not be encrypted by default. |
__system__cmkid |
No |
String |
Specifies the CMK ID, which indicates encryption in metadata. This parameter is used with __system__encrypted.
NOTE:
For details about how to obtain the CMK ID, see Querying the List of CMKs. |
metadata Field Description for Creating ECSs
This field is used by the following APIs:
- Creating ECSs /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
op_svc_userid |
No |
String |
Specifies the user ID.
NOTE:
When chargingMode in the extendparam parameter is set to prePaid (indicating that the created ECS is billed in yearly/monthly payments) and the ECS is logged in using an SSH key, this field is mandatory. |
agency_name |
No |
String |
Specifies the IAM agency name. An agency is created by a tenant administrator on Identity and Access Management (IAM) to provide temporary credentials for ECSs to access cloud services. |
os:scheduler_hints Field Description
- Creating ECSs /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
- Creating ECSs (native API): /v2.1/{project_id}/servers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
group |
No |
String |
Specifies an ECS group ID, which is in UUID format. Obtain the parameter value from the console or by performing operations provided in Querying ECS Groups.
NOTE:
Ensure that the ECS group uses the anti-affinity policy. You are not advised to use other policies. |
tenancy |
No |
String |
Creates ECSs on a dedicated or shared host. The value of this parameter can be dedicated or shared. |
dedicated_host_id |
No |
String |
Specifies the dedicated host ID.
NOTE:
A DeH ID takes effect only when tenancy is set to dedicated. |
Parameter |
Type |
Description |
---|---|---|
group |
Array of strings |
Specifies an ECS group ID, which is in UUID format. Obtain the parameter value from the console or by performing operations provided in Querying ECS Groups. |
tenancy |
Array of strings |
Creates ECSs on a dedicated or shared host. The value of this parameter can be dedicated or shared. |
dedicated_host_id |
Array of strings |
Specifies the dedicated host ID.
NOTE:
A DeH ID takes effect only when tenancy is set to dedicated. |
server_tags Field Description
- Creating ECSs: /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Specifies the tag key. The key can contain a maximum of 36 Unicode characters. It cannot be left blank, or contain ASCII (0-31) or the following characters: =*<>\,|/ The tag key of an ECS must be unique. |
value |
Yes |
String |
Specifies the tag value. The value can contain a maximum of 43 Unicode characters and can be left blank. It cannot contain ASCII (0-31) or the following characters: =*<>\,|/ |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.