com.aliyun.sdk.service.ecs20140526.models.CreateDiskRequest Maven / Gradle / Ivy
Show all versions of alibabacloud-ecs20140526 Show documentation
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.sdk.service.ecs20140526.models;
import com.aliyun.core.annotation.*;
import darabonba.core.RequestModel;
import darabonba.core.TeaModel;
import com.aliyun.sdk.gateway.pop.models.*;
/**
* {@link CreateDiskRequest} extends {@link RequestModel}
*
* CreateDiskRequest
*/
public class CreateDiskRequest extends Request {
@Host
@NameInMap("SourceRegionId")
private String sourceRegionId;
@Query
@NameInMap("AdvancedFeatures")
private String advancedFeatures;
@Query
@NameInMap("Arn")
private java.util.List < Arn> arn;
@Query
@NameInMap("BurstingEnabled")
private Boolean burstingEnabled;
@Query
@NameInMap("ClientToken")
private String clientToken;
@Query
@NameInMap("Description")
private String description;
@Query
@NameInMap("DiskCategory")
private String diskCategory;
@Query
@NameInMap("DiskName")
private String diskName;
@Query
@NameInMap("EncryptAlgorithm")
private String encryptAlgorithm;
@Query
@NameInMap("Encrypted")
private Boolean encrypted;
@Query
@NameInMap("InstanceId")
private String instanceId;
@Query
@NameInMap("KMSKeyId")
private String KMSKeyId;
@Query
@NameInMap("MultiAttach")
private String multiAttach;
@Query
@NameInMap("OwnerAccount")
private String ownerAccount;
@Query
@NameInMap("OwnerId")
private Long ownerId;
@Query
@NameInMap("PerformanceLevel")
private String performanceLevel;
@Query
@NameInMap("ProvisionedIops")
private Long provisionedIops;
@Query
@NameInMap("RegionId")
@Validation(required = true)
private String regionId;
@Query
@NameInMap("ResourceGroupId")
private String resourceGroupId;
@Query
@NameInMap("ResourceOwnerAccount")
private String resourceOwnerAccount;
@Query
@NameInMap("ResourceOwnerId")
private Long resourceOwnerId;
@Query
@NameInMap("Size")
@Validation(maximum = 65536, minimum = 1)
private Integer size;
@Query
@NameInMap("SnapshotId")
private String snapshotId;
@Query
@NameInMap("StorageClusterId")
private String storageClusterId;
@Query
@NameInMap("StorageSetId")
private String storageSetId;
@Query
@NameInMap("StorageSetPartitionNumber")
private Integer storageSetPartitionNumber;
@Query
@NameInMap("Tag")
private java.util.List < Tag> tag;
@Query
@NameInMap("ZoneId")
private String zoneId;
private CreateDiskRequest(Builder builder) {
super(builder);
this.sourceRegionId = builder.sourceRegionId;
this.advancedFeatures = builder.advancedFeatures;
this.arn = builder.arn;
this.burstingEnabled = builder.burstingEnabled;
this.clientToken = builder.clientToken;
this.description = builder.description;
this.diskCategory = builder.diskCategory;
this.diskName = builder.diskName;
this.encryptAlgorithm = builder.encryptAlgorithm;
this.encrypted = builder.encrypted;
this.instanceId = builder.instanceId;
this.KMSKeyId = builder.KMSKeyId;
this.multiAttach = builder.multiAttach;
this.ownerAccount = builder.ownerAccount;
this.ownerId = builder.ownerId;
this.performanceLevel = builder.performanceLevel;
this.provisionedIops = builder.provisionedIops;
this.regionId = builder.regionId;
this.resourceGroupId = builder.resourceGroupId;
this.resourceOwnerAccount = builder.resourceOwnerAccount;
this.resourceOwnerId = builder.resourceOwnerId;
this.size = builder.size;
this.snapshotId = builder.snapshotId;
this.storageClusterId = builder.storageClusterId;
this.storageSetId = builder.storageSetId;
this.storageSetPartitionNumber = builder.storageSetPartitionNumber;
this.tag = builder.tag;
this.zoneId = builder.zoneId;
}
public static Builder builder() {
return new Builder();
}
public static CreateDiskRequest create() {
return builder().build();
}
@Override
public Builder toBuilder() {
return new Builder(this);
}
/**
* @return sourceRegionId
*/
public String getSourceRegionId() {
return this.sourceRegionId;
}
/**
* @return advancedFeatures
*/
public String getAdvancedFeatures() {
return this.advancedFeatures;
}
/**
* @return arn
*/
public java.util.List < Arn> getArn() {
return this.arn;
}
/**
* @return burstingEnabled
*/
public Boolean getBurstingEnabled() {
return this.burstingEnabled;
}
/**
* @return clientToken
*/
public String getClientToken() {
return this.clientToken;
}
/**
* @return description
*/
public String getDescription() {
return this.description;
}
/**
* @return diskCategory
*/
public String getDiskCategory() {
return this.diskCategory;
}
/**
* @return diskName
*/
public String getDiskName() {
return this.diskName;
}
/**
* @return encryptAlgorithm
*/
public String getEncryptAlgorithm() {
return this.encryptAlgorithm;
}
/**
* @return encrypted
*/
public Boolean getEncrypted() {
return this.encrypted;
}
/**
* @return instanceId
*/
public String getInstanceId() {
return this.instanceId;
}
/**
* @return KMSKeyId
*/
public String getKMSKeyId() {
return this.KMSKeyId;
}
/**
* @return multiAttach
*/
public String getMultiAttach() {
return this.multiAttach;
}
/**
* @return ownerAccount
*/
public String getOwnerAccount() {
return this.ownerAccount;
}
/**
* @return ownerId
*/
public Long getOwnerId() {
return this.ownerId;
}
/**
* @return performanceLevel
*/
public String getPerformanceLevel() {
return this.performanceLevel;
}
/**
* @return provisionedIops
*/
public Long getProvisionedIops() {
return this.provisionedIops;
}
/**
* @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 size
*/
public Integer getSize() {
return this.size;
}
/**
* @return snapshotId
*/
public String getSnapshotId() {
return this.snapshotId;
}
/**
* @return storageClusterId
*/
public String getStorageClusterId() {
return this.storageClusterId;
}
/**
* @return storageSetId
*/
public String getStorageSetId() {
return this.storageSetId;
}
/**
* @return storageSetPartitionNumber
*/
public Integer getStorageSetPartitionNumber() {
return this.storageSetPartitionNumber;
}
/**
* @return tag
*/
public java.util.List < Tag> getTag() {
return this.tag;
}
/**
* @return zoneId
*/
public String getZoneId() {
return this.zoneId;
}
public static final class Builder extends Request.Builder {
private String sourceRegionId;
private String advancedFeatures;
private java.util.List < Arn> arn;
private Boolean burstingEnabled;
private String clientToken;
private String description;
private String diskCategory;
private String diskName;
private String encryptAlgorithm;
private Boolean encrypted;
private String instanceId;
private String KMSKeyId;
private String multiAttach;
private String ownerAccount;
private Long ownerId;
private String performanceLevel;
private Long provisionedIops;
private String regionId;
private String resourceGroupId;
private String resourceOwnerAccount;
private Long resourceOwnerId;
private Integer size;
private String snapshotId;
private String storageClusterId;
private String storageSetId;
private Integer storageSetPartitionNumber;
private java.util.List < Tag> tag;
private String zoneId;
private Builder() {
super();
}
private Builder(CreateDiskRequest request) {
super(request);
this.sourceRegionId = request.sourceRegionId;
this.advancedFeatures = request.advancedFeatures;
this.arn = request.arn;
this.burstingEnabled = request.burstingEnabled;
this.clientToken = request.clientToken;
this.description = request.description;
this.diskCategory = request.diskCategory;
this.diskName = request.diskName;
this.encryptAlgorithm = request.encryptAlgorithm;
this.encrypted = request.encrypted;
this.instanceId = request.instanceId;
this.KMSKeyId = request.KMSKeyId;
this.multiAttach = request.multiAttach;
this.ownerAccount = request.ownerAccount;
this.ownerId = request.ownerId;
this.performanceLevel = request.performanceLevel;
this.provisionedIops = request.provisionedIops;
this.regionId = request.regionId;
this.resourceGroupId = request.resourceGroupId;
this.resourceOwnerAccount = request.resourceOwnerAccount;
this.resourceOwnerId = request.resourceOwnerId;
this.size = request.size;
this.snapshotId = request.snapshotId;
this.storageClusterId = request.storageClusterId;
this.storageSetId = request.storageSetId;
this.storageSetPartitionNumber = request.storageSetPartitionNumber;
this.tag = request.tag;
this.zoneId = request.zoneId;
}
/**
* SourceRegionId.
*/
public Builder sourceRegionId(String sourceRegionId) {
this.putHostParameter("SourceRegionId", sourceRegionId);
this.sourceRegionId = sourceRegionId;
return this;
}
/**
* This parameter is not publicly available.
*/
public Builder advancedFeatures(String advancedFeatures) {
this.putQueryParameter("AdvancedFeatures", advancedFeatures);
this.advancedFeatures = advancedFeatures;
return this;
}
/**
* This parameter is not publicly available.
*/
public Builder arn(java.util.List < Arn> arn) {
this.putQueryParameter("Arn", arn);
this.arn = arn;
return this;
}
/**
* This parameter is not publicly available.
*/
public Builder burstingEnabled(Boolean burstingEnabled) {
this.putQueryParameter("BurstingEnabled", burstingEnabled);
this.burstingEnabled = burstingEnabled;
return this;
}
/**
* The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The **token** can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see [How to ensure idempotence](~~25693~~).
*/
public Builder clientToken(String clientToken) {
this.putQueryParameter("ClientToken", clientToken);
this.clientToken = clientToken;
return this;
}
/**
* The description of the disk. The description must be 2 to 256 characters in length and cannot start with `http://` or `https://`.
*
*
* This parameter is empty by default.
*/
public Builder description(String description) {
this.putQueryParameter("Description", description);
this.description = description;
return this;
}
/**
* The category of the disk. Valid values:
*
*
* * cloud: basic disk.
* * cloud_efficiency: ultra disk.
* * cloud_ssd: standard SSD.
* * cloud_essd: ESSD.
*
* Default value: cloud.
*/
public Builder diskCategory(String diskCategory) {
this.putQueryParameter("DiskCategory", diskCategory);
this.diskCategory = diskCategory;
return this;
}
/**
* The name of the disk. The name must be 2 to 128 characters in length. It must start with a letter but cannot start with `http://` or `https://`. It can contain letters, digits, colons (:), underscores (\_), and hyphens (-).
*
*
* This parameter is empty by default.
*/
public Builder diskName(String diskName) {
this.putQueryParameter("DiskName", diskName);
this.diskName = diskName;
return this;
}
/**
* This parameter is not publicly available.
*/
public Builder encryptAlgorithm(String encryptAlgorithm) {
this.putQueryParameter("EncryptAlgorithm", encryptAlgorithm);
this.encryptAlgorithm = encryptAlgorithm;
return this;
}
/**
* Specifies whether to encrypt the disk. Valid values:
*
*
* * true
* * false
*
* Default value: false.
*/
public Builder encrypted(Boolean encrypted) {
this.putQueryParameter("Encrypted", encrypted);
this.encrypted = encrypted;
return this;
}
/**
* The ID of the instance to which the created subscription disk is automatically attached.
*
*
* * After you specify the instance ID, ResourceGroupId, Tag.N.Key, Tag.N.Value, ClientToken, and KMSKeyId are ignored.
* * You cannot specify ZoneId and InstanceId at the same time.
*
* This parameter is empty by default. This indicates that a pay-as-you-go disk is created. RegionId and ZoneId specify where the disk resides.
*/
public Builder instanceId(String instanceId) {
this.putQueryParameter("InstanceId", instanceId);
this.instanceId = instanceId;
return this;
}
/**
* The ID of the Key Management Service (KMS) key that you want to use for the disk.
*/
public Builder KMSKeyId(String KMSKeyId) {
this.putQueryParameter("KMSKeyId", KMSKeyId);
this.KMSKeyId = KMSKeyId;
return this;
}
/**
* Specifies whether to enable the multi-attach feature for the disk. Valid values:
*
*
* * Disabled.
* * Enabled. Set the value to `Enabled` only for ESSDs.
*
* Default value: Disabled.
*
* > Disks for which the multi-attach feature is enabled support only the pay-as-you-go billing method. When `MultiAttach` is set to Enabled, you cannot specify `InstanceId`. You can call the [AttachDisk](~~25515~~) operation to attach disks to instances after the disks are created. Disks for which the multi-attach feature is enabled can be attached only as data disks.
*/
public Builder multiAttach(String multiAttach) {
this.putQueryParameter("MultiAttach", multiAttach);
this.multiAttach = multiAttach;
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;
}
/**
* The performance level of the ESSD. 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.
*
* Default value: PL1.
*
* For more information about ESSD performance levels, see [ESSDs](~~122389~~).
*/
public Builder performanceLevel(String performanceLevel) {
this.putQueryParameter("PerformanceLevel", performanceLevel);
this.performanceLevel = performanceLevel;
return this;
}
/**
* This parameter is not publicly available.
*/
public Builder provisionedIops(Long provisionedIops) {
this.putQueryParameter("ProvisionedIops", provisionedIops);
this.provisionedIops = provisionedIops;
return this;
}
/**
* The ID of the region in which to create the disk. 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 disk.
*/
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;
}
/**
* The size of the disk. Unit: GiB. This parameter is required. Valid values:
*
*
* * Valid values when DiskCategory is set to cloud: 5 to 2,000.
*
* * Valid values when DiskCategory is set to cloud_efficiency: 20 to 32,768.
*
* * Valid values when DiskCategory is set to cloud_ssd: 20 to 32,768.
*
* * Valid values when DiskCategory is set to cloud_essd: depends on the `PerformanceLevel` value.
*
* * Valid values when PerformanceLevel is set to PL0: 40 to 32,768.
* * Valid values when PerformanceLevel is set to PL1: 20 to 32,768.
* * Valid values when PerformanceLevel is set to PL2: 461 to 32,768.
* * Valid values when PerformanceLevel is set to PL3: 1,261 to 32,768.
*
* If `SnapshotId` is specified, the following limits apply to `SnapshotId` and `Size`:
*
* * If the size of the snapshot specified by `SnapshotId` is greater than the specified `Size` value, the size of the created disk is equal to the specified snapshot size.
* * If the size of the snapshot specified by `SnapshotId` is smaller than the specified `Size` value, the size of the created disk is equal to the specified `Size` value.
*/
public Builder size(Integer size) {
this.putQueryParameter("Size", size);
this.size = size;
return this;
}
/**
* The ID of the snapshot used to create the disk. Snapshots that were created on or before July 15, 2013 cannot be used to create disks.
*
*
* The following limits apply to `SnapshotId` and `Size`:
*
* * If the size of the snapshot specified by `SnapshotId` is greater than the specified `Size` value, the size of the created disk is equal to the specified snapshot size.
* * If the size of the snapshot specified by `SnapshotId` is smaller than the specified `Size` value, the size of the created disk is equal to the specified `Size` value.
*/
public Builder snapshotId(String snapshotId) {
this.putQueryParameter("SnapshotId", snapshotId);
this.snapshotId = snapshotId;
return this;
}
/**
* The ID of the dedicated block storage cluster. To create a disk in a specific dedicated block storage cluster, specify this parameter.
*
*
* > You cannot specify storage set-related parameters (`StorageSetId` and `StorageSetPartitionNumber`) and the dedicated block storage cluster-related parameter (`StorageClusterId`) at the same time. Otherwise, the operation cannot be called.
*/
public Builder storageClusterId(String storageClusterId) {
this.putQueryParameter("StorageClusterId", storageClusterId);
this.storageClusterId = storageClusterId;
return this;
}
/**
* The ID of the storage set.
*
*
* > You cannot specify storage set-related parameters (`StorageSetId` and `StorageSetPartitionNumber`) and the dedicated block storage cluster-related parameter (`StorageClusterId`) at the same time. Otherwise, the operation cannot be called.
*/
public Builder storageSetId(String storageSetId) {
this.putQueryParameter("StorageSetId", storageSetId);
this.storageSetId = storageSetId;
return this;
}
/**
* The number of partitions in the storage set. The value must be greater than or equal to 2 but cannot exceed the quota obtained by calling the [DescribeAccountAttributes](~~73772~~)operation.
*
*
* Default value: 2.
*/
public Builder storageSetPartitionNumber(Integer storageSetPartitionNumber) {
this.putQueryParameter("StorageSetPartitionNumber", storageSetPartitionNumber);
this.storageSetPartitionNumber = storageSetPartitionNumber;
return this;
}
/**
* The tags to add to the disk.
*/
public Builder tag(java.util.List < Tag> tag) {
this.putQueryParameter("Tag", tag);
this.tag = tag;
return this;
}
/**
* The ID of the zone in which to create the pay-as-you-go disk.
*
*
* * If InstanceId is not specified, ZoneId is required.
* * You cannot specify ZoneId and InstanceId at the same time.
*/
public Builder zoneId(String zoneId) {
this.putQueryParameter("ZoneId", zoneId);
this.zoneId = zoneId;
return this;
}
@Override
public CreateDiskRequest build() {
return new CreateDiskRequest(this);
}
}
public static class Arn extends TeaModel {
@NameInMap("AssumeRoleFor")
private Long assumeRoleFor;
@NameInMap("RoleType")
private String roleType;
@NameInMap("Rolearn")
private String rolearn;
private Arn(Builder builder) {
this.assumeRoleFor = builder.assumeRoleFor;
this.roleType = builder.roleType;
this.rolearn = builder.rolearn;
}
public static Builder builder() {
return new Builder();
}
public static Arn create() {
return builder().build();
}
/**
* @return assumeRoleFor
*/
public Long getAssumeRoleFor() {
return this.assumeRoleFor;
}
/**
* @return roleType
*/
public String getRoleType() {
return this.roleType;
}
/**
* @return rolearn
*/
public String getRolearn() {
return this.rolearn;
}
public static final class Builder {
private Long assumeRoleFor;
private String roleType;
private String rolearn;
/**
* This parameter is not publicly available.
*/
public Builder assumeRoleFor(Long assumeRoleFor) {
this.assumeRoleFor = assumeRoleFor;
return this;
}
/**
* This parameter is not publicly available.
*/
public Builder roleType(String roleType) {
this.roleType = roleType;
return this;
}
/**
* This parameter is not publicly available.
*/
public Builder rolearn(String rolearn) {
this.rolearn = rolearn;
return this;
}
public Arn build() {
return new Arn(this);
}
}
}
public static class Tag extends TeaModel {
@NameInMap("Key")
private String key;
@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 disk. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot contain `http://` or `https://`. The tag key cannot start with `acs:` or `aliyun`.
*/
public Builder key(String key) {
this.key = key;
return this;
}
/**
* The value of tag N to add to the disk. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot start with `acs:`. The tag value cannot contain `http://` or `https://`.
*/
public Builder value(String value) {
this.value = value;
return this;
}
public Tag build() {
return new Tag(this);
}
}
}
}