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 unavailable.
|
CreateInstanceRequest.Builder |
autoRenew(Boolean autoRenew)
Specifies whether to enable auto-renewal for the instance.
|
CreateInstanceRequest.Builder |
autoRenewPeriod(Integer autoRenewPeriod)
The auto-renewal cycle 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 list of 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 check the validity of the request without actually making the 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 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 currently in invitational preview and unavailable for general users.
|
CreateInstanceRequest.Builder |
httpTokens(String httpTokens)
Specifies whether to forcefully use the security-enhanced 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 unavailable.
|
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.
|
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 provided by Alibaba Cloud (Windows: NTP and KMS.
|
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 when 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: the standard mode. For more information, see the "Standard mode" section in [Burstable instances](~~59977~~). * Unlimited: the unlimited mode. For more information, see the "Unlimited mode" section in [Burstable instances](~~59977~~).
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 the `DedicatedHostId` parameter is specified, 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: 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: 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 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: enables the access channel for instance metadata. * disabled: disables the access channel for instance metadata. Default value: enabled. > For more information about instance metadata, see [Overview of ECS instance metadata](~~49122~~).
public CreateInstanceRequest.Builder httpPutResponseHopLimit(Integer httpPutResponseHopLimit)
public CreateInstanceRequest.Builder httpTokens(String httpTokens)
* optional: does not forcibly 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 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: pay-as-you-go.
public CreateInstanceRequest.Builder instanceName(String instanceName)
public CreateInstanceRequest.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. You can call the [DescribeAvailableResource](~~66186~~) operation to query available resources in a specific region or zone.
public CreateInstanceRequest.Builder internetChargeType(String internetChargeType)
* PayByBandwidth: pay-by-bandwidth * PayByTraffic: pay-by-traffic > When the **pay-by-traffic** billing method for network usage is used, the maximum inbound and outbound bandwidth values are used as 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 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 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)
```plain ( ) ` ~ ! @ # $ % ^ & * - _ + = | { } [ ] : ; \" < > , . ? / ``` 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 some 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 when 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 is applicable only to public images. * Deactive: does not enable security hardening. This value is applicable to all images.
public CreateInstanceRequest.Builder securityGroupId(String securityGroupId)
public CreateInstanceRequest.Builder spotDuration(Integer spotDuration)
* Protection periods of 2, 3, 4, 5, and 6 hours are in invitational preview. If you want to set this parameter to one of these values, submit a ticket. * If this parameter is set to 0, no protection period is configured for the preemptible instance. Default value: 1.
public CreateInstanceRequest.Builder spotInterruptionBehavior(String spotInterruptionBehavior)
public CreateInstanceRequest.Builder spotPriceLimit(Float spotPriceLimit)
public CreateInstanceRequest.Builder spotStrategy(String spotStrategy)
* NoSpot: The instance is created as a regular 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.
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 the `DedicatedHostId` parameter, 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 the `VSwitchId` parameter is specified, 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 is located.
public CreateInstanceRequest.Builder vlanId(String vlanId)
public CreateInstanceRequest.Builder zoneId(String zoneId)
> If the `VSwitchId` parameter is specified, 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 is located. This parameter is empty by default.
public CreateInstanceRequest build()
Copyright © 2023. All rights reserved.