Creates one or more pay-as-you-go or subscription Edge Node Service (ENS) instances.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ens:RunInstances | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
InstanceType | string | Yes | The instance type. | ens.sn1.small |
InstanceChargeType | string | Yes | The billing method of the instance. Valid values:
| PostPaid |
ImageId | string | No | The ID of the image. For ARM PCB-based server instances, leave this parameter empty. For other instances, this parameter is required. | m-5si16wo6simkt267p8b7hcmy3 |
NetDistrictCode | string | No | The code of the region. Note
This parameter is not available if ScheduleAreaLevel is set to Region and is required if ScheduleAreaLevel is set to other values.
| 350000 |
Carrier | string | No | The Internet service provider (ISP). Note
This parameter is not available if ScheduleAreaLevel is set to Region and is required if ScheduleAreaLevel is set to other values.
| telecom |
ScheduleAreaLevel | string | Yes | The scheduling level. This parameter specifies area-level scheduling or node-level scheduling. Valid values:
| Region |
SchedulingStrategy | string | No | The scheduling policy of the taint. Valid values:
Note
If ScheduleAreaLevel is set to Region, set this parameter to Concentrate. If ScheduleAreaLevel is set to other values, set this parameter to Concentrate or Disperse based on your business requirements.
| concentrate |
EnsRegionId | string | No | The ID of the node. Note
This parameter is required if ScheduleAreaLevel is set to Region and is not available if ScheduleAreaLevel is set to other values.
| cn-foshan-telecom |
Password | string | No | The password that is used to connect to the instance. Note
You need to specify at least one of Password, KeyPairName, and PasswordInherit.
| testPassword |
KeyPairName | string | No | The name of the key pair. Note
You need to specify at least one of Password, KeyPairName, and PasswordInherit.
| wx2-jumpserver |
InternetChargeType | string | No | The bandwidth billing method. Valid values:
Note
This parameter is required if you purchase an ENS instance for the first time. The value that you specified is used as the default value for subsequent purchases.
| BandwidthByDay |
SystemDisk | object | No | The specification of the system disk. | |
Size | long | No | The size of the system disk. Unit: GiB. | 50 |
Category | string | No | The category of the system disk. | local_ssd |
DataDisk | array<object> | No | The specifications of data disks. | |
object | No | The data disks. | ||
Size | long | No | The size of a data disk. Unit: GiB. | 20 |
Category | string | No | The category of the disk. Valid values:
| cloud_efficiency |
Encrypted | boolean | No | Indicates whether the cloud disk is encrypted. Valid values:
| false |
KMSKeyId | string | No | The ID of the Key Management Service (KMS) key that is used for the disk. Valid values:
Note
If you set the Encrypted parameter to true, the default service key is used when the KMSKeyId parameter is empty.
| false |
Period | long | No | The unit of the subscription period.
| 1-9,12 |
InternetMaxBandwidthOut | long | Yes | The maximum public bandwidth. If the value of this parameter is greater than 0, a public IP address is assigned to the instance. | 1 |
Amount | long | Yes | The number of instances that you want to create. Valid values: 1 to 100. | 1 |
NetWorkId | string | No | The ID of the network. Note
This parameter is available only if ScheduleAreaLevel is set to Region and cannot be configured if ScheduleAreaLevel is set to other values. Otherwise, an error occurs.
| net-id |
VSwitchId | string | No | The ID of the vSwitch. Note
This parameter is available only if ScheduleAreaLevel is set to Region and cannot be configured if ScheduleAreaLevel is set to other values. Otherwise, an error occurs.
| vsw-5sagnw7m613oulalkd10nv0ob |
SecurityId | string | No | The ID of security group. | sg-test |
HostName | string | No | The name of the host. | test-HostName |
InstanceName | string | No | The name of the instance. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with The default value of this parameter is the value of the InstanceId parameter. | TestName |
UniqueSuffix | boolean | No | Specifies whether to append sequential suffixes to the hostname specified by the HostName parameter and to the instance name specified by the InstanceName parameter. The sequential suffixes range from 001 to 999. | True |
UserData | string | No | The custom data. The maximum data size is 16 KB. You can specify UserData. UserData must be Base64-encoded. | ZWtest |
AutoRenew | boolean | No | Specifies whether to enable auto-renewal. Valid values:
Note
This parameter is not available when InstanceChargeType is set to PostPaid.
| true |
SchedulingPriceStrategy | string | No | The scheduling price policy. Valid values:
| PriceHighPriority |
PrivateIpAddress | string | No | The private IP address. Note
This parameter is available only if ScheduleAreaLevel is set to Region and cannot be configured if ScheduleAreaLevel is set to other values. Otherwise, an error occurs. If you specify a private IP address, the number of instances must be 1. The private IP address takes effect only when the private IP address and the vSwitch ID are not empty.
| 10.0.0.120 |
PeriodUnit | string | No | The unit of the subscription period. Valid values:
| Month |
PublicIpIdentification | boolean | No | Specifies whether to enable public IP address identification. Valid values: true and false. Default value: false. | true |
PasswordInherit | boolean | No | Specifies whether to use the preset password of the image. Valid values:
Note
You need to specify at least one of Password, KeyPairName, and PasswordInherit.
| false |
InstanceChargeStrategy | string | No | The billing policy of the instance. Valid values:
| instance |
BillingCycle | string | No | The billing cycle of computing resources of the instance. Only pay-as-you-go instances are supported. Valid values:
| Day |
IpType | string | No | The type of the IP address. Valid values:
| ipv4 |
AutoUseCoupon | string | No | Specifies whether to use coupons. Default value: true. | true |
Tag | array<object> | No | The tags. | |
object | No | The tags. | ||
Key | string | No | The key of the tag. | team |
Value | string | No | The value of the tag. | tagValue |
AutoReleaseTime | string | No | The time when to automatically release the pay-as-you-go instance. Specify the time in the ISO 8601 standard in the
| 2023-06-28T14:38:52Z |
SpotStrategy | string | No | The bidding policy for the pay-as-you-go instance. This parameter is valid only when the
Default value: NoSpot. | SpotAsPriceGo |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "91E4AFBE-4E35-5D2A-A886-BB477C9953D2",
"InstanceIds": [
"['i-5xxxx26dix05koz15l5413j25o', 'i-5sdmxxxx']"
],
"OrderId": "213177957850399"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | Invalid%s | The specified parameter %s is invalid. | - |
400 | Missing%s | You must specify the parameter %s. | - |
400 | SaleControlVerificationFailedInstanceDistrict | The regional sales constraint verification failed, please re-match or contact the product. | Regional sales constraint verification failed, please re-match |
400 | ens.interface.error | Failed to call API. | - |
400 | NoPermission | Permission denied. | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-06-28 | The Error code has changed | View Change Details |
2024-04-09 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2024-01-25 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-11-07 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-10-19 | The Error code has changed | View Change Details |
2023-10-17 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-07-27 | The Error code has changed | View Change Details |
2023-07-27 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-06-13 | The Error code has changed | View Change Details |
2023-06-08 | The Error code has changed | View Change Details |
2023-05-10 | The Error code has changed. The request parameters of the API has changed | View Change Details |