All Products
Search
Document Center

ENS:RunInstances

Last Updated:Jul 26, 2024

Creates one or more pay-as-you-go or subscription Edge Node Service (ENS) instances.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
ens:RunInstancescreate
  • Instance
    acs:ens:*:{#accountId}:instance/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceTypestringYes

The instance type.

ens.sn1.small
InstanceChargeTypestringYes

The billing method of the instance. Valid values:

  • PrePaid: subscription.
  • PostPaid: pay-as-you-go.
PostPaid
ImageIdstringNo

The ID of the image. For ARM PCB-based server instances, leave this parameter empty. For other instances, this parameter is required.

m-5si16wo6simkt267p8b7hcmy3
NetDistrictCodestringNo

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
CarrierstringNo

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
ScheduleAreaLevelstringYes

The scheduling level. This parameter specifies area-level scheduling or node-level scheduling. Valid values:

  • Big: greater area
  • Middle: province
  • Small: city
  • Region: node
Region
SchedulingStrategystringNo

The scheduling policy of the taint. Valid values:

  • Concentrate
  • Disperse
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
EnsRegionIdstringNo

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
PasswordstringNo

The password that is used to connect to the instance.

Note You need to specify at least one of Password, KeyPairName, and PasswordInherit.
testPassword
KeyPairNamestringNo

The name of the key pair.

Note You need to specify at least one of Password, KeyPairName, and PasswordInherit.
wx2-jumpserver
InternetChargeTypestringNo

The bandwidth billing method. Valid values:

  • BandwidthByDay: pay by daily peak bandwidth
  • 95BandwidthByMonth: pay by monthly 95th percentile bandwidth
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
SystemDiskobjectNo

The specification of the system disk.

SizelongNo

The size of the system disk. Unit: GiB.

50
CategorystringNo

The category of the system disk.

local_ssd
DataDiskarray<object>No

The specifications of data disks.

objectNo

The data disks.

SizelongNo

The size of a data disk. Unit: GiB.

20
CategorystringNo

The category of the disk. Valid values:

  • cloud_efficiency: ultra disk.
  • cloud_ssd: all-flash disk.
  • local_hdd: local HDD.
  • local_ssd: local SSD.
cloud_efficiency
EncryptedbooleanNo

Indicates whether the cloud disk is encrypted. Valid values:

  • true.
  • false (default).
false
KMSKeyIdstringNo

The ID of the Key Management Service (KMS) key that is used for the disk. Valid values:

  • true.
  • false (default).
Note If you set the Encrypted parameter to true, the default service key is used when the KMSKeyId parameter is empty.
false
PeriodlongNo

The unit of the subscription period.

  • If PeriodUnit is set to Day, Period can only be set to 3.
  • If PeriodUnit is Month, Period can be set to 1 to 9 or 12.
1-9,12
InternetMaxBandwidthOutlongYes

The maximum public bandwidth. If the value of this parameter is greater than 0, a public IP address is assigned to the instance.

1
AmountlongYes

The number of instances that you want to create. Valid values: 1 to 100.

1
NetWorkIdstringNo

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
VSwitchIdstringNo

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
SecurityIdstringNo

The ID of security group.

sg-test
HostNamestringNo

The name of the host.

test-HostName
InstanceNamestringNo

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 http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).

The default value of this parameter is the value of the InstanceId parameter.

TestName
UniqueSuffixbooleanNo

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
UserDatastringNo

The custom data. The maximum data size is 16 KB. You can specify UserData. UserData must be Base64-encoded.

ZWtest
AutoRenewbooleanNo

Specifies whether to enable auto-renewal. Valid values:

  • true.
  • false (default).
Note This parameter is not available when InstanceChargeType is set to PostPaid.
true
SchedulingPriceStrategystringNo

The scheduling price policy. Valid values:

  • PriceHighPriority: The high price prevails.
  • PriceLowPriority: The low price prevails.
PriceHighPriority
PrivateIpAddressstringNo

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
PeriodUnitstringNo

The unit of the subscription period. Valid values:

  • Month (default).
  • Day.
Month
PublicIpIdentificationbooleanNo

Specifies whether to enable public IP address identification. Valid values: true and false. Default value: false.

true
PasswordInheritbooleanNo

Specifies whether to use the preset password of the image. Valid values:

  • true
  • false
Note You need to specify at least one of Password, KeyPairName, and PasswordInherit.
false
InstanceChargeStrategystringNo

The billing policy of the instance. Valid values:

  • instance: Bills are generated based on instances.
  • If you do not specify this parameter, bills are generated based on users.
instance
BillingCyclestringNo

The billing cycle of computing resources of the instance. Only pay-as-you-go instances are supported. Valid values:

  • Day.
  • Month.
Day
IpTypestringNo

The type of the IP address. Valid values:

  • ipv4 (default).
  • ipv6.
  • ipv4Andipv6.
ipv4
AutoUseCouponstringNo

Specifies whether to use coupons. Default value: true.

true
Tagarray<object>No

The tags.

objectNo

The tags.

KeystringNo

The key of the tag.

team
ValuestringNo

The value of the tag.

tagValue
AutoReleaseTimestringNo

The time when to automatically release the pay-as-you-go instance. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in Coordinated Universal Time (UTC).

  • If the value of ss is not 00, the start time is automatically rounded down to the nearest minute based on the value of mm.
  • The specified time must be at least one hour later than the current time.
2023-06-28T14:38:52Z
SpotStrategystringNo

The bidding policy for the pay-as-you-go instance. This parameter is valid only when the InstanceChargeType parameter is set to PostPaid. Valid values:

  • NoSpot: The instance is created as a regular pay-as-you-go instance.
  • SpotAsPriceGo: The instance is a preemptible instance for which the market price at the time of purchase is automatically used as the bidding price.

Default value: NoSpot.

SpotAsPriceGo

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

91E4AFBE-4E35-5D2A-A886-BB477C9953D2
InstanceIdsarray

The IDs of instances.

string

The list of instance IDs.

['i-5xxxx26dix05koz15l5413j25o', 'i-5sdmxxxx']
OrderIdstring

The order ID.

213177957850399

Examples

Sample success responses

JSONformat

{
  "RequestId": "91E4AFBE-4E35-5D2A-A886-BB477C9953D2",
  "InstanceIds": [
    "['i-5xxxx26dix05koz15l5413j25o', 'i-5sdmxxxx']"
  ],
  "OrderId": "213177957850399"
}

Error codes

HTTP status codeError codeError messageDescription
400Invalid%sThe specified parameter %s is invalid.-
400Missing%sYou must specify the parameter %s.-
400SaleControlVerificationFailedInstanceDistrictThe regional sales constraint verification failed, please re-match or contact the product.Regional sales constraint verification failed, please re-match
400ens.interface.errorFailed to call API.-
400NoPermissionPermission denied.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-06-28The Error code has changedView Change Details
2024-04-09The Error code has changed. The request parameters of the API has changedView Change Details
2024-01-25The Error code has changed. The request parameters of the API has changedView Change Details
2023-11-07The Error code has changed. The request parameters of the API has changedView Change Details
2023-10-19The Error code has changedView Change Details
2023-10-17The Error code has changed. The request parameters of the API has changedView Change Details
2023-07-27The Error code has changedView Change Details
2023-07-27The Error code has changed. The request parameters of the API has changedView Change Details
2023-06-13The Error code has changedView Change Details
2023-06-08The Error code has changedView Change Details
2023-05-10The Error code has changed. The request parameters of the API has changedView Change Details