software.amazon.awssdk.services.fsx.model.CreateFileSystemFromBackupRequest Maven / Gradle / Ivy
Show all versions of fsx Show documentation
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.fsx.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.DefaultValueTrait;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* The request object for the CreateFileSystemFromBackup
operation.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class CreateFileSystemFromBackupRequest extends FSxRequest implements
ToCopyableBuilder {
private static final SdkField BACKUP_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("BackupId").getter(getter(CreateFileSystemFromBackupRequest::backupId)).setter(setter(Builder::backupId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BackupId").build()).build();
private static final SdkField CLIENT_REQUEST_TOKEN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("ClientRequestToken")
.getter(getter(CreateFileSystemFromBackupRequest::clientRequestToken))
.setter(setter(Builder::clientRequestToken))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClientRequestToken").build(),
DefaultValueTrait.idempotencyToken()).build();
private static final SdkField> SUBNET_IDS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("SubnetIds")
.getter(getter(CreateFileSystemFromBackupRequest::subnetIds))
.setter(setter(Builder::subnetIds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SubnetIds").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> SECURITY_GROUP_IDS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("SecurityGroupIds")
.getter(getter(CreateFileSystemFromBackupRequest::securityGroupIds))
.setter(setter(Builder::securityGroupIds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SecurityGroupIds").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Tags")
.getter(getter(CreateFileSystemFromBackupRequest::tags))
.setter(setter(Builder::tags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(Tag::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField WINDOWS_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("WindowsConfiguration")
.getter(getter(CreateFileSystemFromBackupRequest::windowsConfiguration))
.setter(setter(Builder::windowsConfiguration)).constructor(CreateFileSystemWindowsConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WindowsConfiguration").build())
.build();
private static final SdkField LUSTRE_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("LustreConfiguration")
.getter(getter(CreateFileSystemFromBackupRequest::lustreConfiguration)).setter(setter(Builder::lustreConfiguration))
.constructor(CreateFileSystemLustreConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LustreConfiguration").build())
.build();
private static final SdkField STORAGE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StorageType").getter(getter(CreateFileSystemFromBackupRequest::storageTypeAsString))
.setter(setter(Builder::storageType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StorageType").build()).build();
private static final SdkField KMS_KEY_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("KmsKeyId").getter(getter(CreateFileSystemFromBackupRequest::kmsKeyId)).setter(setter(Builder::kmsKeyId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KmsKeyId").build()).build();
private static final SdkField FILE_SYSTEM_TYPE_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FileSystemTypeVersion").getter(getter(CreateFileSystemFromBackupRequest::fileSystemTypeVersion))
.setter(setter(Builder::fileSystemTypeVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FileSystemTypeVersion").build())
.build();
private static final SdkField OPEN_ZFS_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("OpenZFSConfiguration")
.getter(getter(CreateFileSystemFromBackupRequest::openZFSConfiguration))
.setter(setter(Builder::openZFSConfiguration)).constructor(CreateFileSystemOpenZFSConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OpenZFSConfiguration").build())
.build();
private static final SdkField STORAGE_CAPACITY_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("StorageCapacity").getter(getter(CreateFileSystemFromBackupRequest::storageCapacity))
.setter(setter(Builder::storageCapacity))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StorageCapacity").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BACKUP_ID_FIELD,
CLIENT_REQUEST_TOKEN_FIELD, SUBNET_IDS_FIELD, SECURITY_GROUP_IDS_FIELD, TAGS_FIELD, WINDOWS_CONFIGURATION_FIELD,
LUSTRE_CONFIGURATION_FIELD, STORAGE_TYPE_FIELD, KMS_KEY_ID_FIELD, FILE_SYSTEM_TYPE_VERSION_FIELD,
OPEN_ZFS_CONFIGURATION_FIELD, STORAGE_CAPACITY_FIELD));
private final String backupId;
private final String clientRequestToken;
private final List subnetIds;
private final List securityGroupIds;
private final List tags;
private final CreateFileSystemWindowsConfiguration windowsConfiguration;
private final CreateFileSystemLustreConfiguration lustreConfiguration;
private final String storageType;
private final String kmsKeyId;
private final String fileSystemTypeVersion;
private final CreateFileSystemOpenZFSConfiguration openZFSConfiguration;
private final Integer storageCapacity;
private CreateFileSystemFromBackupRequest(BuilderImpl builder) {
super(builder);
this.backupId = builder.backupId;
this.clientRequestToken = builder.clientRequestToken;
this.subnetIds = builder.subnetIds;
this.securityGroupIds = builder.securityGroupIds;
this.tags = builder.tags;
this.windowsConfiguration = builder.windowsConfiguration;
this.lustreConfiguration = builder.lustreConfiguration;
this.storageType = builder.storageType;
this.kmsKeyId = builder.kmsKeyId;
this.fileSystemTypeVersion = builder.fileSystemTypeVersion;
this.openZFSConfiguration = builder.openZFSConfiguration;
this.storageCapacity = builder.storageCapacity;
}
/**
* Returns the value of the BackupId property for this object.
*
* @return The value of the BackupId property for this object.
*/
public final String backupId() {
return backupId;
}
/**
*
* A string of up to 63 ASCII characters that Amazon FSx uses to ensure idempotent creation. This string is
* automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.
*
*
* @return A string of up to 63 ASCII characters that Amazon FSx uses to ensure idempotent creation. This string is
* automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web
* Services SDK.
*/
public final String clientRequestToken() {
return clientRequestToken;
}
/**
* For responses, this returns true if the service returned a value for the SubnetIds property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasSubnetIds() {
return subnetIds != null && !(subnetIds instanceof SdkAutoConstructList);
}
/**
*
* Specifies the IDs of the subnets that the file system will be accessible from. For Windows
* MULTI_AZ_1
file system deployment types, provide exactly two subnet IDs, one for the preferred file
* server and one for the standby file server. You specify one of these subnets as the preferred subnet using the
* WindowsConfiguration > PreferredSubnetID
property.
*
*
* Windows SINGLE_AZ_1
and SINGLE_AZ_2
file system deployment types, Lustre file systems,
* and OpenZFS file systems provide exactly one subnet ID. The file server is launched in that subnet's Availability
* Zone.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasSubnetIds} method.
*
*
* @return Specifies the IDs of the subnets that the file system will be accessible from. For Windows
* MULTI_AZ_1
file system deployment types, provide exactly two subnet IDs, one for the
* preferred file server and one for the standby file server. You specify one of these subnets as the
* preferred subnet using the WindowsConfiguration > PreferredSubnetID
property.
*
* Windows SINGLE_AZ_1
and SINGLE_AZ_2
file system deployment types, Lustre file
* systems, and OpenZFS file systems provide exactly one subnet ID. The file server is launched in that
* subnet's Availability Zone.
*/
public final List subnetIds() {
return subnetIds;
}
/**
* For responses, this returns true if the service returned a value for the SecurityGroupIds property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasSecurityGroupIds() {
return securityGroupIds != null && !(securityGroupIds instanceof SdkAutoConstructList);
}
/**
*
* A list of IDs for the security groups that apply to the specified network interfaces created for file system
* access. These security groups apply to all network interfaces. This value isn't returned in later
* DescribeFileSystem
requests.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasSecurityGroupIds} method.
*
*
* @return A list of IDs for the security groups that apply to the specified network interfaces created for file
* system access. These security groups apply to all network interfaces. This value isn't returned in later
* DescribeFileSystem
requests.
*/
public final List securityGroupIds() {
return securityGroupIds;
}
/**
* For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructList);
}
/**
*
* The tags to be applied to the file system at file system creation. The key value of the Name
tag
* appears in the console as the file system name.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasTags} method.
*
*
* @return The tags to be applied to the file system at file system creation. The key value of the Name
* tag appears in the console as the file system name.
*/
public final List tags() {
return tags;
}
/**
*
* The configuration for this Microsoft Windows file system.
*
*
* @return The configuration for this Microsoft Windows file system.
*/
public final CreateFileSystemWindowsConfiguration windowsConfiguration() {
return windowsConfiguration;
}
/**
* Returns the value of the LustreConfiguration property for this object.
*
* @return The value of the LustreConfiguration property for this object.
*/
public final CreateFileSystemLustreConfiguration lustreConfiguration() {
return lustreConfiguration;
}
/**
*
* Sets the storage type for the Windows or OpenZFS file system that you're creating from a backup. Valid values are
* SSD
and HDD
.
*
*
* -
*
* Set to SSD
to use solid state drive storage. SSD is supported on all Windows and OpenZFS deployment
* types.
*
*
* -
*
* Set to HDD
to use hard disk drive storage. HDD is supported on SINGLE_AZ_2
and
* MULTI_AZ_1
FSx for Windows File Server file system deployment types.
*
*
*
*
* The default value is SSD
.
*
*
*
* HDD and SSD storage types have different minimum storage capacity requirements. A restored file system's storage
* capacity is tied to the file system that was backed up. You can create a file system that uses HDD storage from a
* backup of a file system that used SSD storage if the original SSD file system had a storage capacity of at least
* 2000 GiB.
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #storageType} will
* return {@link StorageType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #storageTypeAsString}.
*
*
* @return Sets the storage type for the Windows or OpenZFS file system that you're creating from a backup. Valid
* values are SSD
and HDD
.
*
* -
*
* Set to SSD
to use solid state drive storage. SSD is supported on all Windows and OpenZFS
* deployment types.
*
*
* -
*
* Set to HDD
to use hard disk drive storage. HDD is supported on SINGLE_AZ_2
and
* MULTI_AZ_1
FSx for Windows File Server file system deployment types.
*
*
*
*
* The default value is SSD
.
*
*
*
* HDD and SSD storage types have different minimum storage capacity requirements. A restored file system's
* storage capacity is tied to the file system that was backed up. You can create a file system that uses
* HDD storage from a backup of a file system that used SSD storage if the original SSD file system had a
* storage capacity of at least 2000 GiB.
*
* @see StorageType
*/
public final StorageType storageType() {
return StorageType.fromValue(storageType);
}
/**
*
* Sets the storage type for the Windows or OpenZFS file system that you're creating from a backup. Valid values are
* SSD
and HDD
.
*
*
* -
*
* Set to SSD
to use solid state drive storage. SSD is supported on all Windows and OpenZFS deployment
* types.
*
*
* -
*
* Set to HDD
to use hard disk drive storage. HDD is supported on SINGLE_AZ_2
and
* MULTI_AZ_1
FSx for Windows File Server file system deployment types.
*
*
*
*
* The default value is SSD
.
*
*
*
* HDD and SSD storage types have different minimum storage capacity requirements. A restored file system's storage
* capacity is tied to the file system that was backed up. You can create a file system that uses HDD storage from a
* backup of a file system that used SSD storage if the original SSD file system had a storage capacity of at least
* 2000 GiB.
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #storageType} will
* return {@link StorageType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #storageTypeAsString}.
*
*
* @return Sets the storage type for the Windows or OpenZFS file system that you're creating from a backup. Valid
* values are SSD
and HDD
.
*
* -
*
* Set to SSD
to use solid state drive storage. SSD is supported on all Windows and OpenZFS
* deployment types.
*
*
* -
*
* Set to HDD
to use hard disk drive storage. HDD is supported on SINGLE_AZ_2
and
* MULTI_AZ_1
FSx for Windows File Server file system deployment types.
*
*
*
*
* The default value is SSD
.
*
*
*
* HDD and SSD storage types have different minimum storage capacity requirements. A restored file system's
* storage capacity is tied to the file system that was backed up. You can create a file system that uses
* HDD storage from a backup of a file system that used SSD storage if the original SSD file system had a
* storage capacity of at least 2000 GiB.
*
* @see StorageType
*/
public final String storageTypeAsString() {
return storageType;
}
/**
* Returns the value of the KmsKeyId property for this object.
*
* @return The value of the KmsKeyId property for this object.
*/
public final String kmsKeyId() {
return kmsKeyId;
}
/**
*
* Sets the version for the Amazon FSx for Lustre file system that you're creating from a backup. Valid values are
* 2.10
, 2.12
, and 2.15
.
*
*
* You don't need to specify FileSystemTypeVersion
because it will be applied using the backup's
* FileSystemTypeVersion
setting. If you choose to specify FileSystemTypeVersion
when
* creating from backup, the value must match the backup's FileSystemTypeVersion
setting.
*
*
* @return Sets the version for the Amazon FSx for Lustre file system that you're creating from a backup. Valid
* values are 2.10
, 2.12
, and 2.15
.
*
* You don't need to specify FileSystemTypeVersion
because it will be applied using the
* backup's FileSystemTypeVersion
setting. If you choose to specify
* FileSystemTypeVersion
when creating from backup, the value must match the backup's
* FileSystemTypeVersion
setting.
*/
public final String fileSystemTypeVersion() {
return fileSystemTypeVersion;
}
/**
*
* The OpenZFS configuration for the file system that's being created.
*
*
* @return The OpenZFS configuration for the file system that's being created.
*/
public final CreateFileSystemOpenZFSConfiguration openZFSConfiguration() {
return openZFSConfiguration;
}
/**
*
* Sets the storage capacity of the OpenZFS file system that you're creating from a backup, in gibibytes (GiB).
* Valid values are from 64 GiB up to 524,288 GiB (512 TiB). However, the value that you specify must be equal to or
* greater than the backup's storage capacity value. If you don't use the StorageCapacity
parameter,
* the default is the backup's StorageCapacity
value.
*
*
* If used to create a file system other than OpenZFS, you must provide a value that matches the backup's
* StorageCapacity
value. If you provide any other value, Amazon FSx responds with with an HTTP status
* code 400 Bad Request.
*
*
* @return Sets the storage capacity of the OpenZFS file system that you're creating from a backup, in gibibytes
* (GiB). Valid values are from 64 GiB up to 524,288 GiB (512 TiB). However, the value that you specify must
* be equal to or greater than the backup's storage capacity value. If you don't use the
* StorageCapacity
parameter, the default is the backup's StorageCapacity
* value.
*
* If used to create a file system other than OpenZFS, you must provide a value that matches the backup's
* StorageCapacity
value. If you provide any other value, Amazon FSx responds with with an HTTP
* status code 400 Bad Request.
*/
public final Integer storageCapacity() {
return storageCapacity;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(backupId());
hashCode = 31 * hashCode + Objects.hashCode(clientRequestToken());
hashCode = 31 * hashCode + Objects.hashCode(hasSubnetIds() ? subnetIds() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasSecurityGroupIds() ? securityGroupIds() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
hashCode = 31 * hashCode + Objects.hashCode(windowsConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(lustreConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(storageTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(kmsKeyId());
hashCode = 31 * hashCode + Objects.hashCode(fileSystemTypeVersion());
hashCode = 31 * hashCode + Objects.hashCode(openZFSConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(storageCapacity());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof CreateFileSystemFromBackupRequest)) {
return false;
}
CreateFileSystemFromBackupRequest other = (CreateFileSystemFromBackupRequest) obj;
return Objects.equals(backupId(), other.backupId()) && Objects.equals(clientRequestToken(), other.clientRequestToken())
&& hasSubnetIds() == other.hasSubnetIds() && Objects.equals(subnetIds(), other.subnetIds())
&& hasSecurityGroupIds() == other.hasSecurityGroupIds()
&& Objects.equals(securityGroupIds(), other.securityGroupIds()) && hasTags() == other.hasTags()
&& Objects.equals(tags(), other.tags()) && Objects.equals(windowsConfiguration(), other.windowsConfiguration())
&& Objects.equals(lustreConfiguration(), other.lustreConfiguration())
&& Objects.equals(storageTypeAsString(), other.storageTypeAsString())
&& Objects.equals(kmsKeyId(), other.kmsKeyId())
&& Objects.equals(fileSystemTypeVersion(), other.fileSystemTypeVersion())
&& Objects.equals(openZFSConfiguration(), other.openZFSConfiguration())
&& Objects.equals(storageCapacity(), other.storageCapacity());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("CreateFileSystemFromBackupRequest").add("BackupId", backupId())
.add("ClientRequestToken", clientRequestToken()).add("SubnetIds", hasSubnetIds() ? subnetIds() : null)
.add("SecurityGroupIds", hasSecurityGroupIds() ? securityGroupIds() : null)
.add("Tags", hasTags() ? tags() : null).add("WindowsConfiguration", windowsConfiguration())
.add("LustreConfiguration", lustreConfiguration()).add("StorageType", storageTypeAsString())
.add("KmsKeyId", kmsKeyId()).add("FileSystemTypeVersion", fileSystemTypeVersion())
.add("OpenZFSConfiguration", openZFSConfiguration()).add("StorageCapacity", storageCapacity()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "BackupId":
return Optional.ofNullable(clazz.cast(backupId()));
case "ClientRequestToken":
return Optional.ofNullable(clazz.cast(clientRequestToken()));
case "SubnetIds":
return Optional.ofNullable(clazz.cast(subnetIds()));
case "SecurityGroupIds":
return Optional.ofNullable(clazz.cast(securityGroupIds()));
case "Tags":
return Optional.ofNullable(clazz.cast(tags()));
case "WindowsConfiguration":
return Optional.ofNullable(clazz.cast(windowsConfiguration()));
case "LustreConfiguration":
return Optional.ofNullable(clazz.cast(lustreConfiguration()));
case "StorageType":
return Optional.ofNullable(clazz.cast(storageTypeAsString()));
case "KmsKeyId":
return Optional.ofNullable(clazz.cast(kmsKeyId()));
case "FileSystemTypeVersion":
return Optional.ofNullable(clazz.cast(fileSystemTypeVersion()));
case "OpenZFSConfiguration":
return Optional.ofNullable(clazz.cast(openZFSConfiguration()));
case "StorageCapacity":
return Optional.ofNullable(clazz.cast(storageCapacity()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
*
* Windows SINGLE_AZ_1
and SINGLE_AZ_2
file system deployment types, Lustre
* file systems, and OpenZFS file systems provide exactly one subnet ID. The file server is launched in
* that subnet's Availability Zone.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder subnetIds(Collection subnetIds);
/**
*
* Specifies the IDs of the subnets that the file system will be accessible from. For Windows
* MULTI_AZ_1
file system deployment types, provide exactly two subnet IDs, one for the preferred
* file server and one for the standby file server. You specify one of these subnets as the preferred subnet
* using the WindowsConfiguration > PreferredSubnetID
property.
*
*
* Windows SINGLE_AZ_1
and SINGLE_AZ_2
file system deployment types, Lustre file
* systems, and OpenZFS file systems provide exactly one subnet ID. The file server is launched in that subnet's
* Availability Zone.
*
*
* @param subnetIds
* Specifies the IDs of the subnets that the file system will be accessible from. For Windows
* MULTI_AZ_1
file system deployment types, provide exactly two subnet IDs, one for the
* preferred file server and one for the standby file server. You specify one of these subnets as the
* preferred subnet using the WindowsConfiguration > PreferredSubnetID
property.
*
* Windows SINGLE_AZ_1
and SINGLE_AZ_2
file system deployment types, Lustre
* file systems, and OpenZFS file systems provide exactly one subnet ID. The file server is launched in
* that subnet's Availability Zone.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder subnetIds(String... subnetIds);
/**
*
* A list of IDs for the security groups that apply to the specified network interfaces created for file system
* access. These security groups apply to all network interfaces. This value isn't returned in later
* DescribeFileSystem
requests.
*
*
* @param securityGroupIds
* A list of IDs for the security groups that apply to the specified network interfaces created for file
* system access. These security groups apply to all network interfaces. This value isn't returned in
* later DescribeFileSystem
requests.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder securityGroupIds(Collection securityGroupIds);
/**
*
* A list of IDs for the security groups that apply to the specified network interfaces created for file system
* access. These security groups apply to all network interfaces. This value isn't returned in later
* DescribeFileSystem
requests.
*
*
* @param securityGroupIds
* A list of IDs for the security groups that apply to the specified network interfaces created for file
* system access. These security groups apply to all network interfaces. This value isn't returned in
* later DescribeFileSystem
requests.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder securityGroupIds(String... securityGroupIds);
/**
*
* The tags to be applied to the file system at file system creation. The key value of the Name
tag
* appears in the console as the file system name.
*
*
* @param tags
* The tags to be applied to the file system at file system creation. The key value of the
* Name
tag appears in the console as the file system name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Collection tags);
/**
*
* The tags to be applied to the file system at file system creation. The key value of the Name
tag
* appears in the console as the file system name.
*
*
* @param tags
* The tags to be applied to the file system at file system creation. The key value of the
* Name
tag appears in the console as the file system name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Tag... tags);
/**
*
* The tags to be applied to the file system at file system creation. The key value of the Name
tag
* appears in the console as the file system name.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.fsx.model.Tag.Builder} avoiding the need to create one manually via
* {@link software.amazon.awssdk.services.fsx.model.Tag#builder()}.
*
*
* When the {@link Consumer} completes, {@link software.amazon.awssdk.services.fsx.model.Tag.Builder#build()} is
* called immediately and its result is passed to {@link #tags(List)}.
*
* @param tags
* a consumer that will call methods on {@link software.amazon.awssdk.services.fsx.model.Tag.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #tags(java.util.Collection)
*/
Builder tags(Consumer... tags);
/**
*
* The configuration for this Microsoft Windows file system.
*
*
* @param windowsConfiguration
* The configuration for this Microsoft Windows file system.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder windowsConfiguration(CreateFileSystemWindowsConfiguration windowsConfiguration);
/**
*
* The configuration for this Microsoft Windows file system.
*
* This is a convenience method that creates an instance of the
* {@link CreateFileSystemWindowsConfiguration.Builder} avoiding the need to create one manually via
* {@link CreateFileSystemWindowsConfiguration#builder()}.
*
*
* When the {@link Consumer} completes, {@link CreateFileSystemWindowsConfiguration.Builder#build()} is called
* immediately and its result is passed to {@link #windowsConfiguration(CreateFileSystemWindowsConfiguration)}.
*
* @param windowsConfiguration
* a consumer that will call methods on {@link CreateFileSystemWindowsConfiguration.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #windowsConfiguration(CreateFileSystemWindowsConfiguration)
*/
default Builder windowsConfiguration(Consumer windowsConfiguration) {
return windowsConfiguration(CreateFileSystemWindowsConfiguration.builder().applyMutation(windowsConfiguration)
.build());
}
/**
* Sets the value of the LustreConfiguration property for this object.
*
* @param lustreConfiguration
* The new value for the LustreConfiguration property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder lustreConfiguration(CreateFileSystemLustreConfiguration lustreConfiguration);
/**
* Sets the value of the LustreConfiguration property for this object.
*
* This is a convenience method that creates an instance of the
* {@link CreateFileSystemLustreConfiguration.Builder} avoiding the need to create one manually via
* {@link CreateFileSystemLustreConfiguration#builder()}.
*
*
* When the {@link Consumer} completes, {@link CreateFileSystemLustreConfiguration.Builder#build()} is called
* immediately and its result is passed to {@link #lustreConfiguration(CreateFileSystemLustreConfiguration)}.
*
* @param lustreConfiguration
* a consumer that will call methods on {@link CreateFileSystemLustreConfiguration.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #lustreConfiguration(CreateFileSystemLustreConfiguration)
*/
default Builder lustreConfiguration(Consumer lustreConfiguration) {
return lustreConfiguration(CreateFileSystemLustreConfiguration.builder().applyMutation(lustreConfiguration).build());
}
/**
*
* Sets the storage type for the Windows or OpenZFS file system that you're creating from a backup. Valid values
* are SSD
and HDD
.
*
*
* -
*
* Set to SSD
to use solid state drive storage. SSD is supported on all Windows and OpenZFS
* deployment types.
*
*
* -
*
* Set to HDD
to use hard disk drive storage. HDD is supported on SINGLE_AZ_2
and
* MULTI_AZ_1
FSx for Windows File Server file system deployment types.
*
*
*
*
* The default value is SSD
.
*
*
*
* HDD and SSD storage types have different minimum storage capacity requirements. A restored file system's
* storage capacity is tied to the file system that was backed up. You can create a file system that uses HDD
* storage from a backup of a file system that used SSD storage if the original SSD file system had a storage
* capacity of at least 2000 GiB.
*
*
*
* @param storageType
* Sets the storage type for the Windows or OpenZFS file system that you're creating from a backup. Valid
* values are SSD
and HDD
.
*
* -
*
* Set to SSD
to use solid state drive storage. SSD is supported on all Windows and OpenZFS
* deployment types.
*
*
* -
*
* Set to HDD
to use hard disk drive storage. HDD is supported on SINGLE_AZ_2
* and MULTI_AZ_1
FSx for Windows File Server file system deployment types.
*
*
*
*
* The default value is SSD
.
*
*
*
* HDD and SSD storage types have different minimum storage capacity requirements. A restored file
* system's storage capacity is tied to the file system that was backed up. You can create a file system
* that uses HDD storage from a backup of a file system that used SSD storage if the original SSD file
* system had a storage capacity of at least 2000 GiB.
*
* @see StorageType
* @return Returns a reference to this object so that method calls can be chained together.
* @see StorageType
*/
Builder storageType(String storageType);
/**
*
* Sets the storage type for the Windows or OpenZFS file system that you're creating from a backup. Valid values
* are SSD
and HDD
.
*
*
* -
*
* Set to SSD
to use solid state drive storage. SSD is supported on all Windows and OpenZFS
* deployment types.
*
*
* -
*
* Set to HDD
to use hard disk drive storage. HDD is supported on SINGLE_AZ_2
and
* MULTI_AZ_1
FSx for Windows File Server file system deployment types.
*
*
*
*
* The default value is SSD
.
*
*
*
* HDD and SSD storage types have different minimum storage capacity requirements. A restored file system's
* storage capacity is tied to the file system that was backed up. You can create a file system that uses HDD
* storage from a backup of a file system that used SSD storage if the original SSD file system had a storage
* capacity of at least 2000 GiB.
*
*
*
* @param storageType
* Sets the storage type for the Windows or OpenZFS file system that you're creating from a backup. Valid
* values are SSD
and HDD
.
*
* -
*
* Set to SSD
to use solid state drive storage. SSD is supported on all Windows and OpenZFS
* deployment types.
*
*
* -
*
* Set to HDD
to use hard disk drive storage. HDD is supported on SINGLE_AZ_2
* and MULTI_AZ_1
FSx for Windows File Server file system deployment types.
*
*
*
*
* The default value is SSD
.
*
*
*
* HDD and SSD storage types have different minimum storage capacity requirements. A restored file
* system's storage capacity is tied to the file system that was backed up. You can create a file system
* that uses HDD storage from a backup of a file system that used SSD storage if the original SSD file
* system had a storage capacity of at least 2000 GiB.
*
* @see StorageType
* @return Returns a reference to this object so that method calls can be chained together.
* @see StorageType
*/
Builder storageType(StorageType storageType);
/**
* Sets the value of the KmsKeyId property for this object.
*
* @param kmsKeyId
* The new value for the KmsKeyId property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder kmsKeyId(String kmsKeyId);
/**
*
* Sets the version for the Amazon FSx for Lustre file system that you're creating from a backup. Valid values
* are 2.10
, 2.12
, and 2.15
.
*
*
* You don't need to specify FileSystemTypeVersion
because it will be applied using the backup's
* FileSystemTypeVersion
setting. If you choose to specify FileSystemTypeVersion
when
* creating from backup, the value must match the backup's FileSystemTypeVersion
setting.
*
*
* @param fileSystemTypeVersion
* Sets the version for the Amazon FSx for Lustre file system that you're creating from a backup. Valid
* values are 2.10
, 2.12
, and 2.15
.
*
* You don't need to specify FileSystemTypeVersion
because it will be applied using the
* backup's FileSystemTypeVersion
setting. If you choose to specify
* FileSystemTypeVersion
when creating from backup, the value must match the backup's
* FileSystemTypeVersion
setting.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder fileSystemTypeVersion(String fileSystemTypeVersion);
/**
*
* The OpenZFS configuration for the file system that's being created.
*
*
* @param openZFSConfiguration
* The OpenZFS configuration for the file system that's being created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder openZFSConfiguration(CreateFileSystemOpenZFSConfiguration openZFSConfiguration);
/**
*
* The OpenZFS configuration for the file system that's being created.
*
* This is a convenience method that creates an instance of the
* {@link CreateFileSystemOpenZFSConfiguration.Builder} avoiding the need to create one manually via
* {@link CreateFileSystemOpenZFSConfiguration#builder()}.
*
*
* When the {@link Consumer} completes, {@link CreateFileSystemOpenZFSConfiguration.Builder#build()} is called
* immediately and its result is passed to {@link #openZFSConfiguration(CreateFileSystemOpenZFSConfiguration)}.
*
* @param openZFSConfiguration
* a consumer that will call methods on {@link CreateFileSystemOpenZFSConfiguration.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #openZFSConfiguration(CreateFileSystemOpenZFSConfiguration)
*/
default Builder openZFSConfiguration(Consumer openZFSConfiguration) {
return openZFSConfiguration(CreateFileSystemOpenZFSConfiguration.builder().applyMutation(openZFSConfiguration)
.build());
}
/**
*
* Sets the storage capacity of the OpenZFS file system that you're creating from a backup, in gibibytes (GiB).
* Valid values are from 64 GiB up to 524,288 GiB (512 TiB). However, the value that you specify must be equal
* to or greater than the backup's storage capacity value. If you don't use the StorageCapacity
* parameter, the default is the backup's StorageCapacity
value.
*
*
* If used to create a file system other than OpenZFS, you must provide a value that matches the backup's
* StorageCapacity
value. If you provide any other value, Amazon FSx responds with with an HTTP
* status code 400 Bad Request.
*
*
* @param storageCapacity
* Sets the storage capacity of the OpenZFS file system that you're creating from a backup, in gibibytes
* (GiB). Valid values are from 64 GiB up to 524,288 GiB (512 TiB). However, the value that you specify
* must be equal to or greater than the backup's storage capacity value. If you don't use the
* StorageCapacity
parameter, the default is the backup's StorageCapacity
* value.
*
* If used to create a file system other than OpenZFS, you must provide a value that matches the backup's
* StorageCapacity
value. If you provide any other value, Amazon FSx responds with with an
* HTTP status code 400 Bad Request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder storageCapacity(Integer storageCapacity);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends FSxRequest.BuilderImpl implements Builder {
private String backupId;
private String clientRequestToken;
private List subnetIds = DefaultSdkAutoConstructList.getInstance();
private List securityGroupIds = DefaultSdkAutoConstructList.getInstance();
private List tags = DefaultSdkAutoConstructList.getInstance();
private CreateFileSystemWindowsConfiguration windowsConfiguration;
private CreateFileSystemLustreConfiguration lustreConfiguration;
private String storageType;
private String kmsKeyId;
private String fileSystemTypeVersion;
private CreateFileSystemOpenZFSConfiguration openZFSConfiguration;
private Integer storageCapacity;
private BuilderImpl() {
}
private BuilderImpl(CreateFileSystemFromBackupRequest model) {
super(model);
backupId(model.backupId);
clientRequestToken(model.clientRequestToken);
subnetIds(model.subnetIds);
securityGroupIds(model.securityGroupIds);
tags(model.tags);
windowsConfiguration(model.windowsConfiguration);
lustreConfiguration(model.lustreConfiguration);
storageType(model.storageType);
kmsKeyId(model.kmsKeyId);
fileSystemTypeVersion(model.fileSystemTypeVersion);
openZFSConfiguration(model.openZFSConfiguration);
storageCapacity(model.storageCapacity);
}
public final String getBackupId() {
return backupId;
}
public final void setBackupId(String backupId) {
this.backupId = backupId;
}
@Override
public final Builder backupId(String backupId) {
this.backupId = backupId;
return this;
}
public final String getClientRequestToken() {
return clientRequestToken;
}
public final void setClientRequestToken(String clientRequestToken) {
this.clientRequestToken = clientRequestToken;
}
@Override
public final Builder clientRequestToken(String clientRequestToken) {
this.clientRequestToken = clientRequestToken;
return this;
}
public final Collection getSubnetIds() {
if (subnetIds instanceof SdkAutoConstructList) {
return null;
}
return subnetIds;
}
public final void setSubnetIds(Collection subnetIds) {
this.subnetIds = SubnetIdsCopier.copy(subnetIds);
}
@Override
public final Builder subnetIds(Collection subnetIds) {
this.subnetIds = SubnetIdsCopier.copy(subnetIds);
return this;
}
@Override
@SafeVarargs
public final Builder subnetIds(String... subnetIds) {
subnetIds(Arrays.asList(subnetIds));
return this;
}
public final Collection getSecurityGroupIds() {
if (securityGroupIds instanceof SdkAutoConstructList) {
return null;
}
return securityGroupIds;
}
public final void setSecurityGroupIds(Collection securityGroupIds) {
this.securityGroupIds = SecurityGroupIdsCopier.copy(securityGroupIds);
}
@Override
public final Builder securityGroupIds(Collection securityGroupIds) {
this.securityGroupIds = SecurityGroupIdsCopier.copy(securityGroupIds);
return this;
}
@Override
@SafeVarargs
public final Builder securityGroupIds(String... securityGroupIds) {
securityGroupIds(Arrays.asList(securityGroupIds));
return this;
}
public final List getTags() {
List result = TagsCopier.copyToBuilder(this.tags);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setTags(Collection tags) {
this.tags = TagsCopier.copyFromBuilder(tags);
}
@Override
public final Builder tags(Collection tags) {
this.tags = TagsCopier.copy(tags);
return this;
}
@Override
@SafeVarargs
public final Builder tags(Tag... tags) {
tags(Arrays.asList(tags));
return this;
}
@Override
@SafeVarargs
public final Builder tags(Consumer... tags) {
tags(Stream.of(tags).map(c -> Tag.builder().applyMutation(c).build()).collect(Collectors.toList()));
return this;
}
public final CreateFileSystemWindowsConfiguration.Builder getWindowsConfiguration() {
return windowsConfiguration != null ? windowsConfiguration.toBuilder() : null;
}
public final void setWindowsConfiguration(CreateFileSystemWindowsConfiguration.BuilderImpl windowsConfiguration) {
this.windowsConfiguration = windowsConfiguration != null ? windowsConfiguration.build() : null;
}
@Override
public final Builder windowsConfiguration(CreateFileSystemWindowsConfiguration windowsConfiguration) {
this.windowsConfiguration = windowsConfiguration;
return this;
}
public final CreateFileSystemLustreConfiguration.Builder getLustreConfiguration() {
return lustreConfiguration != null ? lustreConfiguration.toBuilder() : null;
}
public final void setLustreConfiguration(CreateFileSystemLustreConfiguration.BuilderImpl lustreConfiguration) {
this.lustreConfiguration = lustreConfiguration != null ? lustreConfiguration.build() : null;
}
@Override
public final Builder lustreConfiguration(CreateFileSystemLustreConfiguration lustreConfiguration) {
this.lustreConfiguration = lustreConfiguration;
return this;
}
public final String getStorageType() {
return storageType;
}
public final void setStorageType(String storageType) {
this.storageType = storageType;
}
@Override
public final Builder storageType(String storageType) {
this.storageType = storageType;
return this;
}
@Override
public final Builder storageType(StorageType storageType) {
this.storageType(storageType == null ? null : storageType.toString());
return this;
}
public final String getKmsKeyId() {
return kmsKeyId;
}
public final void setKmsKeyId(String kmsKeyId) {
this.kmsKeyId = kmsKeyId;
}
@Override
public final Builder kmsKeyId(String kmsKeyId) {
this.kmsKeyId = kmsKeyId;
return this;
}
public final String getFileSystemTypeVersion() {
return fileSystemTypeVersion;
}
public final void setFileSystemTypeVersion(String fileSystemTypeVersion) {
this.fileSystemTypeVersion = fileSystemTypeVersion;
}
@Override
public final Builder fileSystemTypeVersion(String fileSystemTypeVersion) {
this.fileSystemTypeVersion = fileSystemTypeVersion;
return this;
}
public final CreateFileSystemOpenZFSConfiguration.Builder getOpenZFSConfiguration() {
return openZFSConfiguration != null ? openZFSConfiguration.toBuilder() : null;
}
public final void setOpenZFSConfiguration(CreateFileSystemOpenZFSConfiguration.BuilderImpl openZFSConfiguration) {
this.openZFSConfiguration = openZFSConfiguration != null ? openZFSConfiguration.build() : null;
}
@Override
public final Builder openZFSConfiguration(CreateFileSystemOpenZFSConfiguration openZFSConfiguration) {
this.openZFSConfiguration = openZFSConfiguration;
return this;
}
public final Integer getStorageCapacity() {
return storageCapacity;
}
public final void setStorageCapacity(Integer storageCapacity) {
this.storageCapacity = storageCapacity;
}
@Override
public final Builder storageCapacity(Integer storageCapacity) {
this.storageCapacity = storageCapacity;
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public CreateFileSystemFromBackupRequest build() {
return new CreateFileSystemFromBackupRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}