public static final class CreateInstanceRequest.Builder extends Object
限定符和类型 | 方法和说明 |
---|---|
CreateInstanceRequest.Builder |
affinity(String affinity)
Specifies whether to associate the instance on a dedicated host with the dedicated host.
|
CreateInstanceRequest.Builder |
arn(List<CreateInstanceRequest.Arn> arn)
> This parameter is in invitational preview and is not publicly available.
|
CreateInstanceRequest.Builder |
autoRenew(Boolean autoRenew)
Specifies whether to enable auto-renewal for the instance.
|
CreateInstanceRequest.Builder |
autoRenewPeriod(Integer autoRenewPeriod)
The auto-renewal period of the instance.
|
CreateInstanceRequest |
build() |
CreateInstanceRequest.Builder |
clientToken(String clientToken)
The client token that is used to ensure the idempotence of the request.
|
CreateInstanceRequest.Builder |
clusterId(String clusterId)
The ID of the cluster in which to create the instance.
|
CreateInstanceRequest.Builder |
creditSpecification(String creditSpecification)
The performance mode of the burstable instance.
|
CreateInstanceRequest.Builder |
dataDisk(List<CreateInstanceRequest.DataDisk> dataDisk)
The data disks.
|
CreateInstanceRequest.Builder |
dedicatedHostId(String dedicatedHostId)
The ID of the dedicated host on which to create the instance.
|
CreateInstanceRequest.Builder |
deletionProtection(Boolean deletionProtection)
Specifies whether to enable release protection for the instance.
|
CreateInstanceRequest.Builder |
deploymentSetGroupNo(Integer deploymentSetGroupNo)
The number of the deployment set group to which to deploy the instance.
|
CreateInstanceRequest.Builder |
deploymentSetId(String deploymentSetId)
The ID of the deployment set to which to deploy the instance.
|
CreateInstanceRequest.Builder |
description(String description)
The description of the instance.
|
CreateInstanceRequest.Builder |
dryRun(Boolean dryRun)
Specifies whether to perform only a dry run, without performing the actual request.
|
CreateInstanceRequest.Builder |
hibernationOptions(CreateInstanceRequest.HibernationOptions hibernationOptions)
HibernationOptions.
|
CreateInstanceRequest.Builder |
hostName(String hostName)
The hostname of the instance.
|
CreateInstanceRequest.Builder |
hpcClusterId(String hpcClusterId)
The ID of the high performance computing (HPC) cluster to which to assign the instance.
|
CreateInstanceRequest.Builder |
httpEndpoint(String httpEndpoint)
Specifies whether to enable the access channel for instance metadata.
|
CreateInstanceRequest.Builder |
httpPutResponseHopLimit(Integer httpPutResponseHopLimit)
> This parameter is in invitational preview and is not publicly available.
|
CreateInstanceRequest.Builder |
httpTokens(String httpTokens)
Specifies whether to forcibly use the security hardening mode (IMDSv2) to access instance metadata.
|
CreateInstanceRequest.Builder |
imageFamily(String imageFamily)
The name of the image family.
|
CreateInstanceRequest.Builder |
imageId(String imageId)
The ID of the image to use to create the instance.
|
CreateInstanceRequest.Builder |
innerIpAddress(String innerIpAddress)
The internal IP address to assign to the instance.
|
CreateInstanceRequest.Builder |
instanceChargeType(String instanceChargeType)
The billing method of the instance.
|
CreateInstanceRequest.Builder |
instanceName(String instanceName)
The name of the instance.
|
CreateInstanceRequest.Builder |
instanceType(String instanceType)
The instance type.
|
CreateInstanceRequest.Builder |
internetChargeType(String internetChargeType)
The billing method for network usage.
|
CreateInstanceRequest.Builder |
internetMaxBandwidthIn(Integer internetMaxBandwidthIn)
The maximum inbound public bandwidth.
|
CreateInstanceRequest.Builder |
internetMaxBandwidthOut(Integer internetMaxBandwidthOut)
The maximum outbound public bandwidth.
|
CreateInstanceRequest.Builder |
ioOptimized(String ioOptimized)
Specifies whether the instance is I/O optimized.
|
CreateInstanceRequest.Builder |
keyPairName(String keyPairName)
The name of the key pair.
|
CreateInstanceRequest.Builder |
nodeControllerId(String nodeControllerId)
> This parameter is in invitational preview and is not publicly available.
|
CreateInstanceRequest.Builder |
ownerAccount(String ownerAccount)
OwnerAccount.
|
CreateInstanceRequest.Builder |
ownerId(Long ownerId)
OwnerId.
|
CreateInstanceRequest.Builder |
password(String password)
The password of the instance.
|
CreateInstanceRequest.Builder |
passwordInherit(Boolean passwordInherit)
Specifies whether to use the password preset in the image.
|
CreateInstanceRequest.Builder |
period(Integer period)
The subscription period of the instance.
|
CreateInstanceRequest.Builder |
periodUnit(String periodUnit)
The unit of the subscription period.
|
CreateInstanceRequest.Builder |
privateIpAddress(String privateIpAddress)
The private IP address to assign to the instance.
|
CreateInstanceRequest.Builder |
privatePoolOptions(CreateInstanceRequest.PrivatePoolOptions privatePoolOptions)
PrivatePoolOptions.
|
CreateInstanceRequest.Builder |
ramRoleName(String ramRoleName)
The name of the instance Resource Access Management (RAM) role.
|
CreateInstanceRequest.Builder |
regionId(String regionId)
The ID of the region in which to create the instance.
|
CreateInstanceRequest.Builder |
resourceGroupId(String resourceGroupId)
The ID of the resource group to which to assign the instance.
|
CreateInstanceRequest.Builder |
resourceOwnerAccount(String resourceOwnerAccount)
ResourceOwnerAccount.
|
CreateInstanceRequest.Builder |
resourceOwnerId(Long resourceOwnerId)
ResourceOwnerId.
|
CreateInstanceRequest.Builder |
securityEnhancementStrategy(String securityEnhancementStrategy)
Specifies whether to enable security hardening.
|
CreateInstanceRequest.Builder |
securityGroupId(String securityGroupId)
The ID of the security group to which to assign the instance.
|
CreateInstanceRequest.Builder |
sourceRegionId(String sourceRegionId)
SourceRegionId.
|
CreateInstanceRequest.Builder |
spotDuration(Integer spotDuration)
The protection period of the preemptible instance.
|
CreateInstanceRequest.Builder |
spotInterruptionBehavior(String spotInterruptionBehavior)
The interruption mode of the preemptible instance.
|
CreateInstanceRequest.Builder |
spotPriceLimit(Float spotPriceLimit)
The maximum hourly price of the instance.
|
CreateInstanceRequest.Builder |
spotStrategy(String spotStrategy)
The bidding policy for the pay-as-you-go instance.
|
CreateInstanceRequest.Builder |
storageSetId(String storageSetId)
The ID of the storage set.
|
CreateInstanceRequest.Builder |
storageSetPartitionNumber(Integer storageSetPartitionNumber)
The maximum number of partitions in the storage set.
|
CreateInstanceRequest.Builder |
systemDisk(CreateInstanceRequest.SystemDisk systemDisk)
SystemDisk.
|
CreateInstanceRequest.Builder |
tag(List<CreateInstanceRequest.Tag> tag)
The tags to add to the instance.
|
CreateInstanceRequest.Builder |
tenancy(String tenancy)
Specifies whether to create the instance on a dedicated host.
|
CreateInstanceRequest.Builder |
useAdditionalService(Boolean useAdditionalService)
Specifies whether to use the system configurations for virtual machines.
|
CreateInstanceRequest.Builder |
userData(String userData)
The user data of the instance.
|
CreateInstanceRequest.Builder |
vlanId(String vlanId)
The ID of the virtual LAN (VLAN).
|
CreateInstanceRequest.Builder |
vSwitchId(String vSwitchId)
The ID of the vSwitch to which to connect the instance.
|
CreateInstanceRequest.Builder |
zoneId(String zoneId)
The ID of the zone in which to create the instance.
|
public CreateInstanceRequest.Builder hibernationOptions(CreateInstanceRequest.HibernationOptions hibernationOptions)
public CreateInstanceRequest.Builder privatePoolOptions(CreateInstanceRequest.PrivatePoolOptions privatePoolOptions)
public CreateInstanceRequest.Builder systemDisk(CreateInstanceRequest.SystemDisk systemDisk)
public CreateInstanceRequest.Builder sourceRegionId(String sourceRegionId)
public CreateInstanceRequest.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 start. Default value: default.
public CreateInstanceRequest.Builder arn(List<CreateInstanceRequest.Arn> arn)
public CreateInstanceRequest.Builder autoRenew(Boolean autoRenew)
* true: enables auto-renewal. * false: does not enable auto-renewal.
public CreateInstanceRequest.Builder autoRenewPeriod(Integer autoRenewPeriod)
Valid values if PeriodUnit is set to Month: 1, 2, 3, 6, and 12.
public CreateInstanceRequest.Builder clientToken(String clientToken)
public CreateInstanceRequest.Builder clusterId(String clusterId)
> This parameter will be removed in the future. We recommend that you use other parameters to ensure future compatibility.
public CreateInstanceRequest.Builder creditSpecification(String creditSpecification)
* Standard: standard mode. For more information, see the "Standard mode" section in the [Overview of burstable instances](~~59977~~) topic. * Unlimited: unlimited mode. For more information, see the "Unlimited mode" section in the [Burstable instances](~~59977~~) topic.
public CreateInstanceRequest.Builder dataDisk(List<CreateInstanceRequest.DataDisk> dataDisk)
public CreateInstanceRequest.Builder dedicatedHostId(String dedicatedHostId)
You can call the [DescribeDedicatedHosts](~~134242~~) operation to query the list of dedicated host IDs If you specify `DedicatedHostId`, the `SpotStrategy` and `SpotPriceLimit` parameters are ignored. This is because preemptible instances cannot be created on dedicated hosts.
public CreateInstanceRequest.Builder deletionProtection(Boolean deletionProtection)
* true: enables release protection. * false (default): disables release protection. > This parameter is applicable only to pay-as-you-go instances. It can protect instances against manual releases, but not against automatic releases.
public CreateInstanceRequest.Builder deploymentSetGroupNo(Integer deploymentSetGroupNo)
public CreateInstanceRequest.Builder deploymentSetId(String deploymentSetId)
public CreateInstanceRequest.Builder description(String description)
This parameter is empty by default.
public CreateInstanceRequest.Builder dryRun(Boolean dryRun)
* true: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, service limits, and unavailable ECS resources. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned. * false (default): performs a dry run and performs the actual request. If the request passes the dry run, the operation is performed.
public CreateInstanceRequest.Builder hostName(String hostName)
* The hostname cannot start or end with a period (.) or hyphen (-). It cannot contain consecutive periods (.) or hyphens (-). * For a Windows instance, 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 an instance that runs another type of operating system such as Linux, the hostname must be 2 to 64 characters in length. You can use periods (.) to separate the hostname into multiple segments. Each segment can contain letters, digits, and hyphens (-).
public CreateInstanceRequest.Builder hpcClusterId(String hpcClusterId)
public CreateInstanceRequest.Builder httpEndpoint(String httpEndpoint)
* enabled * disabled Default value: enabled. > For more information about instance metadata, see [Overview of instance metadata](~~49122~~).
public CreateInstanceRequest.Builder httpPutResponseHopLimit(Integer httpPutResponseHopLimit)
public CreateInstanceRequest.Builder httpTokens(String httpTokens)
* optional: does not forcefully use the security hardening mode (IMDSv2). * required: forcefully uses the security hardening 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 CreateInstanceRequest.Builder imageFamily(String imageFamily)
* ImageFamily must be empty if `ImageId` is specified. * ImageFamily can be specified if `ImageId` is not specified.
public CreateInstanceRequest.Builder imageId(String imageId)
public CreateInstanceRequest.Builder innerIpAddress(String innerIpAddress)
public CreateInstanceRequest.Builder instanceChargeType(String instanceChargeType)
* PrePaid: subscription. If you set this parameter to PrePaid, make sure that you have sufficient balance or credit in your account. Otherwise, an `InvalidPayMethod` error is returned. * PostPaid (default): pay-as-you-go.
public CreateInstanceRequest.Builder instanceName(String instanceName)
public CreateInstanceRequest.Builder instanceType(String instanceType)
* Instance type selection: See [Instance families](~~25378~~) or call the [DescribeInstanceTypes](~~25620~~) operation to query the performance data of instance types, or see [Best practices for instance type selection](~~58291~~) to learn about how to select instance types. * Query of available resources: Call the [DescribeAvailableResource](~~66186~~) operation to query resources available in a specific region or zone.
public CreateInstanceRequest.Builder internetChargeType(String internetChargeType)
* PayByBandwidth: pay-by-bandwidth * PayByTraffic (default): pay-by-traffic > When the **pay-by-traffic** billing method is used for network usage, 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 be limited. If you want guaranteed bandwidths for your instance, use the **pay-by-bandwidth** billing method for network usage.
public CreateInstanceRequest.Builder internetMaxBandwidthIn(Integer internetMaxBandwidthIn)
* When the purchased outbound public bandwidth is less than or equal to 10 Mbit/s, the valid values of this parameter 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 CreateInstanceRequest.Builder internetMaxBandwidthOut(Integer internetMaxBandwidthOut)
Default value: 0.
public CreateInstanceRequest.Builder ioOptimized(String ioOptimized)
* none: The instance is not I/O optimized. * optimized: The ECS instance is I/O optimized. For retired instance types, the default value is none. For more information, see [Retired instance types](~~55263~~). For other instance types, the default value is optimized.
public CreateInstanceRequest.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 CreateInstanceRequest.Builder nodeControllerId(String nodeControllerId)
public CreateInstanceRequest.Builder ownerAccount(String ownerAccount)
public CreateInstanceRequest.Builder ownerId(Long ownerId)
public CreateInstanceRequest.Builder password(String password)
( ) ` ~ ! @ # $ % ^ & * - _ + = | { } [ ] : ; \" < > , . ? / Take note of the following items: * For security reasons, we recommend that you use HTTPS to send requests if the Password parameter is specified. * Passwords of Windows instances cannot start with a forward slash (/). * Passwords cannot be set for instances that run specific types of operating systems such as Others Linux and Fedora CoreOS. For these instances, only key pairs can be set.
public CreateInstanceRequest.Builder passwordInherit(Boolean passwordInherit)
public CreateInstanceRequest.Builder period(Integer period)
Valid values if PeriodUnit is set to Month: 1, 2, 3, 6, and 12.
public CreateInstanceRequest.Builder periodUnit(String periodUnit)
Month Default value: Month.
public CreateInstanceRequest.Builder privateIpAddress(String privateIpAddress)
public CreateInstanceRequest.Builder ramRoleName(String ramRoleName)
public CreateInstanceRequest.Builder regionId(String regionId)
public CreateInstanceRequest.Builder resourceGroupId(String resourceGroupId)
public CreateInstanceRequest.Builder resourceOwnerAccount(String resourceOwnerAccount)
public CreateInstanceRequest.Builder resourceOwnerId(Long resourceOwnerId)
public CreateInstanceRequest.Builder securityEnhancementStrategy(String securityEnhancementStrategy)
* Active: enables security hardening. This value applies only to public images. * Deactive: disables security hardening. This value is applicable to all images.
public CreateInstanceRequest.Builder securityGroupId(String securityGroupId)
public CreateInstanceRequest.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. > This parameter takes effect only if the SpotStrategy parameter is set to SpotWithPriceLimit or SpotAsPriceGo.
public CreateInstanceRequest.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 CreateInstanceRequest.Builder spotPriceLimit(Float spotPriceLimit)
public CreateInstanceRequest.Builder spotStrategy(String spotStrategy)
* NoSpot (default): The instance is created as a regular pay-as-you-go instance. * SpotWithPriceLimit: The instance is a preemptible instance for which you specify the maximum hourly price. * SpotAsPriceGo: The instance is a preemptible instance for which the market price at the time of purchase is automatically used as the bid price. The market price can be up to the pay-as-you-go price.
public CreateInstanceRequest.Builder storageSetId(String storageSetId)
public CreateInstanceRequest.Builder storageSetPartitionNumber(Integer storageSetPartitionNumber)
public CreateInstanceRequest.Builder tag(List<CreateInstanceRequest.Tag> tag)
public CreateInstanceRequest.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 specify `DedicatedHostId`, Alibaba Cloud selects a dedicated host for the instance. Default value: default.
public CreateInstanceRequest.Builder useAdditionalService(Boolean useAdditionalService)
public CreateInstanceRequest.Builder userData(String userData)
public CreateInstanceRequest.Builder vSwitchId(String vSwitchId)
> If `VSwitchId` is specified, the zone specified by `ZoneId` must be the zone where the specified vSwitch resides. You can also leave `ZoneId` empty. Then, the system selects the zone where the specified vSwitch resides.
public CreateInstanceRequest.Builder vlanId(String vlanId)
public CreateInstanceRequest.Builder zoneId(String zoneId)
> If `VSwitchId` is specified, the zone specified by `ZoneId` must be the zone where the specified vSwitch resides. You can also leave `ZoneId` empty. Then, the system selects the zone where the specified vSwitch resides. This parameter is empty by default.
public CreateInstanceRequest build()
Copyright © 2024. All rights reserved.