All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aliyun.sdk.service.ecs20140526.models.CreateLaunchTemplateRequest Maven / Gradle / Ivy

There is a newer version: 5.0.29
Show newest version
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.sdk.service.ecs20140526.models;

import darabonba.core.RequestModel;
import darabonba.core.TeaModel;
import com.aliyun.sdk.gateway.pop.models.*;

/**
 * {@link CreateLaunchTemplateRequest} extends {@link RequestModel}
 *
 * 

CreateLaunchTemplateRequest

*/ public class CreateLaunchTemplateRequest extends Request { @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("SystemDisk") private SystemDisk systemDisk; @com.aliyun.core.annotation.Host @com.aliyun.core.annotation.NameInMap("SourceRegionId") private String sourceRegionId; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("AutoReleaseTime") private String autoReleaseTime; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("CreditSpecification") private String creditSpecification; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("DataDisk") private java.util.List < DataDisk> dataDisk; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("DeletionProtection") private Boolean deletionProtection; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("DeploymentSetId") private String deploymentSetId; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("Description") private String description; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("EnableVmOsConfig") private Boolean enableVmOsConfig; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("HostName") private String hostName; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("ImageId") private String imageId; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("ImageOwnerAlias") private String imageOwnerAlias; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("InstanceChargeType") private String instanceChargeType; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("InstanceName") private String instanceName; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("InstanceType") private String instanceType; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("InternetChargeType") private String internetChargeType; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("InternetMaxBandwidthIn") private Integer internetMaxBandwidthIn; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("InternetMaxBandwidthOut") private Integer internetMaxBandwidthOut; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("IoOptimized") private String ioOptimized; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("Ipv6AddressCount") private Integer ipv6AddressCount; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("KeyPairName") private String keyPairName; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("LaunchTemplateName") @com.aliyun.core.annotation.Validation(required = true) private String launchTemplateName; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("NetworkInterface") private java.util.List < NetworkInterface> networkInterface; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("NetworkType") private String networkType; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("OwnerAccount") private String ownerAccount; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("OwnerId") private Long ownerId; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("PasswordInherit") private Boolean passwordInherit; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("Period") private Integer period; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("PrivateIpAddress") private String privateIpAddress; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("RamRoleName") private String ramRoleName; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("RegionId") @com.aliyun.core.annotation.Validation(required = true) private String regionId; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("ResourceGroupId") private String resourceGroupId; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("ResourceOwnerAccount") private String resourceOwnerAccount; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("ResourceOwnerId") private Long resourceOwnerId; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("SecurityEnhancementStrategy") private String securityEnhancementStrategy; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("SecurityGroupId") private String securityGroupId; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("SecurityGroupIds") private java.util.List < String > securityGroupIds; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("SpotDuration") private Integer spotDuration; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("SpotPriceLimit") @com.aliyun.core.annotation.Validation(maximum = 999999) private Float spotPriceLimit; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("SpotStrategy") private String spotStrategy; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("Tag") private java.util.List < Tag> tag; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("TemplateResourceGroupId") private String templateResourceGroupId; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("TemplateTag") private java.util.List < TemplateTag> templateTag; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("UserData") private String userData; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("VSwitchId") private String vSwitchId; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("VersionDescription") private String versionDescription; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("VpcId") private String vpcId; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("ZoneId") private String zoneId; private CreateLaunchTemplateRequest(Builder builder) { super(builder); this.systemDisk = builder.systemDisk; this.sourceRegionId = builder.sourceRegionId; this.autoReleaseTime = builder.autoReleaseTime; this.creditSpecification = builder.creditSpecification; this.dataDisk = builder.dataDisk; this.deletionProtection = builder.deletionProtection; this.deploymentSetId = builder.deploymentSetId; this.description = builder.description; this.enableVmOsConfig = builder.enableVmOsConfig; this.hostName = builder.hostName; this.imageId = builder.imageId; this.imageOwnerAlias = builder.imageOwnerAlias; this.instanceChargeType = builder.instanceChargeType; this.instanceName = builder.instanceName; this.instanceType = builder.instanceType; this.internetChargeType = builder.internetChargeType; this.internetMaxBandwidthIn = builder.internetMaxBandwidthIn; this.internetMaxBandwidthOut = builder.internetMaxBandwidthOut; this.ioOptimized = builder.ioOptimized; this.ipv6AddressCount = builder.ipv6AddressCount; this.keyPairName = builder.keyPairName; this.launchTemplateName = builder.launchTemplateName; this.networkInterface = builder.networkInterface; this.networkType = builder.networkType; this.ownerAccount = builder.ownerAccount; this.ownerId = builder.ownerId; this.passwordInherit = builder.passwordInherit; this.period = builder.period; this.privateIpAddress = builder.privateIpAddress; this.ramRoleName = builder.ramRoleName; this.regionId = builder.regionId; this.resourceGroupId = builder.resourceGroupId; this.resourceOwnerAccount = builder.resourceOwnerAccount; this.resourceOwnerId = builder.resourceOwnerId; this.securityEnhancementStrategy = builder.securityEnhancementStrategy; this.securityGroupId = builder.securityGroupId; this.securityGroupIds = builder.securityGroupIds; this.spotDuration = builder.spotDuration; this.spotPriceLimit = builder.spotPriceLimit; this.spotStrategy = builder.spotStrategy; this.tag = builder.tag; this.templateResourceGroupId = builder.templateResourceGroupId; this.templateTag = builder.templateTag; this.userData = builder.userData; this.vSwitchId = builder.vSwitchId; this.versionDescription = builder.versionDescription; this.vpcId = builder.vpcId; this.zoneId = builder.zoneId; } public static Builder builder() { return new Builder(); } public static CreateLaunchTemplateRequest create() { return builder().build(); } @Override public Builder toBuilder() { return new Builder(this); } /** * @return systemDisk */ public SystemDisk getSystemDisk() { return this.systemDisk; } /** * @return sourceRegionId */ public String getSourceRegionId() { return this.sourceRegionId; } /** * @return autoReleaseTime */ public String getAutoReleaseTime() { return this.autoReleaseTime; } /** * @return creditSpecification */ public String getCreditSpecification() { return this.creditSpecification; } /** * @return dataDisk */ public java.util.List < DataDisk> getDataDisk() { return this.dataDisk; } /** * @return deletionProtection */ public Boolean getDeletionProtection() { return this.deletionProtection; } /** * @return deploymentSetId */ public String getDeploymentSetId() { return this.deploymentSetId; } /** * @return description */ public String getDescription() { return this.description; } /** * @return enableVmOsConfig */ public Boolean getEnableVmOsConfig() { return this.enableVmOsConfig; } /** * @return hostName */ public String getHostName() { return this.hostName; } /** * @return imageId */ public String getImageId() { return this.imageId; } /** * @return imageOwnerAlias */ public String getImageOwnerAlias() { return this.imageOwnerAlias; } /** * @return instanceChargeType */ public String getInstanceChargeType() { return this.instanceChargeType; } /** * @return instanceName */ public String getInstanceName() { return this.instanceName; } /** * @return instanceType */ public String getInstanceType() { return this.instanceType; } /** * @return internetChargeType */ public String getInternetChargeType() { return this.internetChargeType; } /** * @return internetMaxBandwidthIn */ public Integer getInternetMaxBandwidthIn() { return this.internetMaxBandwidthIn; } /** * @return internetMaxBandwidthOut */ public Integer getInternetMaxBandwidthOut() { return this.internetMaxBandwidthOut; } /** * @return ioOptimized */ public String getIoOptimized() { return this.ioOptimized; } /** * @return ipv6AddressCount */ public Integer getIpv6AddressCount() { return this.ipv6AddressCount; } /** * @return keyPairName */ public String getKeyPairName() { return this.keyPairName; } /** * @return launchTemplateName */ public String getLaunchTemplateName() { return this.launchTemplateName; } /** * @return networkInterface */ public java.util.List < NetworkInterface> getNetworkInterface() { return this.networkInterface; } /** * @return networkType */ public String getNetworkType() { return this.networkType; } /** * @return ownerAccount */ public String getOwnerAccount() { return this.ownerAccount; } /** * @return ownerId */ public Long getOwnerId() { return this.ownerId; } /** * @return passwordInherit */ public Boolean getPasswordInherit() { return this.passwordInherit; } /** * @return period */ public Integer getPeriod() { return this.period; } /** * @return privateIpAddress */ public String getPrivateIpAddress() { return this.privateIpAddress; } /** * @return ramRoleName */ public String getRamRoleName() { return this.ramRoleName; } /** * @return regionId */ public String getRegionId() { return this.regionId; } /** * @return resourceGroupId */ public String getResourceGroupId() { return this.resourceGroupId; } /** * @return resourceOwnerAccount */ public String getResourceOwnerAccount() { return this.resourceOwnerAccount; } /** * @return resourceOwnerId */ public Long getResourceOwnerId() { return this.resourceOwnerId; } /** * @return securityEnhancementStrategy */ public String getSecurityEnhancementStrategy() { return this.securityEnhancementStrategy; } /** * @return securityGroupId */ public String getSecurityGroupId() { return this.securityGroupId; } /** * @return securityGroupIds */ public java.util.List < String > getSecurityGroupIds() { return this.securityGroupIds; } /** * @return spotDuration */ public Integer getSpotDuration() { return this.spotDuration; } /** * @return spotPriceLimit */ public Float getSpotPriceLimit() { return this.spotPriceLimit; } /** * @return spotStrategy */ public String getSpotStrategy() { return this.spotStrategy; } /** * @return tag */ public java.util.List < Tag> getTag() { return this.tag; } /** * @return templateResourceGroupId */ public String getTemplateResourceGroupId() { return this.templateResourceGroupId; } /** * @return templateTag */ public java.util.List < TemplateTag> getTemplateTag() { return this.templateTag; } /** * @return userData */ public String getUserData() { return this.userData; } /** * @return vSwitchId */ public String getVSwitchId() { return this.vSwitchId; } /** * @return versionDescription */ public String getVersionDescription() { return this.versionDescription; } /** * @return vpcId */ public String getVpcId() { return this.vpcId; } /** * @return zoneId */ public String getZoneId() { return this.zoneId; } public static final class Builder extends Request.Builder { private SystemDisk systemDisk; private String sourceRegionId; private String autoReleaseTime; private String creditSpecification; private java.util.List < DataDisk> dataDisk; private Boolean deletionProtection; private String deploymentSetId; private String description; private Boolean enableVmOsConfig; private String hostName; private String imageId; private String imageOwnerAlias; private String instanceChargeType; private String instanceName; private String instanceType; private String internetChargeType; private Integer internetMaxBandwidthIn; private Integer internetMaxBandwidthOut; private String ioOptimized; private Integer ipv6AddressCount; private String keyPairName; private String launchTemplateName; private java.util.List < NetworkInterface> networkInterface; private String networkType; private String ownerAccount; private Long ownerId; private Boolean passwordInherit; private Integer period; private String privateIpAddress; private String ramRoleName; private String regionId; private String resourceGroupId; private String resourceOwnerAccount; private Long resourceOwnerId; private String securityEnhancementStrategy; private String securityGroupId; private java.util.List < String > securityGroupIds; private Integer spotDuration; private Float spotPriceLimit; private String spotStrategy; private java.util.List < Tag> tag; private String templateResourceGroupId; private java.util.List < TemplateTag> templateTag; private String userData; private String vSwitchId; private String versionDescription; private String vpcId; private String zoneId; private Builder() { super(); } private Builder(CreateLaunchTemplateRequest request) { super(request); this.systemDisk = request.systemDisk; this.sourceRegionId = request.sourceRegionId; this.autoReleaseTime = request.autoReleaseTime; this.creditSpecification = request.creditSpecification; this.dataDisk = request.dataDisk; this.deletionProtection = request.deletionProtection; this.deploymentSetId = request.deploymentSetId; this.description = request.description; this.enableVmOsConfig = request.enableVmOsConfig; this.hostName = request.hostName; this.imageId = request.imageId; this.imageOwnerAlias = request.imageOwnerAlias; this.instanceChargeType = request.instanceChargeType; this.instanceName = request.instanceName; this.instanceType = request.instanceType; this.internetChargeType = request.internetChargeType; this.internetMaxBandwidthIn = request.internetMaxBandwidthIn; this.internetMaxBandwidthOut = request.internetMaxBandwidthOut; this.ioOptimized = request.ioOptimized; this.ipv6AddressCount = request.ipv6AddressCount; this.keyPairName = request.keyPairName; this.launchTemplateName = request.launchTemplateName; this.networkInterface = request.networkInterface; this.networkType = request.networkType; this.ownerAccount = request.ownerAccount; this.ownerId = request.ownerId; this.passwordInherit = request.passwordInherit; this.period = request.period; this.privateIpAddress = request.privateIpAddress; this.ramRoleName = request.ramRoleName; this.regionId = request.regionId; this.resourceGroupId = request.resourceGroupId; this.resourceOwnerAccount = request.resourceOwnerAccount; this.resourceOwnerId = request.resourceOwnerId; this.securityEnhancementStrategy = request.securityEnhancementStrategy; this.securityGroupId = request.securityGroupId; this.securityGroupIds = request.securityGroupIds; this.spotDuration = request.spotDuration; this.spotPriceLimit = request.spotPriceLimit; this.spotStrategy = request.spotStrategy; this.tag = request.tag; this.templateResourceGroupId = request.templateResourceGroupId; this.templateTag = request.templateTag; this.userData = request.userData; this.vSwitchId = request.vSwitchId; this.versionDescription = request.versionDescription; this.vpcId = request.vpcId; this.zoneId = request.zoneId; } /** * SystemDisk. */ public Builder systemDisk(SystemDisk systemDisk) { this.putQueryParameter("SystemDisk", systemDisk); this.systemDisk = systemDisk; return this; } /** * SourceRegionId. */ public Builder sourceRegionId(String sourceRegionId) { this.putHostParameter("SourceRegionId", sourceRegionId); this.sourceRegionId = sourceRegionId; return this; } /** * The automatic release time of the instance. Specify the time in the [ISO 8601](~~25696~~) standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. *

* * * If the value of `ss` is not `00`, the time is automatically rounded down to the nearest minute based on the value of `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 Builder autoReleaseTime(String autoReleaseTime) { this.putQueryParameter("AutoReleaseTime", autoReleaseTime); this.autoReleaseTime = autoReleaseTime; return this; } /** * The performance mode of the burstable instance. Valid values: *

* * * 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 [Overview of burstable instances](~~59977~~). */ public Builder creditSpecification(String creditSpecification) { this.putQueryParameter("CreditSpecification", creditSpecification); this.creditSpecification = creditSpecification; return this; } /** * The data disks. */ public Builder dataDisk(java.util.List < DataDisk> dataDisk) { this.putQueryParameter("DataDisk", dataDisk); this.dataDisk = dataDisk; return this; } /** * Specifies whether to enable release protection for the instance. This parameter specifies whether you can use the ECS console or call the [DeleteInstance](~~25507~~) operation to release the instance. Valid values: *

* * * true * * false * * Default value: false. * * > This parameter is applicable only to pay-as-you-go instances. The release protection feature can protect instances against manual releases, but not against automatic releases. */ public Builder deletionProtection(Boolean deletionProtection) { this.putQueryParameter("DeletionProtection", deletionProtection); this.deletionProtection = deletionProtection; return this; } /** * The ID of the deployment set to which to deploy the instance. */ public Builder deploymentSetId(String deploymentSetId) { this.putQueryParameter("DeploymentSetId", deploymentSetId); this.deploymentSetId = deploymentSetId; return this; } /** * The instance description. The description must be 2 to 256 characters in length and cannot start with `http://` or `https://`. */ public Builder description(String description) { this.putQueryParameter("Description", description); this.description = description; return this; } /** * Specifies whether to enable the operating system configuration of the instance. *

* * > This parameter will be removed in the future. To ensure future compatibility, we recommend that you use other parameters. */ public Builder enableVmOsConfig(Boolean enableVmOsConfig) { this.putQueryParameter("EnableVmOsConfig", enableVmOsConfig); this.enableVmOsConfig = enableVmOsConfig; return this; } /** * The instance 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, 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 Builder hostName(String hostName) { this.putQueryParameter("HostName", hostName); this.hostName = hostName; return this; } /** * The ID of the image to use to create the instance. You can call the [DescribeImages](~~25534~~) operation to query available images. */ public Builder imageId(String imageId) { this.putQueryParameter("ImageId", imageId); this.imageId = imageId; return this; } /** * The source of the image. Valid values: *

* * * system: public image provided by Alibaba Cloud. * * self: custom image that you created. * * others: shared image from another Alibaba Cloud account. * * marketplace:[Alibaba Cloud Marketplace](https://marketplace.alibabacloud.com/) image. If Alibaba Cloud Marketplace images are available, you can use the images without the need to subscribe to the images. Take note of the billing details of Alibaba Cloud Marketplace images. */ public Builder imageOwnerAlias(String imageOwnerAlias) { this.putQueryParameter("ImageOwnerAlias", imageOwnerAlias); this.imageOwnerAlias = imageOwnerAlias; return this; } /** * The billing method of the instance. Valid values: *

* * * PrePaid: subscription. If you set this parameter to PrePaid, make sure that your account has sufficient credits.Otherwise, an `InvalidPayMethod` error is returned. * * PostPaid: pay-as-you-go. */ public Builder instanceChargeType(String instanceChargeType) { this.putQueryParameter("InstanceChargeType", instanceChargeType); this.instanceChargeType = instanceChargeType; return this; } /** * The name of the instance. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with `http://` or `https://`. The name can contain letters, digits, colons (:), underscores (\_), and hyphens (-). */ public Builder instanceName(String instanceName) { this.putQueryParameter("InstanceName", instanceName); this.instanceName = instanceName; return this; } /** * The instance type of the instance. For more information, see [Instance families](~~25378~~). Alternatively, you can call the [DescribeInstanceTypes](~~25620~~) operation to query the most recent instance type list. */ public Builder instanceType(String instanceType) { this.putQueryParameter("InstanceType", instanceType); this.instanceType = instanceType; return this; } /** * The billing method for network usage. Valid values: *

* * * 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 bandwidths are used as the upper limits of bandwidths instead of guaranteed performance specifications. In scenarios where demand outstrips resource supplies, these maximum bandwidths may be limited. If you want guaranteed bandwidths for your instance, use the **pay-by-bandwidth** billing method for network usage. */ public Builder internetChargeType(String internetChargeType) { this.putQueryParameter("InternetChargeType", internetChargeType); this.internetChargeType = internetChargeType; return this; } /** * The maximum inbound public bandwidth. Unit: Mbit/s. Valid values: *

* * * 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 Builder internetMaxBandwidthIn(Integer internetMaxBandwidthIn) { this.putQueryParameter("InternetMaxBandwidthIn", internetMaxBandwidthIn); this.internetMaxBandwidthIn = internetMaxBandwidthIn; return this; } /** * The maximum outbound public bandwidth. Unit: Mbit/s. Valid values: 0 to 100. */ public Builder internetMaxBandwidthOut(Integer internetMaxBandwidthOut) { this.putQueryParameter("InternetMaxBandwidthOut", internetMaxBandwidthOut); this.internetMaxBandwidthOut = internetMaxBandwidthOut; return this; } /** * Specifies whether to create an I/O optimized instance. Valid values: *

* * * none: creates a non-I/O optimized instance. * * optimized: creates an I/O optimized instance. */ public Builder ioOptimized(String ioOptimized) { this.putQueryParameter("IoOptimized", ioOptimized); this.ioOptimized = ioOptimized; return this; } /** * The number of IPv6 addresses to randomly generate for the primary elastic network interface (ENI). Valid values: 1 to 10. */ public Builder ipv6AddressCount(Integer ipv6AddressCount) { this.putQueryParameter("Ipv6AddressCount", ipv6AddressCount); this.ipv6AddressCount = ipv6AddressCount; return this; } /** * The name of the key pair. This parameter is empty by default. *

* * * For Windows instances, this parameter is ignored The `Password` parameter takes effect even if the KeyPairName parameter is specified. * * For Linux instances, the password-based logon method is disabled by default. */ public Builder keyPairName(String keyPairName) { this.putQueryParameter("KeyPairName", keyPairName); this.keyPairName = keyPairName; return this; } /** * The name of the launch template. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with `http://` or `https://`. The name can contain letters, digits, colons (:), underscores (\_), and hyphens (-). */ public Builder launchTemplateName(String launchTemplateName) { this.putQueryParameter("LaunchTemplateName", launchTemplateName); this.launchTemplateName = launchTemplateName; return this; } /** * The information of the ENIs. */ public Builder networkInterface(java.util.List < NetworkInterface> networkInterface) { this.putQueryParameter("NetworkInterface", networkInterface); this.networkInterface = networkInterface; return this; } /** * The network type of the instance. Valid values: *

* * * classic: classic network * * vpc: VPC */ public Builder networkType(String networkType) { this.putQueryParameter("NetworkType", networkType); this.networkType = networkType; return this; } /** * OwnerAccount. */ public Builder ownerAccount(String ownerAccount) { this.putQueryParameter("OwnerAccount", ownerAccount); this.ownerAccount = ownerAccount; return this; } /** * OwnerId. */ public Builder ownerId(Long ownerId) { this.putQueryParameter("OwnerId", ownerId); this.ownerId = ownerId; return this; } /** * Specifies whether to use the preset password of the image. *

* * > If you set the PasswordInherit parameter to true, make sure that you leave the Password parameter empty and the selected image has a preset password. */ public Builder passwordInherit(Boolean passwordInherit) { this.putQueryParameter("PasswordInherit", passwordInherit); this.passwordInherit = passwordInherit; return this; } /** * The subscription duration of the instance. Unit: months. This parameter is valid and required only when `InstanceChargeType` is set to `PrePaid`. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36, 48, and 60. */ public Builder period(Integer period) { this.putQueryParameter("Period", period); this.period = period; return this; } /** * The private IP address to assign to the instance. *

* * To assign a private IP address to an instance that resides in a VPC, make sure that the IP address is an idle IP address within the CIDR block of the vSwitch specified by the `VSwitchId` parameter. */ public Builder privateIpAddress(String privateIpAddress) { this.putQueryParameter("PrivateIpAddress", privateIpAddress); this.privateIpAddress = privateIpAddress; return this; } /** * The name of the instance Resource Access Management (RAM) role. You can call the [ListRoles](~~28713~~) operation provided by RAM to query the instance RAM roles that you created. */ public Builder ramRoleName(String ramRoleName) { this.putQueryParameter("RamRoleName", ramRoleName); this.ramRoleName = ramRoleName; return this; } /** * The ID of the region in which to create the launch template. You can call the [DescribeRegions](~~25609~~) operation to query the most recent region list. */ public Builder regionId(String regionId) { this.putQueryParameter("RegionId", regionId); this.regionId = regionId; return this; } /** * The ID of the resource group to which to assign the instance, Elastic Block Storage (EBS) device, and elastic network interface (ENI). */ public Builder resourceGroupId(String resourceGroupId) { this.putQueryParameter("ResourceGroupId", resourceGroupId); this.resourceGroupId = resourceGroupId; return this; } /** * ResourceOwnerAccount. */ public Builder resourceOwnerAccount(String resourceOwnerAccount) { this.putQueryParameter("ResourceOwnerAccount", resourceOwnerAccount); this.resourceOwnerAccount = resourceOwnerAccount; return this; } /** * ResourceOwnerId. */ public Builder resourceOwnerId(Long resourceOwnerId) { this.putQueryParameter("ResourceOwnerId", resourceOwnerId); this.resourceOwnerId = resourceOwnerId; return this; } /** * Specifies whether to enable security hardening for the operating system. Valid values: *

* * * 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 Builder securityEnhancementStrategy(String securityEnhancementStrategy) { this.putQueryParameter("SecurityEnhancementStrategy", securityEnhancementStrategy); this.securityEnhancementStrategy = securityEnhancementStrategy; return this; } /** * The ID of the security group to which to assign the instance. Instances in the same security group can communicate with each other. A security group can contain up to 1,000 instances. *

* * > You cannot specify both the `SecurityGroupId` and `SecurityGroupIds.N` parameters. */ public Builder securityGroupId(String securityGroupId) { this.putQueryParameter("SecurityGroupId", securityGroupId); this.securityGroupId = securityGroupId; return this; } /** * The IDs of the security groups to which to assign the instance. The valid values of N are based on the maximum number of security groups to which the instance can belong. For more information, see the "Security group limits" section in [Limits](~~25412~~). *

* * > You cannot specify both the `SecurityGroupId` and `SecurityGroupIds.N` parameters. */ public Builder securityGroupIds(java.util.List < String > securityGroupIds) { this.putQueryParameter("SecurityGroupIds", securityGroupIds); this.securityGroupIds = securityGroupIds; return this; } /** * The protection period of the preemptible instance. Unit: hours. Default value: 1. Valid values: *

* * * 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 a protection period based on your business requirements. * * > This parameter takes effect only if SpotStrategy is set to SpotWithPriceLimit or SpotAsPriceGo. */ public Builder spotDuration(Integer spotDuration) { this.putQueryParameter("SpotDuration", spotDuration); this.spotDuration = spotDuration; return this; } /** * The maximum hourly price of the instance. The value is accurate to three decimal places. This parameter is valid only when the `SpotStrategy` parameter is set to `SpotWithPriceLimit`. */ public Builder spotPriceLimit(Float spotPriceLimit) { this.putQueryParameter("SpotPriceLimit", spotPriceLimit); this.spotPriceLimit = spotPriceLimit; return this; } /** * 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 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 bidding price. */ public Builder spotStrategy(String spotStrategy) { this.putQueryParameter("SpotStrategy", spotStrategy); this.spotStrategy = spotStrategy; return this; } /** * The tags of the launch template. */ public Builder tag(java.util.List < Tag> tag) { this.putQueryParameter("Tag", tag); this.tag = tag; return this; } /** * The ID of the resource group to which the launch template belongs. */ public Builder templateResourceGroupId(String templateResourceGroupId) { this.putQueryParameter("TemplateResourceGroupId", templateResourceGroupId); this.templateResourceGroupId = templateResourceGroupId; return this; } /** * The tags to add to the launch template. */ public Builder templateTag(java.util.List < TemplateTag> templateTag) { this.putQueryParameter("TemplateTag", templateTag); this.templateTag = templateTag; return this; } /** * The user data of the instance. The user data must be encoded in Base64. The maximum size of raw data is 32 KB. */ public Builder userData(String userData) { this.putQueryParameter("UserData", userData); this.userData = userData; return this; } /** * The ID of the vSwitch to which to connect the instance. This parameter is required if you specify the VpcId parameter. */ public Builder vSwitchId(String vSwitchId) { this.putQueryParameter("VSwitchId", vSwitchId); this.vSwitchId = vSwitchId; return this; } /** * The description of the launch template version. The description must be 2 to 256 characters in length and cannot start with `http://` or `https://`. */ public Builder versionDescription(String versionDescription) { this.putQueryParameter("VersionDescription", versionDescription); this.versionDescription = versionDescription; return this; } /** * The ID of the virtual private cloud (VPC). */ public Builder vpcId(String vpcId) { this.putQueryParameter("VpcId", vpcId); this.vpcId = vpcId; return this; } /** * The ID of the zone in which to create the instance. */ public Builder zoneId(String zoneId) { this.putQueryParameter("ZoneId", zoneId); this.zoneId = zoneId; return this; } @Override public CreateLaunchTemplateRequest build() { return new CreateLaunchTemplateRequest(this); } } public static class SystemDisk extends TeaModel { @com.aliyun.core.annotation.NameInMap("AutoSnapshotPolicyId") private String autoSnapshotPolicyId; @com.aliyun.core.annotation.NameInMap("BurstingEnabled") private Boolean burstingEnabled; @com.aliyun.core.annotation.NameInMap("Category") private String category; @com.aliyun.core.annotation.NameInMap("DeleteWithInstance") private Boolean deleteWithInstance; @com.aliyun.core.annotation.NameInMap("Description") private String description; @com.aliyun.core.annotation.NameInMap("DiskName") private String diskName; @com.aliyun.core.annotation.NameInMap("Encrypted") private String encrypted; @com.aliyun.core.annotation.NameInMap("Iops") private Integer iops; @com.aliyun.core.annotation.NameInMap("PerformanceLevel") private String performanceLevel; @com.aliyun.core.annotation.NameInMap("ProvisionedIops") private Long provisionedIops; @com.aliyun.core.annotation.NameInMap("Size") private Integer size; private SystemDisk(Builder builder) { this.autoSnapshotPolicyId = builder.autoSnapshotPolicyId; this.burstingEnabled = builder.burstingEnabled; this.category = builder.category; this.deleteWithInstance = builder.deleteWithInstance; this.description = builder.description; this.diskName = builder.diskName; this.encrypted = builder.encrypted; this.iops = builder.iops; this.performanceLevel = builder.performanceLevel; this.provisionedIops = builder.provisionedIops; this.size = builder.size; } public static Builder builder() { return new Builder(); } public static SystemDisk create() { return builder().build(); } /** * @return autoSnapshotPolicyId */ public String getAutoSnapshotPolicyId() { return this.autoSnapshotPolicyId; } /** * @return burstingEnabled */ public Boolean getBurstingEnabled() { return this.burstingEnabled; } /** * @return category */ public String getCategory() { return this.category; } /** * @return deleteWithInstance */ public Boolean getDeleteWithInstance() { return this.deleteWithInstance; } /** * @return description */ public String getDescription() { return this.description; } /** * @return diskName */ public String getDiskName() { return this.diskName; } /** * @return encrypted */ public String getEncrypted() { return this.encrypted; } /** * @return iops */ public Integer getIops() { return this.iops; } /** * @return performanceLevel */ public String getPerformanceLevel() { return this.performanceLevel; } /** * @return provisionedIops */ public Long getProvisionedIops() { return this.provisionedIops; } /** * @return size */ public Integer getSize() { return this.size; } public static final class Builder { private String autoSnapshotPolicyId; private Boolean burstingEnabled; private String category; private Boolean deleteWithInstance; private String description; private String diskName; private String encrypted; private Integer iops; private String performanceLevel; private Long provisionedIops; private Integer size; /** * The ID of the automatic snapshot policy to apply to the system disk. */ public Builder autoSnapshotPolicyId(String autoSnapshotPolicyId) { this.autoSnapshotPolicyId = autoSnapshotPolicyId; return this; } /** * Specifies whether to enable the performance burst feature for the system disk. Valid values: *

* * * true * * false */ public Builder burstingEnabled(Boolean burstingEnabled) { this.burstingEnabled = burstingEnabled; return this; } /** * The category of the system disk. Valid values: *

* * * cloud: basic disk. * * cloud_efficiency: ultra disk. * * cloud_ssd: standard SSD. * * cloud_essd: Enterprise SSD (ESSD). You can use `SystemDisk.PerformanceLevel` to set the performance level of the ESSD to use as the system disk. * * cloud_auto: ESSD AutoPL disk. * * cloud_essd_entry: ESSD Entry disk. * * For non-I/O optimized instances of retired instance types, the default value is cloud. For other types of instances, the default value is cloud_efficiency. */ public Builder category(String category) { this.category = category; return this; } /** * Specifies whether to release the system disk when the instance is released. Valid values: *

* * * true * * false * * Default value: true. */ public Builder deleteWithInstance(Boolean deleteWithInstance) { this.deleteWithInstance = deleteWithInstance; return this; } /** * The description of the system disk. The description must be 2 to 256 characters in length and cannot start with `http://` or `https://`. */ public Builder description(String description) { this.description = description; return this; } /** * The name of the system disk. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with `http://` or `https://`. The name can contain letters, digits, colons (:), underscores (\_), and hyphens (-). */ public Builder diskName(String diskName) { this.diskName = diskName; return this; } /** * Specifies whether to encrypt the system disk. Valid values: *

* * * true * * false * * Default value: false. * * > If you create an instance in Hong Kong Zone D or Singapore Zone A, you cannot encrypt the system disk. */ public Builder encrypted(String encrypted) { this.encrypted = encrypted; return this; } /** * > This parameter is in invitational preview and is unavailable for general users. */ public Builder iops(Integer iops) { this.iops = iops; return this; } /** * The performance level of the ESSD to use as the system disk. Default value: PL0. Valid values: *

* * * PL0: A single ESSD can deliver up to 10,000 random read/write IOPS. * * PL1: A single ESSD can deliver up to 50,000 random read/write IOPS. * * PL2: A single ESSD can deliver up to 100,000 random read/write IOPS. * * PL3: A single ESSD can deliver up to 1,000,000 random read/write IOPS. * * For more information about ESSD performance levels, see [ESSDs](~~122389~~). */ public Builder performanceLevel(String performanceLevel) { this.performanceLevel = performanceLevel; return this; } /** * The provisioned read/write IOPS of the ESSD AutoPL disk to use as the system disk. Valid values: 0 to min{50,000, 1,000 × Capacity - Baseline IOPS} *

* * Baseline IOPS = min{1,800 + 50 × Capacity, 50,000} * * > This parameter is available only if you set the SystemDisk.Category parameter to cloud_auto. For more information, see [ESSD AutoPL disks](~~368372~~) and [Modify the performance configurations of an ESSD AutoPL disk](~~413275~~). */ public Builder provisionedIops(Long provisionedIops) { this.provisionedIops = provisionedIops; return this; } /** * The size of the system disk. Unit: GiB. Valid values: *

* * * Valid values if you set SystemDisk.Category to cloud: 20 to 500. * * Valid values if you set SystemDisk.Category to other disk categories: 20 to 2048. * * The value of this parameter must be at least 20 and greater than or equal to the size of the image. */ public Builder size(Integer size) { this.size = size; return this; } public SystemDisk build() { return new SystemDisk(this); } } } public static class DataDisk extends TeaModel { @com.aliyun.core.annotation.NameInMap("AutoSnapshotPolicyId") private String autoSnapshotPolicyId; @com.aliyun.core.annotation.NameInMap("BurstingEnabled") private Boolean burstingEnabled; @com.aliyun.core.annotation.NameInMap("Category") private String category; @com.aliyun.core.annotation.NameInMap("DeleteWithInstance") private Boolean deleteWithInstance; @com.aliyun.core.annotation.NameInMap("Description") private String description; @com.aliyun.core.annotation.NameInMap("Device") private String device; @com.aliyun.core.annotation.NameInMap("DiskName") private String diskName; @com.aliyun.core.annotation.NameInMap("Encrypted") private String encrypted; @com.aliyun.core.annotation.NameInMap("PerformanceLevel") private String performanceLevel; @com.aliyun.core.annotation.NameInMap("ProvisionedIops") private Long provisionedIops; @com.aliyun.core.annotation.NameInMap("Size") private Integer size; @com.aliyun.core.annotation.NameInMap("SnapshotId") private String snapshotId; private DataDisk(Builder builder) { this.autoSnapshotPolicyId = builder.autoSnapshotPolicyId; this.burstingEnabled = builder.burstingEnabled; this.category = builder.category; this.deleteWithInstance = builder.deleteWithInstance; this.description = builder.description; this.device = builder.device; this.diskName = builder.diskName; this.encrypted = builder.encrypted; this.performanceLevel = builder.performanceLevel; this.provisionedIops = builder.provisionedIops; this.size = builder.size; this.snapshotId = builder.snapshotId; } public static Builder builder() { return new Builder(); } public static DataDisk create() { return builder().build(); } /** * @return autoSnapshotPolicyId */ public String getAutoSnapshotPolicyId() { return this.autoSnapshotPolicyId; } /** * @return burstingEnabled */ public Boolean getBurstingEnabled() { return this.burstingEnabled; } /** * @return category */ public String getCategory() { return this.category; } /** * @return deleteWithInstance */ public Boolean getDeleteWithInstance() { return this.deleteWithInstance; } /** * @return description */ public String getDescription() { return this.description; } /** * @return device */ public String getDevice() { return this.device; } /** * @return diskName */ public String getDiskName() { return this.diskName; } /** * @return encrypted */ public String getEncrypted() { return this.encrypted; } /** * @return performanceLevel */ public String getPerformanceLevel() { return this.performanceLevel; } /** * @return provisionedIops */ public Long getProvisionedIops() { return this.provisionedIops; } /** * @return size */ public Integer getSize() { return this.size; } /** * @return snapshotId */ public String getSnapshotId() { return this.snapshotId; } public static final class Builder { private String autoSnapshotPolicyId; private Boolean burstingEnabled; private String category; private Boolean deleteWithInstance; private String description; private String device; private String diskName; private String encrypted; private String performanceLevel; private Long provisionedIops; private Integer size; private String snapshotId; /** * The ID of the automatic snapshot policy to apply to data disk N. */ public Builder autoSnapshotPolicyId(String autoSnapshotPolicyId) { this.autoSnapshotPolicyId = autoSnapshotPolicyId; return this; } /** * Specifies whether to enable the performance burst feature for data disk N. Valid values: *

* * * true * * false */ public Builder burstingEnabled(Boolean burstingEnabled) { this.burstingEnabled = burstingEnabled; return this; } /** * The category of data disk N. Valid values: *

* * * cloud: basic disk * * cloud_efficiency: ultra disk * * cloud_ssd: standard SSD * * cloud_essd: ESSD * * cloud_auto: ESSD AutoPL disk * * cloud_essd_entry: ESSD Entry disk * * For I/O optimized instances, the default value is cloud_efficiency. For non-I/O optimized instances, the default value is cloud. */ public Builder category(String category) { this.category = category; return this; } /** * Specifies whether to release data disk N when the instance is released. Valid values: *

* * * true * * false * * Default value: true. */ public Builder deleteWithInstance(Boolean deleteWithInstance) { this.deleteWithInstance = deleteWithInstance; return this; } /** * The description of data disk N. The description must be 2 to 256 characters in length and cannot start with `http://` or `https://`. */ public Builder description(String description) { this.description = description; return this; } /** * > This parameter will be removed in the future. We recommend that you do not use this parameter to ensure future compatibility. */ public Builder device(String device) { this.device = device; return this; } /** * The name of data disk N. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with `http://` or `https://`. The name can contain letters, digits, colons (:), underscores (\_), and hyphens (-). */ public Builder diskName(String diskName) { this.diskName = diskName; return this; } /** * Specifies whether to encrypt data disk N. */ public Builder encrypted(String encrypted) { this.encrypted = encrypted; return this; } /** * The performance level of the ESSD to use as data disk N. The value of N must be the same as that in `DataDisk.N.Category` when DataDisk.N.Category is set to cloud_essd. Valid values: *

* * * PL0: A single ESSD can deliver up to 10,000 random read/write IOPS. * * PL1 (default): A single ESSD can deliver up to 50,000 random read/write IOPS. * * PL2: A single ESSD can deliver up to 100,000 random read/write IOPS. * * PL3: A single ESSD can deliver up to 1,000,000 random read/write IOPS. * * For information about ESSD performance levels, see [ESSDs](~~122389~~). */ public Builder performanceLevel(String performanceLevel) { this.performanceLevel = performanceLevel; return this; } /** * The provisioned read/write IOPS of the ESSD AutoPL disk. Valid values: 0 to min{50,000, 1,000 × Capacity - Baseline IOPS}. *

* * Baseline IOPS = min{1,800 + 50 × Capacity, 50,000}. * * > This parameter is available only if you set DataDisk.N.Category to cloud_auto. For more information, see [ESSD AutoPL disks](~~368372~~) and [Modify the performance configurations of an ESSD AutoPL disk](~~413275~~). */ public Builder provisionedIops(Long provisionedIops) { this.provisionedIops = provisionedIops; return this; } /** * The size of data disk N. Valid values of N: 1 to 16. Unit: GiB. Valid values: *

* * * Valid values if you set DataDisk.N.Category to cloud: 5 to 2000. * * * Valid values if you set DataDisk.N.Category to cloud_efficiency: 20 to 32768. * * * Valid values if you set DataDisk.N.Category to cloud_ssd: 20 to 32768. * * * Valid values if you set DataDisk.N.Category to cloud_essd: vary based on the value of `DataDisk.N.PerformanceLevel`. * * * Valid values if you set DataDisk.N.PerformanceLevel to PL0: 1 to 32768. * * Valid values if you set DataDisk.N.PerformanceLevel to PL1: 20 to 32768. * * Valid values if you set DataDisk.N.PerformanceLevel to PL2: 461 to 32768. * * Valid values if you set DataDisk.N.PerformanceLevel to PL3: 1261 to 32768. * * * Valid values if you set DataDisk.N.Category to cloud_auto: 1 to 32768. * * * Valid values if you set DataDisk.N.Category to cloud_essd_entry: 10 to 32768. * * The value of this parameter must be greater than or equal to the size of the snapshot specified by `DataDisk.N.SnapshotId`. */ public Builder size(Integer size) { this.size = size; return this; } /** * The ID of the snapshot to use to create data disk N. Valid values of N: 1 to 16. If you specify `DataDisk.N.SnapshotId`, `DataDisk.N.Size` is ignored. The data disk is created with the size of the specified snapshot. *

* * > Use snapshots created on or after July 15, 2013. Otherwise, an error is returned and your request is rejected. */ public Builder snapshotId(String snapshotId) { this.snapshotId = snapshotId; return this; } public DataDisk build() { return new DataDisk(this); } } } public static class NetworkInterface extends TeaModel { @com.aliyun.core.annotation.NameInMap("Description") private String description; @com.aliyun.core.annotation.NameInMap("InstanceType") private String instanceType; @com.aliyun.core.annotation.NameInMap("NetworkInterfaceName") private String networkInterfaceName; @com.aliyun.core.annotation.NameInMap("NetworkInterfaceTrafficMode") private String networkInterfaceTrafficMode; @com.aliyun.core.annotation.NameInMap("PrimaryIpAddress") private String primaryIpAddress; @com.aliyun.core.annotation.NameInMap("SecurityGroupId") private String securityGroupId; @com.aliyun.core.annotation.NameInMap("SecurityGroupIds") private java.util.List < String > securityGroupIds; @com.aliyun.core.annotation.NameInMap("VSwitchId") private String vSwitchId; private NetworkInterface(Builder builder) { this.description = builder.description; this.instanceType = builder.instanceType; this.networkInterfaceName = builder.networkInterfaceName; this.networkInterfaceTrafficMode = builder.networkInterfaceTrafficMode; this.primaryIpAddress = builder.primaryIpAddress; this.securityGroupId = builder.securityGroupId; this.securityGroupIds = builder.securityGroupIds; this.vSwitchId = builder.vSwitchId; } public static Builder builder() { return new Builder(); } public static NetworkInterface create() { return builder().build(); } /** * @return description */ public String getDescription() { return this.description; } /** * @return instanceType */ public String getInstanceType() { return this.instanceType; } /** * @return networkInterfaceName */ public String getNetworkInterfaceName() { return this.networkInterfaceName; } /** * @return networkInterfaceTrafficMode */ public String getNetworkInterfaceTrafficMode() { return this.networkInterfaceTrafficMode; } /** * @return primaryIpAddress */ public String getPrimaryIpAddress() { return this.primaryIpAddress; } /** * @return securityGroupId */ public String getSecurityGroupId() { return this.securityGroupId; } /** * @return securityGroupIds */ public java.util.List < String > getSecurityGroupIds() { return this.securityGroupIds; } /** * @return vSwitchId */ public String getVSwitchId() { return this.vSwitchId; } public static final class Builder { private String description; private String instanceType; private String networkInterfaceName; private String networkInterfaceTrafficMode; private String primaryIpAddress; private String securityGroupId; private java.util.List < String > securityGroupIds; private String vSwitchId; /** * The description of the secondary ENI. The description must be 2 to 256 characters in length and cannot start with `http://` or `https://`. The value of N in `NetworkInterface.N` cannot be greater than 1. */ public Builder description(String description) { this.description = description; return this; } /** * The type of ENI N. Valid values of N: 1 and 2. If the value of N is 1, you can configure a primary or secondary ENI. If the value of N is 2, you must configure a primary ENI and a secondary ENI. *

* * Valid values: * * * Primary * * Secondary * * Default value: Secondary. */ public Builder instanceType(String instanceType) { this.instanceType = instanceType; return this; } /** * The name of ENI N. *

* * Take note of the following items: * * * Valid values of N: 1 and 2. If the value of N is 1, you can configure a primary or secondary ENI. If the value of N is 2, you must configure a primary ENI and a secondary ENI. * * If `NetworkInterface.N.InstanceType` is set to `Primary`, you do not need to set this parameter. */ public Builder networkInterfaceName(String networkInterfaceName) { this.networkInterfaceName = networkInterfaceName; return this; } /** * The communication mode of the primary ENI. Valid values: *

* * * Standard: uses the TCP communication mode. * * HighPerformance: uses the remote direct memory access (RDMA) communication mode with Elastic RDMA Interface (ERI) enabled. */ public Builder networkInterfaceTrafficMode(String networkInterfaceTrafficMode) { this.networkInterfaceTrafficMode = networkInterfaceTrafficMode; return this; } /** * The primary IP address to assign to ENI N. *

* * Take note of the following items: * * * Valid values of N: 1 and 2. * * * If the value of N is 1, you can configure a primary or secondary ENI. If this parameter is specified, `Amount` is set to a numeric value greater than 1, and NetworkInterface.N.InstanceType is set to Primary, the specified number of instances are created and consecutive primary IP addresses starting from the specified one are assigned to the instances. In this case, you cannot attach secondary ENIs to the instances. * * If the value of N is 2, you can configure a primary ENI and a secondary ENI. If this parameter is specified, `Amount` is set to a numeric value greater than 1, and NetworkInterface.N.InstanceType is set to Primary, you cannot set `NetworkInterface.2.InstanceType` to Secondary to attach a secondary ENI. * * * If `NetworkInterface.N.InstanceType` is set to `Primary`, this parameter is equivalent to `PrivateIpAddress`. You cannot specify both this parameter and `PrivateIpAddress`. * * * If `NetworkInterface.N.InstanceType` is set to `Secondary` or left empty, the specified primary IP address is assigned to the secondary ENI. The default value is an IP address that is randomly selected from within the CIDR block of the vSwitch to which to connect the secondary ENI. * * > You can attach only a single secondary ENI when you create an instance. After the instance is created, you can call the [CreateNetworkInterface](~~58504~~) and [AttachNetworkInterface](~~58515~~) operations to attach more secondary ENIs. */ public Builder primaryIpAddress(String primaryIpAddress) { this.primaryIpAddress = primaryIpAddress; return this; } /** * The ID of the security group to which to assign ENI N. *

* * Take note of the following items: * * * Valid values of N: 1 and 2. If the value of N is 1, you can configure a primary or secondary ENI. If the value of N is 2, you must configure a primary ENI and a secondary ENI. * * If `NetworkInterface.N.InstanceType` is set to `Primary`, you must set this parameter. In this case, this parameter is equivalent to `SecurityGroupId`. You cannot specify `SecurityGroupId`, `SecurityGroupIds.N`, or `NetworkInterface.N.SecurityGroupIds.N`. * * If `NetworkInterface.N.InstanceType` is set to `Secondary` or left empty, this parameter is optional. The default value is the ID of the security group to which to assign the instance. */ public Builder securityGroupId(String securityGroupId) { this.securityGroupId = securityGroupId; return this; } /** * The ID of security group N to which to assign ENI N. *

* * * Valid values of the first N: 1 and 2. If the value of N is 1, you can configure a primary or secondary ENI. If the value of N is 2, you must configure a primary ENI and a secondary ENI. * * The second N indicates that one or more security group IDs can be specified. The valid values of N vary based on the maximum number of security groups to which an instance can belong. For more information, see the [Security group limits](~~25412#SecurityGroupQuota1~~) section of the "Limits" topic. * * Take note of the following items: * * * If `NetworkInterface.N.InstanceType` is set to `Primary`, you must specify this parameter or `NetworkInterface.N.SecurityGroupId`. In this case, this parameter is equivalent to `SecurityGroupIds.N`. You cannot specify `SecurityGroupId`, `SecurityGroupIds.N`, or `NetworkInterface.N.SecurityGroupId`. * * If `NetworkInterface.N.InstanceType` is set to `Secondary` or left empty, this parameter is optional. The default value is the ID of the security group to which to assign the instance. */ public Builder securityGroupIds(java.util.List < String > securityGroupIds) { this.securityGroupIds = securityGroupIds; return this; } /** * The ID of the vSwitch to which to connect ENI N. *

* * Take note of the following items: * * * Valid values of N: 1 and 2. If the value of N is 1, you can configure a primary or secondary ENI. If the value of N is 2, you must configure a primary ENI and a secondary ENI. * * If `NetworkInterface.N.InstanceType` is set to `Primary`, you must set this parameter. In this case, this parameter is equivalent to `VSwitchId`. You cannot specify both NetworkInterface.N.VSwitchId and `VSwitchId`. * * If `NetworkInterface.N.InstanceType` is set to `Secondary` or left empty, this parameter is optional. The default value is the VSwitchId value. */ public Builder vSwitchId(String vSwitchId) { this.vSwitchId = vSwitchId; return this; } public NetworkInterface build() { return new NetworkInterface(this); } } } public static class Tag extends TeaModel { @com.aliyun.core.annotation.NameInMap("Key") private String key; @com.aliyun.core.annotation.NameInMap("Value") private String value; private Tag(Builder builder) { this.key = builder.key; this.value = builder.value; } public static Builder builder() { return new Builder(); } public static Tag create() { return builder().build(); } /** * @return key */ public String getKey() { return this.key; } /** * @return value */ public String getValue() { return this.value; } public static final class Builder { private String key; private String value; /** * The key of tag N to add to the instance, EBS device, and ENI. Valid values of N: 1 to 20. The tag key cannot be an empty string. It can be up to 64 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`. */ public Builder key(String key) { this.key = key; return this; } /** * The value of tag N to add to the instance, EBS device, and ENI. Valid values of N: 1 to 20. The tag value can be an empty string. It can be up to 128 characters in length. It cannot start with acs: or aliyun or contain [http:// or https://.](http://https://。) */ public Builder value(String value) { this.value = value; return this; } public Tag build() { return new Tag(this); } } } public static class TemplateTag extends TeaModel { @com.aliyun.core.annotation.NameInMap("Key") private String key; @com.aliyun.core.annotation.NameInMap("Value") private String value; private TemplateTag(Builder builder) { this.key = builder.key; this.value = builder.value; } public static Builder builder() { return new Builder(); } public static TemplateTag create() { return builder().build(); } /** * @return key */ public String getKey() { return this.key; } /** * @return value */ public String getValue() { return this.value; } public static final class Builder { private String key; private String value; /** * The key of tag N to add to the launch template. Valid values of N: 1 to 20. The tag key cannot be an empty string. It can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`. */ public Builder key(String key) { this.key = key; return this; } /** * The value of tag N to add to the launch template. Valid values of N: 1 to 20. The tag value can be an empty string. It can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`. */ public Builder value(String value) { this.value = value; return this; } public TemplateTag build() { return new TemplateTag(this); } } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy