public static final class RunInstancesRequest.Builder extends Object
限定符和类型 | 方法和说明 |
---|---|
RunInstancesRequest.Builder |
affinity(String affinity)
Specifies whether to associate an instance on a dedicated host with the dedicated host.
|
RunInstancesRequest.Builder |
amount(Integer amount)
The desired number of ECS instances that you want to create.
|
RunInstancesRequest.Builder |
arn(List<RunInstancesRequest.Arn> arn)
> This parameter is not publicly available.
|
RunInstancesRequest.Builder |
autoPay(Boolean autoPay)
Specifies whether to automatically complete the payment for instance creation.
|
RunInstancesRequest.Builder |
autoReleaseTime(String autoReleaseTime)
The time when to automatically release the pay-as-you-go instance.
|
RunInstancesRequest.Builder |
autoRenew(Boolean autoRenew)
Specifies whether to enable auto-renewal for the instance.
|
RunInstancesRequest.Builder |
autoRenewPeriod(Integer autoRenewPeriod)
The auto-renewal period of the instance.
|
RunInstancesRequest |
build() |
RunInstancesRequest.Builder |
clientToken(String clientToken)
The client token that is used to ensure the idempotence of the request.
|
RunInstancesRequest.Builder |
cpuOptions(RunInstancesRequest.CpuOptions cpuOptions)
CpuOptions.
|
RunInstancesRequest.Builder |
creditSpecification(String creditSpecification)
The performance mode of the burstable instance.
|
RunInstancesRequest.Builder |
dataDisk(List<RunInstancesRequest.DataDisk> dataDisk)
The data disks.
|
RunInstancesRequest.Builder |
dedicatedHostId(String dedicatedHostId)
The ID of the dedicated host on which to create the instance.
|
RunInstancesRequest.Builder |
deletionProtection(Boolean deletionProtection)
Specifies whether to enable release protection for the instance.
|
RunInstancesRequest.Builder |
deploymentSetGroupNo(Integer deploymentSetGroupNo)
The number of the deployment set group to which to deploy the instance.
|
RunInstancesRequest.Builder |
deploymentSetId(String deploymentSetId)
The ID of the deployment set to which to deploy the instance.
|
RunInstancesRequest.Builder |
description(String description)
The description of the instance.
|
RunInstancesRequest.Builder |
dryRun(Boolean dryRun)
Specifies whether to check the validity of the request without actually making the request.
|
RunInstancesRequest.Builder |
hibernationOptions(RunInstancesRequest.HibernationOptions hibernationOptions)
HibernationOptions.
|
RunInstancesRequest.Builder |
hostName(String hostName)
The hostname of the instance.
|
RunInstancesRequest.Builder |
hostNames(List<String> hostNames)
The hostname of instance N.
|
RunInstancesRequest.Builder |
hpcClusterId(String hpcClusterId)
The ID of the high performance computing (HPC) cluster to which the instance belongs.
|
RunInstancesRequest.Builder |
httpEndpoint(String httpEndpoint)
Specifies whether to enable the access channel for instance metadata.
|
RunInstancesRequest.Builder |
httpPutResponseHopLimit(Integer httpPutResponseHopLimit)
The HTTP PUT response hop limit for accessing instance metadata.
|
RunInstancesRequest.Builder |
httpTokens(String httpTokens)
Specifies whether to forcefully use the security-enhanced mode (IMDSv2) to access instance metadata.
|
RunInstancesRequest.Builder |
imageFamily(String imageFamily)
The name of the image family.
|
RunInstancesRequest.Builder |
imageId(String imageId)
The ID of the image.
|
RunInstancesRequest.Builder |
imageOptions(RunInstancesRequest.ImageOptions imageOptions)
Details about the image options.
|
RunInstancesRequest.Builder |
instanceChargeType(String instanceChargeType)
The billing method of the instance.
|
RunInstancesRequest.Builder |
instanceName(String instanceName)
The name of the instance.
|
RunInstancesRequest.Builder |
instanceType(String instanceType)
The instance type.
|
RunInstancesRequest.Builder |
internetChargeType(String internetChargeType)
The billing method for network usage.
|
RunInstancesRequest.Builder |
internetMaxBandwidthIn(Integer internetMaxBandwidthIn)
The maximum inbound public bandwidth.
|
RunInstancesRequest.Builder |
internetMaxBandwidthOut(Integer internetMaxBandwidthOut)
The maximum outbound public bandwidth.
|
RunInstancesRequest.Builder |
ioOptimized(String ioOptimized)
Specifies whether the instance is I/O optimized.
|
RunInstancesRequest.Builder |
ipv6Address(List<String> ipv6Address)
IPv6 address N to be assigned to the primary ENI.
|
RunInstancesRequest.Builder |
ipv6AddressCount(Integer ipv6AddressCount)
The number of IPv6 addresses to randomly generate for the primary ENI.
|
RunInstancesRequest.Builder |
isp(String isp)
> This parameter is in invitational preview and is unavailable.
|
RunInstancesRequest.Builder |
keyPairName(String keyPairName)
The name of the key pair.
|
RunInstancesRequest.Builder |
launchTemplateId(String launchTemplateId)
The ID of the launch template.
|
RunInstancesRequest.Builder |
launchTemplateName(String launchTemplateName)
The name of the launch template.
|
RunInstancesRequest.Builder |
launchTemplateVersion(Long launchTemplateVersion)
The version of the launch template.
|
RunInstancesRequest.Builder |
minAmount(Integer minAmount)
The minimum number of ECS instances that you want to create.
|
RunInstancesRequest.Builder |
networkInterface(List<RunInstancesRequest.NetworkInterface> networkInterface)
The information of the elastic network interfaces (ENIs).
|
RunInstancesRequest.Builder |
networkInterfaceQueueNumber(Integer networkInterfaceQueueNumber)
The number of queues supported by the primary ENI.
|
RunInstancesRequest.Builder |
networkOptions(RunInstancesRequest.NetworkOptions networkOptions)
Details about network options.
|
RunInstancesRequest.Builder |
ownerAccount(String ownerAccount)
OwnerAccount.
|
RunInstancesRequest.Builder |
ownerId(Long ownerId)
OwnerId.
|
RunInstancesRequest.Builder |
password(String password)
The password of the instance.
|
RunInstancesRequest.Builder |
passwordInherit(Boolean passwordInherit)
Specifies whether to use the password preset in the image.
|
RunInstancesRequest.Builder |
period(Integer period)
The subscription period of the instance.
|
RunInstancesRequest.Builder |
periodUnit(String periodUnit)
The unit of the subscription period.
|
RunInstancesRequest.Builder |
privateDnsNameOptions(RunInstancesRequest.PrivateDnsNameOptions privateDnsNameOptions)
> This parameter is in invitational preview and is not publicly available.
|
RunInstancesRequest.Builder |
privateIpAddress(String privateIpAddress)
The private IP address to assign to the instance.
|
RunInstancesRequest.Builder |
privatePoolOptions(RunInstancesRequest.PrivatePoolOptions privatePoolOptions)
PrivatePoolOptions.
|
RunInstancesRequest.Builder |
ramRoleName(String ramRoleName)
The name of the Resource Access Management (RAM) role.
|
RunInstancesRequest.Builder |
regionId(String regionId)
The ID of the region in which to create the instance.
|
RunInstancesRequest.Builder |
resourceGroupId(String resourceGroupId)
The ID of the resource group to which to assign the instance.
|
RunInstancesRequest.Builder |
resourceOwnerAccount(String resourceOwnerAccount)
ResourceOwnerAccount.
|
RunInstancesRequest.Builder |
resourceOwnerId(Long resourceOwnerId)
ResourceOwnerId.
|
RunInstancesRequest.Builder |
schedulerOptions(RunInstancesRequest.SchedulerOptions schedulerOptions)
SchedulerOptions.
|
RunInstancesRequest.Builder |
securityEnhancementStrategy(String securityEnhancementStrategy)
Specifies whether to enable security hardening.
|
RunInstancesRequest.Builder |
securityGroupId(String securityGroupId)
The ID of the security group to which you want to assign the instance.
|
RunInstancesRequest.Builder |
securityGroupIds(List<String> securityGroupIds)
The ID of security group N to which to assign the instance.
|
RunInstancesRequest.Builder |
securityOptions(RunInstancesRequest.SecurityOptions securityOptions)
SecurityOptions.
|
RunInstancesRequest.Builder |
sourceRegionId(String sourceRegionId)
SourceRegionId.
|
RunInstancesRequest.Builder |
spotDuration(Integer spotDuration)
The protection period of the preemptible instance.
|
RunInstancesRequest.Builder |
spotInterruptionBehavior(String spotInterruptionBehavior)
The interruption mode of the preemptible instance.
|
RunInstancesRequest.Builder |
spotPriceLimit(Float spotPriceLimit)
The maximum hourly price of the instance.
|
RunInstancesRequest.Builder |
spotStrategy(String spotStrategy)
The bidding policy for the pay-as-you-go instance.
|
RunInstancesRequest.Builder |
storageSetId(String storageSetId)
The ID of the storage set.
|
RunInstancesRequest.Builder |
storageSetPartitionNumber(Integer storageSetPartitionNumber)
The maximum number of partitions in the storage set.
|
RunInstancesRequest.Builder |
systemDisk(RunInstancesRequest.SystemDisk systemDisk)
SystemDisk.
|
RunInstancesRequest.Builder |
tag(List<RunInstancesRequest.Tag> tag)
The tags to add to the instance, disks, and primary ENI.
|
RunInstancesRequest.Builder |
tenancy(String tenancy)
Specifies whether to create the instance on a dedicated host.
|
RunInstancesRequest.Builder |
uniqueSuffix(Boolean uniqueSuffix)
Specifies whether to automatically append incremental suffixes to the hostname specified by the `HostName` parameter and to the instance name specified by the `InstanceName` parameter when you batch create instances.
|
RunInstancesRequest.Builder |
userData(String userData)
The user data of the instance.
|
RunInstancesRequest.Builder |
vSwitchId(String vSwitchId)
The ID of the vSwitch to which to connect to the instance.
|
RunInstancesRequest.Builder |
zoneId(String zoneId)
The ID of the zone in which to create the instance.
|
public RunInstancesRequest.Builder cpuOptions(RunInstancesRequest.CpuOptions cpuOptions)
public RunInstancesRequest.Builder hibernationOptions(RunInstancesRequest.HibernationOptions hibernationOptions)
public RunInstancesRequest.Builder privatePoolOptions(RunInstancesRequest.PrivatePoolOptions privatePoolOptions)
public RunInstancesRequest.Builder schedulerOptions(RunInstancesRequest.SchedulerOptions schedulerOptions)
public RunInstancesRequest.Builder securityOptions(RunInstancesRequest.SecurityOptions securityOptions)
public RunInstancesRequest.Builder systemDisk(RunInstancesRequest.SystemDisk systemDisk)
public RunInstancesRequest.Builder sourceRegionId(String sourceRegionId)
public RunInstancesRequest.Builder affinity(String affinity)
* default: does not associate the instance with the dedicated host. When you start an instance that was stopped in economical mode, the instance is automatically deployed to another dedicated host in the automatic deployment resource pool if the available resources of the original dedicated host are insufficient. * host: associates the instance with the dedicated host. When you start an instance that was stopped in economical mode, the instance remains on the original dedicated host. If the available resources of the original dedicated host are insufficient, the instance cannot be started. Default value: default.
public RunInstancesRequest.Builder amount(Integer amount)
The number of ECS instances that can be created varies based on the Amount and MinAmount values. * If you do not specify MinAmount, the RunInstances operation creates ECS instances based on the Amount value. If the available resources are insufficient to create the desired number of ECS instances, the RunInstances operation returns an error response and no ECS instances are created. * If you specify MinAmount, take note of the following items: * If the available resources are insufficient to create the minimum number of ECS instances, no ECS instances are created and the RunInstances operation returns an error response. * If the available resources are insufficient to create the desired number of ECS instances but are sufficient to create the minimum number of ECS instances, the RunInstances operation uses the available resources to create ECS instances and returns a success response. In this case, the number of ECS instances that can be created is less than the desired number of ECS instances. * If the available resources are sufficient to create the desired number of ECS instances, the RunInstances operation uses the available resources to create the desired number of ECS instances and returns a success response. Default value: 1.
public RunInstancesRequest.Builder arn(List<RunInstancesRequest.Arn> arn)
public RunInstancesRequest.Builder autoPay(Boolean autoPay)
* true: The payment is automatically completed. ** **Note** Make sure that your account balance is sufficient. Otherwise, your order becomes invalid and is canceled. If your account balance is insufficient, you can set `AutoPay` to `false` to generate an unpaid order. Then, you can log on to the ECS console to pay for the order. * false: An order is generated but no payment is made. ** **Note** When `InstanceChargeType` is set to `PostPaid`, `AutoPay` cannot be set to `false`. Default value: true.
public RunInstancesRequest.Builder autoReleaseTime(String autoReleaseTime)
* If the value of seconds (`ss`) is not `00`, the start time is automatically rounded to the nearest minute based on the value of minutes (`mm`). * The specified time must be at least 30 minutes later than the current time. * The specified time can be at most three years later than the current time.
public RunInstancesRequest.Builder autoRenew(Boolean autoRenew)
* true: enables auto-renewal. * false: does not enable auto-renewal. Default value: false.
public RunInstancesRequest.Builder autoRenewPeriod(Integer autoRenewPeriod)
* Valid values when PeriodUnit is set to Week: 1, 2, and 3. * Valid values when PeriodUnit is set to Month: 1, 2, 3, 6, 12, 24, 36, 48, and 60. Default value: 1.
public RunInstancesRequest.Builder clientToken(String clientToken)
public RunInstancesRequest.Builder creditSpecification(String creditSpecification)
* Standard: the standard mode. For more information, see the "Standard mode" section in [Overview of burstable instances](~~59977~~). * Unlimited: the unlimited mode. For more information, see the "Unlimited mode" section in [Burstable instances](~~59977~~).
public RunInstancesRequest.Builder dataDisk(List<RunInstancesRequest.DataDisk> dataDisk)
public RunInstancesRequest.Builder dedicatedHostId(String dedicatedHostId)
You can call the [DescribeDedicatedHosts](~~134242~~) operation to query the list of dedicated host IDs.
public RunInstancesRequest.Builder deletionProtection(Boolean deletionProtection)
* true: enables release protection for the instance. * false: disables release protection for the instance. Default value: false. > This parameter is applicable to only pay-as-you-go instances. It can protect instances against manual releases, but not against automatic releases.
public RunInstancesRequest.Builder deploymentSetGroupNo(Integer deploymentSetGroupNo)
public RunInstancesRequest.Builder deploymentSetId(String deploymentSetId)
public RunInstancesRequest.Builder description(String description)
public RunInstancesRequest.Builder dryRun(Boolean dryRun)
* true: The validity of the request is checked but the request is not made. Check items include whether required parameters are specified, the request format, service limits, and available ECS resources. If the check fails, the corresponding error code is returned. If the check succeeds, the `DryRunOperation` error code is returned. * false: The validity of the request is checked, and the request is made if the check succeeds.
public RunInstancesRequest.Builder hostName(String hostName)
* The hostname cannot start or end with a period (.) or hyphen (-). It cannot contain consecutive periods (.) or hyphens (-). * For Windows instances, the hostname must be 2 to 15 characters in length and cannot contain periods (.) or contain only digits. It can contain letters, digits, and hyphens (-). * For instances that run other operating systems such as Linux, take note of the following items: * The hostname must be 2 to 64 characters in length. You can use periods (.) to separate a hostname into multiple segments. Each segment can contain letters, digits, and hyphens (-). * You can use the `${instance_id}` placeholder to pass instance IDs into the hostname specified by `HostName`. For example, if you set `HostName` to k8s-${instance_id} and the instance is assigned an ID of `i-123abc****`, the hostname of the instance is `k8s-i-123abc****`. When you create multiple instances, you can perform the following operations: * Batch configure sequential hostnames for the instances. For more information, see [Batch configure sequential names or hostnames for multiple instances](~~196048~~). * Use the `HostNames.N` parameter to configure different hostnames for instances. You cannot specify both the `HostName` and `HostNames.N` parameters.
public RunInstancesRequest.Builder hostNames(List<String> hostNames)
public RunInstancesRequest.Builder hpcClusterId(String hpcClusterId)
This parameter is required when you create instances of a Supper Computing Cluster (SCC) instance type. For information about how to create an HPC cluster, see [CreateHpcCluster](~~109138~~).
public RunInstancesRequest.Builder httpEndpoint(String httpEndpoint)
* enabled * disabled Default value: enabled. > For more information about instance metadata, see [Overview of ECS instance metadata](~~49122~~).
public RunInstancesRequest.Builder httpPutResponseHopLimit(Integer httpPutResponseHopLimit)
Default value: 1.
public RunInstancesRequest.Builder httpTokens(String httpTokens)
* optional: does not forcefully use the security-enhanced mode (IMDSv2). * required: forcefully uses the security-enhanced mode (IMDSv2). After you set this parameter to required, you cannot access instance metadata in normal mode. Default value: optional. > For more information about the modes of accessing instance metadata, see [Access mode of instance metadata](~~150575~~).
public RunInstancesRequest.Builder imageFamily(String imageFamily)
The name must be 2 to 128 characters in length. The name cannot start with a digit, a special character, http://, or https://. The name can contain letters, digits, periods (.), underscores (\_), hyphens (-), and colons (:). Take note of the following items: * If you specify `ImageId`, you cannot specify ImageFamily. * If you do not specify `ImageId` but use `LaunchTemplateId` or `LaunchTemplateName` to specify a launch template that has `ImageId` specified, you cannot specify ImageFamily. * If you do not specify `ImageId` but use `LaunchTemplateId` or `LaunchTemplateName` to specify a launch template that does not have `ImageId` specified, you can specify ImageFamily. * If you do not specify `ImageId`, `LaunchTemplateId`, or `LaunchTemplateName`, you can specify ImageFamily. > For information about image families that are associated with Alibaba Cloud official images, see [Overview of public images](~~108393~~).
public RunInstancesRequest.Builder imageId(String imageId)
public RunInstancesRequest.Builder imageOptions(RunInstancesRequest.ImageOptions imageOptions)
public RunInstancesRequest.Builder instanceChargeType(String instanceChargeType)
* PrePaid: subscription * PostPaid: pay-as-you-go Default value: PostPaid. If you set this parameter to PrePaid, make sure that your account has sufficient balance or credit. Otherwise, an `InvalidPayMethod` error is returned.
public RunInstancesRequest.Builder instanceName(String instanceName)
When you batch create instances, you can batch configure sequential names for the instances. The sequential names can contain brackets (\[ ]) and commas (,). For more information, see [Batch configure sequential names or hostnames for multiple instances](~~196048~~).
public RunInstancesRequest.Builder instanceType(String instanceType)
* Select an instance type. See [Instance families](~~25378~~) or call the [DescribeInstanceTypes](~~25620~~) operation to query the performance data of an instance type, or see [Best practices for instance type selection](~~58291~~) to learn about how to select instance types. * Query available resources. Call the [DescribeAvailableResource](~~66186~~) operation to query available resources in a specific region or zone.
public RunInstancesRequest.Builder internetChargeType(String internetChargeType)
* PayByBandwidth: pay-by-bandwidth * PayByTraffic: pay-by-traffic Default value: PayByTraffic. > When the **pay-by-traffic** billing method for network usage is used, the maximum inbound and outbound bandwidths are used as the upper limits of bandwidths instead of guaranteed performance specifications. In scenarios where demand outstrips resource supplies, these maximum bandwidth values may not be reached. If you want guaranteed bandwidths for your instance, use the **pay-by-bandwidth** billing method for network usage.
public RunInstancesRequest.Builder internetMaxBandwidthIn(Integer internetMaxBandwidthIn)
* When the purchased outbound public bandwidth is less than or equal to 10 Mbit/s, the valid values of InternetMaxBandwidthIn are 1 to 10, and the default value is 10. * When the purchased outbound public bandwidth is greater than 10 Mbit/s, the valid values of this parameter are 1 to the `InternetMaxBandwidthOut` value and the default value is the `InternetMaxBandwidthOut` value.
public RunInstancesRequest.Builder internetMaxBandwidthOut(Integer internetMaxBandwidthOut)
Default value: 0.
public RunInstancesRequest.Builder ioOptimized(String ioOptimized)
* none: The instance is not I/O optimized. * optimized: The instance is I/O optimized.
public RunInstancesRequest.Builder ipv6Address(List<String> ipv6Address)
Example: `Ipv6Address.1=2001:db8:1234:1a00::***`. Take note of the following items: * If the `Ipv6Address.N` parameter is specified, you must set the `Amount` parameter to 1 and leave the `Ipv6AddressCount` parameter empty. * If `NetworkInterface.N.InstanceType` is set to `Primary`, you cannot set `Ipv6Addresses.N` or `Ipv6AddressCount` and must set `NetworkInterface.N.Ipv6Addresses.N` or `NetworkInterface.N.Ipv6AddressCount`.
public RunInstancesRequest.Builder ipv6AddressCount(Integer ipv6AddressCount)
Take note of the following items: * You cannot specify both the `Ipv6Addresses.N` and `Ipv6AddressCount` parameters. * If `NetworkInterface.N.InstanceType` is set to `Primary`, you cannot specify `Ipv6Address.N` or `Ipv6AddressCount` but can specify `NetworkInterface.N.Ipv6Address.N` or `NetworkInterface.N.Ipv6AddressCount`.
public RunInstancesRequest.Builder isp(String isp)
public RunInstancesRequest.Builder keyPairName(String keyPairName)
> For Windows instances, this parameter is ignored. This parameter is empty by default. The `Password` parameter takes effect even if the KeyPairName parameter is specified.
public RunInstancesRequest.Builder launchTemplateId(String launchTemplateId)
To use a launch template to create an instance, you must use the `LaunchTemplateId` or `LaunchTemplateName` parameter to specify the launch template.
public RunInstancesRequest.Builder launchTemplateName(String launchTemplateName)
To use a launch template to create an instance, you must use the `LaunchTemplateId` or `LaunchTemplateName` parameter to specify the launch template.
public RunInstancesRequest.Builder launchTemplateVersion(Long launchTemplateVersion)
public RunInstancesRequest.Builder minAmount(Integer minAmount)
The number of ECS instances that can be created varies based on the Amount and MinAmount values. * If you do not specify MinAmount, the RunInstances operation creates ECS instances based on the Amount value. If the available resources are insufficient to create the desired number of ECS instances, the RunInstances operation returns an error response and no ECS instances are created. * If you specify MinAmount, take note of the following items: * If the available resources are insufficient to create the minimum number of ECS instances, no ECS instances are created and the RunInstances operation returns an error response. * If the available resources are insufficient to create the desired number of ECS instances but are sufficient to create the minimum number of ECS instances, the RunInstances operation uses the available resources to create ECS instances and returns a success response. In this case, the number of ECS instances that can be created is less than the desired number of ECS instances. * If the available resources are sufficient to create the desired number of ECS instances, the RunInstances operation uses the available resources to create the desired number of ECS instances and returns a success response.
public RunInstancesRequest.Builder networkInterface(List<RunInstancesRequest.NetworkInterface> networkInterface)
public RunInstancesRequest.Builder networkInterfaceQueueNumber(Integer networkInterfaceQueueNumber)
* The value of this parameter cannot exceed the maximum number of queues per ENI allowed for the instance type. * The total number of queues for all ENIs on the instance cannot exceed the queue quota for the instance type. To query the maximum number of queues per ENI and the queue quota for an instance type, you can call the [DescribeInstanceTypes](~~25620~~) operation to query the `MaximumQueueNumberPerEni` and `TotalEniQueueQuantity` values. * If `NetworkInterface.N.InstanceType` is set to `Primary`, you cannot specify `NetworkInterfaceQueueNumber` but can specify `NetworkInterface.N.QueueNumber`.
public RunInstancesRequest.Builder networkOptions(RunInstancesRequest.NetworkOptions networkOptions)
public RunInstancesRequest.Builder ownerAccount(String ownerAccount)
public RunInstancesRequest.Builder ownerId(Long ownerId)
public RunInstancesRequest.Builder password(String password)
()`~!@#$%^&*-_+=|{}[]:;\"<>,.?/ For Windows instances, the password cannot start with a forward slash (/). > If the `Password` parameter is specified, we recommend that you send requests over HTTPS to prevent password leaks.
public RunInstancesRequest.Builder passwordInherit(Boolean passwordInherit)
* true: uses the preset password. * false: does not use the preset password. Default value: false. > If you set this parameter to true, make sure that you leave the Password parameter empty and the selected image has a preset password.
public RunInstancesRequest.Builder period(Integer period)
* Valid values when PeriodUnit is set to Week: 1, 2, 3, and 4. * Valid values when PeriodUnit is set to Month: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36, 48, and 60.
public RunInstancesRequest.Builder periodUnit(String periodUnit)
* Week * Month
public RunInstancesRequest.Builder privateDnsNameOptions(RunInstancesRequest.PrivateDnsNameOptions privateDnsNameOptions)
public RunInstancesRequest.Builder privateIpAddress(String privateIpAddress)
Take note of the following items: * If `PrivateIpAddress` is specified, take note of the following items: * If `Amount` is set to 1, a single instance is created and the specified private IP address is assigned to the instance. * If `Amount` is set to a numeric value greater than 1, the specified number of instances are created and consecutive private IP addresses starting from the specified one are assigned to the instances. In this case, you cannot specify parameters that start with `NetworkInterface.N` to attach secondary ENIs to the instances. * If `NetworkInterface.N.InstanceType` is set to `Primary`, you cannot specify `PrivateIpAddress` but can specify `NetworkInterface.N.PrimaryIpAddress`. > The first IP address and last three IP addresses of each vSwitch CIDR block are reserved. You cannot specify the IP addresses. For example, if a vSwitch CIDR block is 192.168.1.0/24, the IP addresses 192.168.1.0, 192.168.1.253, 192.168.1.254, and 192.168.1.255 are reserved.
public RunInstancesRequest.Builder ramRoleName(String ramRoleName)
public RunInstancesRequest.Builder regionId(String regionId)
public RunInstancesRequest.Builder resourceGroupId(String resourceGroupId)
public RunInstancesRequest.Builder resourceOwnerAccount(String resourceOwnerAccount)
public RunInstancesRequest.Builder resourceOwnerId(Long resourceOwnerId)
public RunInstancesRequest.Builder securityEnhancementStrategy(String securityEnhancementStrategy)
* Active: enables security hardening. This value is applicable only to public images. * Deactive: does not enable security hardening. This value is applicable to all images.
public RunInstancesRequest.Builder securityGroupId(String securityGroupId)
> The network type of the new instance is the same as the network type of the security group specified by `SecurityGroupId`. For example, if the specified security group is of the VPC type, the new instance is also of the VPC type and you must specify `VSwitchId`. If you do not use `LaunchTemplateId` or `LaunchTemplateName` to specify a launch template, you must specify a security group ID. Take note of the following items: * You can set `SecurityGroupId` to specify a single security group or set `SecurityGroupIds.N` to specify one or more security groups. However, you cannot specify both `SecurityGroupId` and `SecurityGroupIds.N` in the same request. * If `NetworkInterface.N.InstanceType` is set to `Primary`, you cannot specify `SecurityGroupId` or `SecurityGroupIds.N` but can specify `NetworkInterface.N.SecurityGroupId` or `NetworkInterface.N.SecurityGroupIds.N`.
public RunInstancesRequest.Builder securityGroupIds(List<String> securityGroupIds)
Take note of the following items: * You cannot specify both `SecurityGroupId` and `SecurityGroupIds.N` in the same request. * If `NetworkInterface.N.InstanceType` is set to `Primary`, you cannot specify `SecurityGroupId` or `SecurityGroupIds.N` but can specify `NetworkInterface.N.SecurityGroupId` or `NetworkInterface.N.SecurityGroupIds.N`.
public RunInstancesRequest.Builder spotDuration(Integer spotDuration)
* 1: After a preemptible instance is created, Alibaba Cloud ensures that the instance is not automatically released within 1 hour. After the 1-hour protection period ends, the system compares the bid price with the market price and checks the resource inventory to determine whether to retain or release the instance. * 0: After a preemptible instance is created, Alibaba Cloud does not ensure that the instance runs for 1 hour. The system compares the bid price with the market price and checks the resource inventory to determine whether to retain or release the instance. Alibaba Cloud sends an ECS system event to notify you 5 minutes before the instance is released. Preemptible instances are billed by second. We recommend that you specify an appropriate protection period based on your business requirements.
public RunInstancesRequest.Builder spotInterruptionBehavior(String spotInterruptionBehavior)
* Terminate: The instance is released. * Stop: The instance is stopped in economical mode. For information about the economical mode, see [Economical mode](~~63353~~). Default value: Terminate.
public RunInstancesRequest.Builder spotPriceLimit(Float spotPriceLimit)
public RunInstancesRequest.Builder spotStrategy(String spotStrategy)
* NoSpot: The instance is created as a pay-as-you-go instance. * SpotWithPriceLimit: The instance is created as a preemptible instance with a user-defined maximum hourly price. * SpotAsPriceGo: The instance is created as a preemptible instance for which the market price at the time of purchase is automatically used as the bid price. Default value: NoSpot.
public RunInstancesRequest.Builder storageSetId(String storageSetId)
public RunInstancesRequest.Builder storageSetPartitionNumber(Integer storageSetPartitionNumber)
public RunInstancesRequest.Builder tag(List<RunInstancesRequest.Tag> tag)
public RunInstancesRequest.Builder tenancy(String tenancy)
* default: creates the instance on a non-dedicated host. * host: creates the instance on a dedicated host. If you do not set the `DedicatedHostId` parameter, Alibaba Cloud selects a dedicated host for the instance. Default value: default.
public RunInstancesRequest.Builder uniqueSuffix(Boolean uniqueSuffix)
* true * false Default value: false. When the `HostName` or `InstanceName` value is set in the `name_prefix[begin_number,bits]` format without `name_suffix`, the `UniqueSuffix` parameter does not take effect. The names are sorted in the specified sequence. For more information, see [Batch configure sequential names or hostnames for multiple instances](~~196048~~).
public RunInstancesRequest.Builder userData(String userData)
For information about the limits, formats, and running frequencies of instance user data, see [Instance user data](~~49121~~). > To ensure security, we recommend that you do not use plaintext to pass in confidential information, such as passwords or private keys, as user data. If you need to pass in confidential information, we recommend that you encrypt and encode the information in Base64 and then decode and decrypt the information in the same manner in the instance.
public RunInstancesRequest.Builder vSwitchId(String vSwitchId)
Take note of the following items: * If you specify the `VSwitchId` parameter, the zone specified by the `ZoneId` parameter must be the zone where the specified vSwitch is located. You can also leave the `ZoneId` parameter empty. Then, the system selects the zone where the specified vSwitch resides. * If `NetworkInterface.N.InstanceType` is set to `Primary`, you cannot specify `VSwitchId` but can specify `NetworkInterface.N.VSwitchId`.
public RunInstancesRequest.Builder zoneId(String zoneId)
> If you specify the `VSwitchId` parameter, the zone specified by the `ZoneId` parameter must be the zone where the vSwitch is located. You can also leave the `ZoneId` parameter empty. Then, the system selects the zone where the specified vSwitch is located. This parameter is empty by default.
public RunInstancesRequest build()
Copyright © 2024. All rights reserved.