com.aliyun.sdk.service.ecs20140526.models.CreateSnapshotRequest 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 darabonba.core.RequestModel;
import darabonba.core.TeaModel;
import com.aliyun.sdk.gateway.pop.models.*;
/**
* {@link CreateSnapshotRequest} extends {@link RequestModel}
*
* CreateSnapshotRequest
*/
public class CreateSnapshotRequest extends Request {
@com.aliyun.core.annotation.Host
@com.aliyun.core.annotation.NameInMap("SourceRegionId")
private String sourceRegionId;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("Category")
private String category;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("ClientToken")
private String clientToken;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("Description")
private String description;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("DiskId")
@com.aliyun.core.annotation.Validation(required = true)
private String diskId;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("InstantAccess")
private Boolean instantAccess;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("InstantAccessRetentionDays")
private Integer instantAccessRetentionDays;
@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("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("RetentionDays")
private Integer retentionDays;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("SnapshotName")
private String snapshotName;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("StorageLocationArn")
private String storageLocationArn;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("Tag")
private java.util.List < Tag> tag;
private CreateSnapshotRequest(Builder builder) {
super(builder);
this.sourceRegionId = builder.sourceRegionId;
this.category = builder.category;
this.clientToken = builder.clientToken;
this.description = builder.description;
this.diskId = builder.diskId;
this.instantAccess = builder.instantAccess;
this.instantAccessRetentionDays = builder.instantAccessRetentionDays;
this.ownerAccount = builder.ownerAccount;
this.ownerId = builder.ownerId;
this.resourceGroupId = builder.resourceGroupId;
this.resourceOwnerAccount = builder.resourceOwnerAccount;
this.resourceOwnerId = builder.resourceOwnerId;
this.retentionDays = builder.retentionDays;
this.snapshotName = builder.snapshotName;
this.storageLocationArn = builder.storageLocationArn;
this.tag = builder.tag;
}
public static Builder builder() {
return new Builder();
}
public static CreateSnapshotRequest create() {
return builder().build();
}
@Override
public Builder toBuilder() {
return new Builder(this);
}
/**
* @return sourceRegionId
*/
public String getSourceRegionId() {
return this.sourceRegionId;
}
/**
* @return category
*/
public String getCategory() {
return this.category;
}
/**
* @return clientToken
*/
public String getClientToken() {
return this.clientToken;
}
/**
* @return description
*/
public String getDescription() {
return this.description;
}
/**
* @return diskId
*/
public String getDiskId() {
return this.diskId;
}
/**
* @return instantAccess
*/
public Boolean getInstantAccess() {
return this.instantAccess;
}
/**
* @return instantAccessRetentionDays
*/
public Integer getInstantAccessRetentionDays() {
return this.instantAccessRetentionDays;
}
/**
* @return ownerAccount
*/
public String getOwnerAccount() {
return this.ownerAccount;
}
/**
* @return ownerId
*/
public Long getOwnerId() {
return this.ownerId;
}
/**
* @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 retentionDays
*/
public Integer getRetentionDays() {
return this.retentionDays;
}
/**
* @return snapshotName
*/
public String getSnapshotName() {
return this.snapshotName;
}
/**
* @return storageLocationArn
*/
public String getStorageLocationArn() {
return this.storageLocationArn;
}
/**
* @return tag
*/
public java.util.List < Tag> getTag() {
return this.tag;
}
public static final class Builder extends Request.Builder {
private String sourceRegionId;
private String category;
private String clientToken;
private String description;
private String diskId;
private Boolean instantAccess;
private Integer instantAccessRetentionDays;
private String ownerAccount;
private Long ownerId;
private String resourceGroupId;
private String resourceOwnerAccount;
private Long resourceOwnerId;
private Integer retentionDays;
private String snapshotName;
private String storageLocationArn;
private java.util.List < Tag> tag;
private Builder() {
super();
}
private Builder(CreateSnapshotRequest request) {
super(request);
this.sourceRegionId = request.sourceRegionId;
this.category = request.category;
this.clientToken = request.clientToken;
this.description = request.description;
this.diskId = request.diskId;
this.instantAccess = request.instantAccess;
this.instantAccessRetentionDays = request.instantAccessRetentionDays;
this.ownerAccount = request.ownerAccount;
this.ownerId = request.ownerId;
this.resourceGroupId = request.resourceGroupId;
this.resourceOwnerAccount = request.resourceOwnerAccount;
this.resourceOwnerId = request.resourceOwnerId;
this.retentionDays = request.retentionDays;
this.snapshotName = request.snapshotName;
this.storageLocationArn = request.storageLocationArn;
this.tag = request.tag;
}
/**
* SourceRegionId.
*/
public Builder sourceRegionId(String sourceRegionId) {
this.putHostParameter("SourceRegionId", sourceRegionId);
this.sourceRegionId = sourceRegionId;
return this;
}
/**
* The category of the snapshot. Valid values:
*
*
* * Standard: normal snapshot
* * Flash: local snapshot
*
* > This parameter is no longer used. By default, new normal snapshots of ESSDs are upgraded to instant access snapshots free of charge without the need for additional configurations. For more information, see [Use the instant access feature](~~193667~~).
*/
public Builder category(String category) {
this.putQueryParameter("Category", category);
this.category = category;
return this;
}
/**
* The retention period of the snapshot. Valid values: 1 to 65536. Unit: days. The snapshot is automatically released when its retention period expires.
*
*
* This parameter is empty by default, which indicates that the snapshot is not automatically released.
*/
public Builder clientToken(String clientToken) {
this.putQueryParameter("ClientToken", clientToken);
this.clientToken = clientToken;
return this;
}
/**
* The cloud disk ID.
*/
public Builder description(String description) {
this.putQueryParameter("Description", description);
this.description = description;
return this;
}
/**
* Creates a snapshot for a disk.
*/
public Builder diskId(String diskId) {
this.putQueryParameter("DiskId", diskId);
this.diskId = diskId;
return this;
}
/**
* Specifies whether to enable the instant access feature. Valid values:
*
*
* * true: enables the instant access feature. This feature can be enabled only for ESSDs.
* * false: does not enable the instant access feature. If InstantAccess is set to false, a normal snapshot is created.
*
* Default value: false.
*
* > This parameter is no longer used. By default, new normal snapshots of ESSDs are upgraded to instant access snapshots free of charge without the need for additional configurations. For more information, see [Use the instant access feature](~~193667~~).
*/
public Builder instantAccess(Boolean instantAccess) {
this.putQueryParameter("InstantAccess", instantAccess);
this.instantAccess = instantAccess;
return this;
}
/**
* The validity period of the instant access feature. When the validity period ends, the feature is disabled and the instant access snapshot is automatically released. This parameter takes effect only when `InstantAccess` is set to true. Unit: days. Valid values: 1 to 65535.
*
*
* By default, the value of this parameter is the same as that of `RetentionDays`.
*
* > This parameter is no longer used. By default, new normal snapshots of ESSDs are upgraded to instant access snapshots free of charge without the need for additional configurations. For more information, see [Use the instant access feature](~~193667~~).
*/
public Builder instantAccessRetentionDays(Integer instantAccessRetentionDays) {
this.putQueryParameter("InstantAccessRetentionDays", instantAccessRetentionDays);
this.instantAccessRetentionDays = instantAccessRetentionDays;
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 snapshot type. Valid values:
*
*
* * Standard: normal snapshot
* * Flash: local snapshot
*
* > This parameter will be removed in the future. We recommend that you use the `InstantAccess` parameter to ensure future compatibility. This parameter and the `InstantAccess` parameter cannot be specified at the same time. For more information, see the "Description" section of this topic.
*/
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 snapshot name. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with `http://` or `https://`. It can contain letters, digits, colons (:), underscores (\_), and hyphens (-).
*
*
* The name cannot start with `auto` because snapshots whose names start with auto are recognized as automatic snapshots.
*/
public Builder retentionDays(Integer retentionDays) {
this.putQueryParameter("RetentionDays", retentionDays);
this.retentionDays = retentionDays;
return this;
}
/**
* The name of the snapshot. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with `http://` or `https://`. It can contain letters, digits, colons (:), underscores (\_), and hyphens (-).
*
*
* It cannot start with `auto` because snapshots whose names start with auto are recognized as automatic snapshots.
*/
public Builder snapshotName(String snapshotName) {
this.putQueryParameter("SnapshotName", snapshotName);
this.snapshotName = snapshotName;
return this;
}
/**
* The value of tag N that you want to add to the snapshot. 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 contain [http:// or https://.](http://https://。)
*/
public Builder storageLocationArn(String storageLocationArn) {
this.putQueryParameter("StorageLocationArn", storageLocationArn);
this.storageLocationArn = storageLocationArn;
return this;
}
/**
* The tags to add to the snapshot.
*/
public Builder tag(java.util.List < Tag> tag) {
this.putQueryParameter("Tag", tag);
this.tag = tag;
return this;
}
@Override
public CreateSnapshotRequest build() {
return new CreateSnapshotRequest(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 snapshot. 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 snapshot. 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 contain http:// or https://.
*/
public Builder value(String value) {
this.value = value;
return this;
}
public Tag build() {
return new Tag(this);
}
}
}
}