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

software.amazon.awssdk.services.fsx.DefaultFSxAsyncClient Maven / Gradle / Ivy

/*
 * 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;

import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.ApiName;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.util.VersionInfo;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.fsx.model.ActiveDirectoryErrorException;
import software.amazon.awssdk.services.fsx.model.AssociateFileSystemAliasesRequest;
import software.amazon.awssdk.services.fsx.model.AssociateFileSystemAliasesResponse;
import software.amazon.awssdk.services.fsx.model.BackupBeingCopiedException;
import software.amazon.awssdk.services.fsx.model.BackupInProgressException;
import software.amazon.awssdk.services.fsx.model.BackupNotFoundException;
import software.amazon.awssdk.services.fsx.model.BackupRestoringException;
import software.amazon.awssdk.services.fsx.model.BadRequestException;
import software.amazon.awssdk.services.fsx.model.CancelDataRepositoryTaskRequest;
import software.amazon.awssdk.services.fsx.model.CancelDataRepositoryTaskResponse;
import software.amazon.awssdk.services.fsx.model.CopyBackupRequest;
import software.amazon.awssdk.services.fsx.model.CopyBackupResponse;
import software.amazon.awssdk.services.fsx.model.CreateBackupRequest;
import software.amazon.awssdk.services.fsx.model.CreateBackupResponse;
import software.amazon.awssdk.services.fsx.model.CreateDataRepositoryAssociationRequest;
import software.amazon.awssdk.services.fsx.model.CreateDataRepositoryAssociationResponse;
import software.amazon.awssdk.services.fsx.model.CreateDataRepositoryTaskRequest;
import software.amazon.awssdk.services.fsx.model.CreateDataRepositoryTaskResponse;
import software.amazon.awssdk.services.fsx.model.CreateFileCacheRequest;
import software.amazon.awssdk.services.fsx.model.CreateFileCacheResponse;
import software.amazon.awssdk.services.fsx.model.CreateFileSystemFromBackupRequest;
import software.amazon.awssdk.services.fsx.model.CreateFileSystemFromBackupResponse;
import software.amazon.awssdk.services.fsx.model.CreateFileSystemRequest;
import software.amazon.awssdk.services.fsx.model.CreateFileSystemResponse;
import software.amazon.awssdk.services.fsx.model.CreateSnapshotRequest;
import software.amazon.awssdk.services.fsx.model.CreateSnapshotResponse;
import software.amazon.awssdk.services.fsx.model.CreateStorageVirtualMachineRequest;
import software.amazon.awssdk.services.fsx.model.CreateStorageVirtualMachineResponse;
import software.amazon.awssdk.services.fsx.model.CreateVolumeFromBackupRequest;
import software.amazon.awssdk.services.fsx.model.CreateVolumeFromBackupResponse;
import software.amazon.awssdk.services.fsx.model.CreateVolumeRequest;
import software.amazon.awssdk.services.fsx.model.CreateVolumeResponse;
import software.amazon.awssdk.services.fsx.model.DataRepositoryAssociationNotFoundException;
import software.amazon.awssdk.services.fsx.model.DataRepositoryTaskEndedException;
import software.amazon.awssdk.services.fsx.model.DataRepositoryTaskExecutingException;
import software.amazon.awssdk.services.fsx.model.DataRepositoryTaskNotFoundException;
import software.amazon.awssdk.services.fsx.model.DeleteBackupRequest;
import software.amazon.awssdk.services.fsx.model.DeleteBackupResponse;
import software.amazon.awssdk.services.fsx.model.DeleteDataRepositoryAssociationRequest;
import software.amazon.awssdk.services.fsx.model.DeleteDataRepositoryAssociationResponse;
import software.amazon.awssdk.services.fsx.model.DeleteFileCacheRequest;
import software.amazon.awssdk.services.fsx.model.DeleteFileCacheResponse;
import software.amazon.awssdk.services.fsx.model.DeleteFileSystemRequest;
import software.amazon.awssdk.services.fsx.model.DeleteFileSystemResponse;
import software.amazon.awssdk.services.fsx.model.DeleteSnapshotRequest;
import software.amazon.awssdk.services.fsx.model.DeleteSnapshotResponse;
import software.amazon.awssdk.services.fsx.model.DeleteStorageVirtualMachineRequest;
import software.amazon.awssdk.services.fsx.model.DeleteStorageVirtualMachineResponse;
import software.amazon.awssdk.services.fsx.model.DeleteVolumeRequest;
import software.amazon.awssdk.services.fsx.model.DeleteVolumeResponse;
import software.amazon.awssdk.services.fsx.model.DescribeBackupsRequest;
import software.amazon.awssdk.services.fsx.model.DescribeBackupsResponse;
import software.amazon.awssdk.services.fsx.model.DescribeDataRepositoryAssociationsRequest;
import software.amazon.awssdk.services.fsx.model.DescribeDataRepositoryAssociationsResponse;
import software.amazon.awssdk.services.fsx.model.DescribeDataRepositoryTasksRequest;
import software.amazon.awssdk.services.fsx.model.DescribeDataRepositoryTasksResponse;
import software.amazon.awssdk.services.fsx.model.DescribeFileCachesRequest;
import software.amazon.awssdk.services.fsx.model.DescribeFileCachesResponse;
import software.amazon.awssdk.services.fsx.model.DescribeFileSystemAliasesRequest;
import software.amazon.awssdk.services.fsx.model.DescribeFileSystemAliasesResponse;
import software.amazon.awssdk.services.fsx.model.DescribeFileSystemsRequest;
import software.amazon.awssdk.services.fsx.model.DescribeFileSystemsResponse;
import software.amazon.awssdk.services.fsx.model.DescribeSnapshotsRequest;
import software.amazon.awssdk.services.fsx.model.DescribeSnapshotsResponse;
import software.amazon.awssdk.services.fsx.model.DescribeStorageVirtualMachinesRequest;
import software.amazon.awssdk.services.fsx.model.DescribeStorageVirtualMachinesResponse;
import software.amazon.awssdk.services.fsx.model.DescribeVolumesRequest;
import software.amazon.awssdk.services.fsx.model.DescribeVolumesResponse;
import software.amazon.awssdk.services.fsx.model.DisassociateFileSystemAliasesRequest;
import software.amazon.awssdk.services.fsx.model.DisassociateFileSystemAliasesResponse;
import software.amazon.awssdk.services.fsx.model.FSxException;
import software.amazon.awssdk.services.fsx.model.FSxRequest;
import software.amazon.awssdk.services.fsx.model.FileCacheNotFoundException;
import software.amazon.awssdk.services.fsx.model.FileSystemNotFoundException;
import software.amazon.awssdk.services.fsx.model.IncompatibleParameterErrorException;
import software.amazon.awssdk.services.fsx.model.IncompatibleRegionForMultiAzException;
import software.amazon.awssdk.services.fsx.model.InternalServerErrorException;
import software.amazon.awssdk.services.fsx.model.InvalidDataRepositoryTypeException;
import software.amazon.awssdk.services.fsx.model.InvalidDestinationKmsKeyException;
import software.amazon.awssdk.services.fsx.model.InvalidExportPathException;
import software.amazon.awssdk.services.fsx.model.InvalidImportPathException;
import software.amazon.awssdk.services.fsx.model.InvalidNetworkSettingsException;
import software.amazon.awssdk.services.fsx.model.InvalidPerUnitStorageThroughputException;
import software.amazon.awssdk.services.fsx.model.InvalidRegionException;
import software.amazon.awssdk.services.fsx.model.InvalidSourceKmsKeyException;
import software.amazon.awssdk.services.fsx.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.fsx.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.fsx.model.MissingFileCacheConfigurationException;
import software.amazon.awssdk.services.fsx.model.MissingFileSystemConfigurationException;
import software.amazon.awssdk.services.fsx.model.MissingVolumeConfigurationException;
import software.amazon.awssdk.services.fsx.model.NotServiceResourceErrorException;
import software.amazon.awssdk.services.fsx.model.ReleaseFileSystemNfsV3LocksRequest;
import software.amazon.awssdk.services.fsx.model.ReleaseFileSystemNfsV3LocksResponse;
import software.amazon.awssdk.services.fsx.model.ResourceDoesNotSupportTaggingException;
import software.amazon.awssdk.services.fsx.model.ResourceNotFoundException;
import software.amazon.awssdk.services.fsx.model.RestoreVolumeFromSnapshotRequest;
import software.amazon.awssdk.services.fsx.model.RestoreVolumeFromSnapshotResponse;
import software.amazon.awssdk.services.fsx.model.ServiceLimitExceededException;
import software.amazon.awssdk.services.fsx.model.SnapshotNotFoundException;
import software.amazon.awssdk.services.fsx.model.SourceBackupUnavailableException;
import software.amazon.awssdk.services.fsx.model.StorageVirtualMachineNotFoundException;
import software.amazon.awssdk.services.fsx.model.TagResourceRequest;
import software.amazon.awssdk.services.fsx.model.TagResourceResponse;
import software.amazon.awssdk.services.fsx.model.UnsupportedOperationException;
import software.amazon.awssdk.services.fsx.model.UntagResourceRequest;
import software.amazon.awssdk.services.fsx.model.UntagResourceResponse;
import software.amazon.awssdk.services.fsx.model.UpdateDataRepositoryAssociationRequest;
import software.amazon.awssdk.services.fsx.model.UpdateDataRepositoryAssociationResponse;
import software.amazon.awssdk.services.fsx.model.UpdateFileCacheRequest;
import software.amazon.awssdk.services.fsx.model.UpdateFileCacheResponse;
import software.amazon.awssdk.services.fsx.model.UpdateFileSystemRequest;
import software.amazon.awssdk.services.fsx.model.UpdateFileSystemResponse;
import software.amazon.awssdk.services.fsx.model.UpdateSnapshotRequest;
import software.amazon.awssdk.services.fsx.model.UpdateSnapshotResponse;
import software.amazon.awssdk.services.fsx.model.UpdateStorageVirtualMachineRequest;
import software.amazon.awssdk.services.fsx.model.UpdateStorageVirtualMachineResponse;
import software.amazon.awssdk.services.fsx.model.UpdateVolumeRequest;
import software.amazon.awssdk.services.fsx.model.UpdateVolumeResponse;
import software.amazon.awssdk.services.fsx.model.VolumeNotFoundException;
import software.amazon.awssdk.services.fsx.paginators.DescribeBackupsPublisher;
import software.amazon.awssdk.services.fsx.paginators.DescribeDataRepositoryAssociationsPublisher;
import software.amazon.awssdk.services.fsx.paginators.DescribeDataRepositoryTasksPublisher;
import software.amazon.awssdk.services.fsx.paginators.DescribeFileCachesPublisher;
import software.amazon.awssdk.services.fsx.paginators.DescribeFileSystemAliasesPublisher;
import software.amazon.awssdk.services.fsx.paginators.DescribeFileSystemsPublisher;
import software.amazon.awssdk.services.fsx.paginators.DescribeSnapshotsPublisher;
import software.amazon.awssdk.services.fsx.paginators.DescribeStorageVirtualMachinesPublisher;
import software.amazon.awssdk.services.fsx.paginators.DescribeVolumesPublisher;
import software.amazon.awssdk.services.fsx.paginators.ListTagsForResourcePublisher;
import software.amazon.awssdk.services.fsx.transform.AssociateFileSystemAliasesRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.CancelDataRepositoryTaskRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.CopyBackupRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.CreateBackupRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.CreateDataRepositoryAssociationRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.CreateDataRepositoryTaskRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.CreateFileCacheRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.CreateFileSystemFromBackupRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.CreateFileSystemRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.CreateSnapshotRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.CreateStorageVirtualMachineRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.CreateVolumeFromBackupRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.CreateVolumeRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.DeleteBackupRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.DeleteDataRepositoryAssociationRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.DeleteFileCacheRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.DeleteFileSystemRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.DeleteSnapshotRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.DeleteStorageVirtualMachineRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.DeleteVolumeRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.DescribeBackupsRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.DescribeDataRepositoryAssociationsRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.DescribeDataRepositoryTasksRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.DescribeFileCachesRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.DescribeFileSystemAliasesRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.DescribeFileSystemsRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.DescribeSnapshotsRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.DescribeStorageVirtualMachinesRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.DescribeVolumesRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.DisassociateFileSystemAliasesRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.ReleaseFileSystemNfsV3LocksRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.RestoreVolumeFromSnapshotRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.UpdateDataRepositoryAssociationRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.UpdateFileCacheRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.UpdateFileSystemRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.UpdateSnapshotRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.UpdateStorageVirtualMachineRequestMarshaller;
import software.amazon.awssdk.services.fsx.transform.UpdateVolumeRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;

/**
 * Internal implementation of {@link FSxAsyncClient}.
 *
 * @see FSxAsyncClient#builder()
 */
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultFSxAsyncClient implements FSxAsyncClient {
    private static final Logger log = LoggerFactory.getLogger(DefaultFSxAsyncClient.class);

    private final AsyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

    private final FSxServiceClientConfiguration serviceClientConfiguration;

    protected DefaultFSxAsyncClient(FSxServiceClientConfiguration serviceClientConfiguration,
            SdkClientConfiguration clientConfiguration) {
        this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
        this.clientConfiguration = clientConfiguration;
        this.serviceClientConfiguration = serviceClientConfiguration;
        this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
    }

    /**
     * 

* Use this action to associate one or more Domain Name Server (DNS) aliases with an existing Amazon FSx for Windows * File Server file system. A file system can have a maximum of 50 DNS aliases associated with it at any one time. * If you try to associate a DNS alias that is already associated with the file system, FSx takes no action on that * alias in the request. For more information, see Working with DNS Aliases * and * Walkthrough 5: Using DNS aliases to access your file system, including additional steps you must take to be * able to access your file system using a DNS alias. *

*

* The system response shows the DNS aliases that Amazon FSx is attempting to associate with the file system. Use * the API operation to monitor the status of the aliases Amazon FSx is associating with the file system. *

* * @param associateFileSystemAliasesRequest * The request object specifying one or more DNS alias names to associate with an Amazon FSx for Windows File * Server file system. * @return A Java Future containing the result of the AssociateFileSystemAliases operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.AssociateFileSystemAliases * @see AWS API Documentation */ @Override public CompletableFuture associateFileSystemAliases( AssociateFileSystemAliasesRequest associateFileSystemAliasesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, associateFileSystemAliasesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateFileSystemAliases"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AssociateFileSystemAliasesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AssociateFileSystemAliases") .withMarshaller(new AssociateFileSystemAliasesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(associateFileSystemAliasesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Cancels an existing Amazon FSx for Lustre data repository task if that task is in either the PENDING * or EXECUTING state. When you cancel a task, Amazon FSx does the following. *

*
    *
  • *

    * Any files that FSx has already exported are not reverted. *

    *
  • *
  • *

    * FSx continues to export any files that are "in-flight" when the cancel operation is received. *

    *
  • *
  • *

    * FSx does not export any files that have not yet been exported. *

    *
  • *
* * @param cancelDataRepositoryTaskRequest * Cancels a data repository task. * @return A Java Future containing the result of the CancelDataRepositoryTask operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • UnsupportedOperationException The requested operation is not supported for this resource or API.
  • *
  • DataRepositoryTaskNotFoundException The data repository task or tasks you specified could not be * found.
  • *
  • DataRepositoryTaskEndedException The data repository task could not be canceled because the task has * already ended.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.CancelDataRepositoryTask * @see AWS * API Documentation */ @Override public CompletableFuture cancelDataRepositoryTask( CancelDataRepositoryTaskRequest cancelDataRepositoryTaskRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, cancelDataRepositoryTaskRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CancelDataRepositoryTask"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CancelDataRepositoryTaskResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CancelDataRepositoryTask") .withMarshaller(new CancelDataRepositoryTaskRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(cancelDataRepositoryTaskRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Copies an existing backup within the same Amazon Web Services account to another Amazon Web Services Region * (cross-Region copy) or within the same Amazon Web Services Region (in-Region copy). You can have up to five * backup copy requests in progress to a single destination Region per account. *

*

* You can use cross-Region backup copies for cross-Region disaster recovery. You can periodically take backups and * copy them to another Region so that in the event of a disaster in the primary Region, you can restore from backup * and recover availability quickly in the other Region. You can make cross-Region copies only within your Amazon * Web Services partition. A partition is a grouping of Regions. Amazon Web Services currently has three partitions: * aws (Standard Regions), aws-cn (China Regions), and aws-us-gov (Amazon Web * Services GovCloud [US] Regions). *

*

* You can also use backup copies to clone your file dataset to another Region or within the same Region. *

*

* You can use the SourceRegion parameter to specify the Amazon Web Services Region from which the * backup will be copied. For example, if you make the call from the us-west-1 Region and want to copy * a backup from the us-east-2 Region, you specify us-east-2 in the * SourceRegion parameter to make a cross-Region copy. If you don't specify a Region, the backup copy * is created in the same Region where the request is sent from (in-Region copy). *

*

* For more information about creating backup copies, see Copying backups * in the Amazon FSx for Windows User Guide, Copying backups * in the Amazon FSx for Lustre User Guide, and Copying backups in * the Amazon FSx for OpenZFS User Guide. *

* * @param copyBackupRequest * @return A Java Future containing the result of the CopyBackup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • BackupNotFoundException No Amazon FSx backups were found based upon the supplied parameters.
  • *
  • ServiceLimitExceededException An error indicating that a particular service limit was exceeded. You * can increase some service limits by contacting Amazon Web Services Support.
  • *
  • UnsupportedOperationException The requested operation is not supported for this resource or API.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • InvalidSourceKmsKeyException The Key Management Service (KMS) key of the source backup is not valid.
  • *
  • InvalidDestinationKmsKeyException The Key Management Service (KMS) key of the destination backup is * not valid.
  • *
  • InvalidRegionException The Region provided for SourceRegion is not valid or is in a * different Amazon Web Services partition.
  • *
  • SourceBackupUnavailableException The request was rejected because the lifecycle status of the source * backup isn't AVAILABLE.
  • *
  • IncompatibleRegionForMultiAzException Amazon FSx doesn't support Multi-AZ Windows File Server copy * backup in the destination Region, so the copied backup can't be restored.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.CopyBackup * @see AWS API * Documentation */ @Override public CompletableFuture copyBackup(CopyBackupRequest copyBackupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, copyBackupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CopyBackup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CopyBackupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("CopyBackup") .withMarshaller(new CopyBackupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(copyBackupRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a backup of an existing Amazon FSx for Windows File Server file system, Amazon FSx for Lustre file * system, Amazon FSx for NetApp ONTAP volume, or Amazon FSx for OpenZFS file system. We recommend creating regular * backups so that you can restore a file system or volume from a backup if an issue arises with the original file * system or volume. *

*

* For Amazon FSx for Lustre file systems, you can create a backup only for file systems that have the following * configuration: *

*
    *
  • *

    * A Persistent deployment type *

    *
  • *
  • *

    * Are not linked to a data repository *

    *
  • *
*

* For more information about backups, see the following: *

* *

* If a backup with the specified client request token exists and the parameters match, this operation returns the * description of the existing backup. If a backup with the specified client request token exists and the parameters * don't match, this operation returns IncompatibleParameterError. If a backup with the specified * client request token doesn't exist, CreateBackup does the following: *

*
    *
  • *

    * Creates a new Amazon FSx backup with an assigned ID, and an initial lifecycle state of CREATING. *

    *
  • *
  • *

    * Returns the description of the backup. *

    *
  • *
*

* By using the idempotent operation, you can retry a CreateBackup operation without the risk of * creating an extra backup. This approach can be useful when an initial call fails in a way that makes it unclear * whether a backup was created. If you use the same client request token and the initial call created a backup, the * operation returns a successful result because all the parameters are the same. *

*

* The CreateBackup operation returns while the backup's lifecycle state is still CREATING * . You can check the backup creation status by calling the DescribeBackups * operation, which returns the backup state along with other information. *

* * @param createBackupRequest * The request object for the CreateBackup operation. * @return A Java Future containing the result of the CreateBackup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • UnsupportedOperationException The requested operation is not supported for this resource or API.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • VolumeNotFoundException No Amazon FSx volumes were found based upon the supplied parameters.
  • *
  • BackupInProgressException Another backup is already under way. Wait for completion before initiating * additional backups of this file system.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • ServiceLimitExceededException An error indicating that a particular service limit was exceeded. You * can increase some service limits by contacting Amazon Web Services Support.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.CreateBackup * @see AWS API * Documentation */ @Override public CompletableFuture createBackup(CreateBackupRequest createBackupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createBackupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateBackup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateBackupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateBackup").withMarshaller(new CreateBackupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createBackupRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates an Amazon FSx for Lustre data repository association (DRA). A data repository association is a link * between a directory on the file system and an Amazon S3 bucket or prefix. You can have a maximum of 8 data * repository associations on a file system. Data repository associations are supported for all file systems except * for Scratch_1 deployment type. *

*

* Each data repository association must have a unique Amazon FSx file system directory and a unique S3 bucket or * prefix associated with it. You can configure a data repository association for automatic import only, for * automatic export only, or for both. To learn more about linking a data repository to your file system, see Linking your file * system to an S3 bucket. *

* *

* CreateDataRepositoryAssociation isn't supported on Amazon File Cache resources. To create a DRA on * Amazon File Cache, use the CreateFileCache operation. *

*
* * @param createDataRepositoryAssociationRequest * @return A Java Future containing the result of the CreateDataRepositoryAssociation operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • UnsupportedOperationException The requested operation is not supported for this resource or API.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • ServiceLimitExceededException An error indicating that a particular service limit was exceeded. You * can increase some service limits by contacting Amazon Web Services Support.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.CreateDataRepositoryAssociation * @see AWS API Documentation */ @Override public CompletableFuture createDataRepositoryAssociation( CreateDataRepositoryAssociationRequest createDataRepositoryAssociationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createDataRepositoryAssociationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDataRepositoryAssociation"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateDataRepositoryAssociationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateDataRepositoryAssociation") .withMarshaller(new CreateDataRepositoryAssociationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createDataRepositoryAssociationRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates an Amazon FSx for Lustre data repository task. You use data repository tasks to perform bulk operations * between your Amazon FSx file system and its linked data repositories. An example of a data repository task is * exporting any data and metadata changes, including POSIX metadata, to files, directories, and symbolic links * (symlinks) from your FSx file system to a linked data repository. A CreateDataRepositoryTask * operation will fail if a data repository is not linked to the FSx file system. To learn more about data * repository tasks, see Data Repository Tasks. * To learn more about linking a data repository to your file system, see Linking your file * system to an S3 bucket. *

* * @param createDataRepositoryTaskRequest * @return A Java Future containing the result of the CreateDataRepositoryTask operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • UnsupportedOperationException The requested operation is not supported for this resource or API.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • ServiceLimitExceededException An error indicating that a particular service limit was exceeded. You * can increase some service limits by contacting Amazon Web Services Support.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • DataRepositoryTaskExecutingException An existing data repository task is currently executing on the * file system. Wait until the existing task has completed, then create the new task.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.CreateDataRepositoryTask * @see AWS * API Documentation */ @Override public CompletableFuture createDataRepositoryTask( CreateDataRepositoryTaskRequest createDataRepositoryTaskRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createDataRepositoryTaskRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDataRepositoryTask"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateDataRepositoryTaskResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateDataRepositoryTask") .withMarshaller(new CreateDataRepositoryTaskRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createDataRepositoryTaskRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new Amazon File Cache resource. *

*

* You can use this operation with a client request token in the request that Amazon File Cache uses to ensure * idempotent creation. If a cache with the specified client request token exists and the parameters match, * CreateFileCache returns the description of the existing cache. If a cache with the specified client * request token exists and the parameters don't match, this call returns IncompatibleParameterError. * If a file cache with the specified client request token doesn't exist, CreateFileCache does the * following: *

*
    *
  • *

    * Creates a new, empty Amazon File Cache resourcewith an assigned ID, and an initial lifecycle state of * CREATING. *

    *
  • *
  • *

    * Returns the description of the cache in JSON format. *

    *
  • *
* *

* The CreateFileCache call returns while the cache's lifecycle state is still CREATING. * You can check the cache creation status by calling the DescribeFileCaches * operation, which returns the cache state along with other information. *

*
* * @param createFileCacheRequest * @return A Java Future containing the result of the CreateFileCache operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • InvalidNetworkSettingsException One or more network settings specified in the request are invalid.
  • *
  • InvalidPerUnitStorageThroughputException An invalid value for PerUnitStorageThroughput * was provided. Please create your file system again, using a valid value.
  • *
  • ServiceLimitExceededException An error indicating that a particular service limit was exceeded. You * can increase some service limits by contacting Amazon Web Services Support.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • MissingFileCacheConfigurationException A cache configuration is required for this operation.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.CreateFileCache * @see AWS API * Documentation */ @Override public CompletableFuture createFileCache(CreateFileCacheRequest createFileCacheRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createFileCacheRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateFileCache"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateFileCacheResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateFileCache") .withMarshaller(new CreateFileCacheRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createFileCacheRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new, empty Amazon FSx file system. You can create the following supported Amazon FSx file systems using * the CreateFileSystem API operation: *

*
    *
  • *

    * Amazon FSx for Lustre *

    *
  • *
  • *

    * Amazon FSx for NetApp ONTAP *

    *
  • *
  • *

    * Amazon FSx for OpenZFS *

    *
  • *
  • *

    * Amazon FSx for Windows File Server *

    *
  • *
*

* This operation requires a client request token in the request that Amazon FSx uses to ensure idempotent creation. * This means that calling the operation multiple times with the same client request token has no effect. By using * the idempotent operation, you can retry a CreateFileSystem operation without the risk of creating an * extra file system. This approach can be useful when an initial call fails in a way that makes it unclear whether * a file system was created. Examples are if a transport level timeout occurred, or your connection was reset. If * you use the same client request token and the initial call created a file system, the client receives success as * long as the parameters are the same. *

*

* If a file system with the specified client request token exists and the parameters match, * CreateFileSystem returns the description of the existing file system. If a file system with the * specified client request token exists and the parameters don't match, this call returns * IncompatibleParameterError. If a file system with the specified client request token doesn't exist, * CreateFileSystem does the following: *

*
    *
  • *

    * Creates a new, empty Amazon FSx file system with an assigned ID, and an initial lifecycle state of * CREATING. *

    *
  • *
  • *

    * Returns the description of the file system in JSON format. *

    *
  • *
* *

* The CreateFileSystem call returns while the file system's lifecycle state is still * CREATING. You can check the file-system creation status by calling the DescribeFileSystems * operation, which returns the file system state along with other information. *

*
* * @param createFileSystemRequest * The request object used to create a new Amazon FSx file system. * @return A Java Future containing the result of the CreateFileSystem operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • ActiveDirectoryErrorException An Active Directory error.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • InvalidImportPathException The path provided for data repository import isn't valid.
  • *
  • InvalidExportPathException The path provided for data repository export isn't valid.
  • *
  • InvalidNetworkSettingsException One or more network settings specified in the request are invalid.
  • *
  • InvalidPerUnitStorageThroughputException An invalid value for PerUnitStorageThroughput * was provided. Please create your file system again, using a valid value.
  • *
  • ServiceLimitExceededException An error indicating that a particular service limit was exceeded. You * can increase some service limits by contacting Amazon Web Services Support.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • MissingFileSystemConfigurationException A file system configuration is required for this operation.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.CreateFileSystem * @see AWS API * Documentation */ @Override public CompletableFuture createFileSystem(CreateFileSystemRequest createFileSystemRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createFileSystemRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateFileSystem"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateFileSystemResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateFileSystem") .withMarshaller(new CreateFileSystemRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createFileSystemRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new Amazon FSx for Lustre, Amazon FSx for Windows File Server, or Amazon FSx for OpenZFS file system * from an existing Amazon FSx backup. *

*

* If a file system with the specified client request token exists and the parameters match, this operation returns * the description of the file system. If a file system with the specified client request token exists but the * parameters don't match, this call returns IncompatibleParameterError. If a file system with the * specified client request token doesn't exist, this operation does the following: *

*
    *
  • *

    * Creates a new Amazon FSx file system from backup with an assigned ID, and an initial lifecycle state of * CREATING. *

    *
  • *
  • *

    * Returns the description of the file system. *

    *
  • *
*

* Parameters like the Active Directory, default share name, automatic backup, and backup settings default to the * parameters of the file system that was backed up, unless overridden. You can explicitly supply other settings. *

*

* By using the idempotent operation, you can retry a CreateFileSystemFromBackup call without the risk * of creating an extra file system. This approach can be useful when an initial call fails in a way that makes it * unclear whether a file system was created. Examples are if a transport level timeout occurred, or your connection * was reset. If you use the same client request token and the initial call created a file system, the client * receives a success message as long as the parameters are the same. *

* *

* The CreateFileSystemFromBackup call returns while the file system's lifecycle state is still * CREATING. You can check the file-system creation status by calling the DescribeFileSystems * operation, which returns the file system state along with other information. *

*
* * @param createFileSystemFromBackupRequest * The request object for the CreateFileSystemFromBackup operation. * @return A Java Future containing the result of the CreateFileSystemFromBackup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • ActiveDirectoryErrorException An Active Directory error.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • InvalidNetworkSettingsException One or more network settings specified in the request are invalid.
  • *
  • InvalidPerUnitStorageThroughputException An invalid value for PerUnitStorageThroughput * was provided. Please create your file system again, using a valid value.
  • *
  • ServiceLimitExceededException An error indicating that a particular service limit was exceeded. You * can increase some service limits by contacting Amazon Web Services Support.
  • *
  • BackupNotFoundException No Amazon FSx backups were found based upon the supplied parameters.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • MissingFileSystemConfigurationException A file system configuration is required for this operation.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.CreateFileSystemFromBackup * @see AWS API Documentation */ @Override public CompletableFuture createFileSystemFromBackup( CreateFileSystemFromBackupRequest createFileSystemFromBackupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createFileSystemFromBackupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateFileSystemFromBackup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateFileSystemFromBackupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateFileSystemFromBackup") .withMarshaller(new CreateFileSystemFromBackupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createFileSystemFromBackupRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a snapshot of an existing Amazon FSx for OpenZFS volume. With snapshots, you can easily undo file changes * and compare file versions by restoring the volume to a previous version. *

*

* If a snapshot with the specified client request token exists, and the parameters match, this operation returns * the description of the existing snapshot. If a snapshot with the specified client request token exists, and the * parameters don't match, this operation returns IncompatibleParameterError. If a snapshot with the * specified client request token doesn't exist, CreateSnapshot does the following: *

*
    *
  • *

    * Creates a new OpenZFS snapshot with an assigned ID, and an initial lifecycle state of CREATING. *

    *
  • *
  • *

    * Returns the description of the snapshot. *

    *
  • *
*

* By using the idempotent operation, you can retry a CreateSnapshot operation without the risk of * creating an extra snapshot. This approach can be useful when an initial call fails in a way that makes it unclear * whether a snapshot was created. If you use the same client request token and the initial call created a snapshot, * the operation returns a successful result because all the parameters are the same. *

*

* The CreateSnapshot operation returns while the snapshot's lifecycle state is still * CREATING. You can check the snapshot creation status by calling the DescribeSnapshots * operation, which returns the snapshot state along with other information. *

* * @param createSnapshotRequest * @return A Java Future containing the result of the CreateSnapshot operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • VolumeNotFoundException No Amazon FSx volumes were found based upon the supplied parameters.
  • *
  • ServiceLimitExceededException An error indicating that a particular service limit was exceeded. You * can increase some service limits by contacting Amazon Web Services Support.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.CreateSnapshot * @see AWS API * Documentation */ @Override public CompletableFuture createSnapshot(CreateSnapshotRequest createSnapshotRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createSnapshotRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSnapshot"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateSnapshotResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateSnapshot") .withMarshaller(new CreateSnapshotRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createSnapshotRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a storage virtual machine (SVM) for an Amazon FSx for ONTAP file system. *

* * @param createStorageVirtualMachineRequest * @return A Java Future containing the result of the CreateStorageVirtualMachine operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ActiveDirectoryErrorException An Active Directory error.
  • *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • ServiceLimitExceededException An error indicating that a particular service limit was exceeded. You * can increase some service limits by contacting Amazon Web Services Support.
  • *
  • UnsupportedOperationException The requested operation is not supported for this resource or API.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.CreateStorageVirtualMachine * @see AWS API Documentation */ @Override public CompletableFuture createStorageVirtualMachine( CreateStorageVirtualMachineRequest createStorageVirtualMachineRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createStorageVirtualMachineRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateStorageVirtualMachine"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateStorageVirtualMachineResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateStorageVirtualMachine") .withMarshaller(new CreateStorageVirtualMachineRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createStorageVirtualMachineRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates an FSx for ONTAP or Amazon FSx for OpenZFS storage volume. *

* * @param createVolumeRequest * @return A Java Future containing the result of the CreateVolume operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • MissingVolumeConfigurationException A volume configuration is required for this operation.
  • *
  • ServiceLimitExceededException An error indicating that a particular service limit was exceeded. You * can increase some service limits by contacting Amazon Web Services Support.
  • *
  • StorageVirtualMachineNotFoundException No FSx for ONTAP SVMs were found based upon the supplied * parameters.
  • *
  • UnsupportedOperationException The requested operation is not supported for this resource or API.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.CreateVolume * @see AWS API * Documentation */ @Override public CompletableFuture createVolume(CreateVolumeRequest createVolumeRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createVolumeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateVolume"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateVolumeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateVolume").withMarshaller(new CreateVolumeRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createVolumeRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new Amazon FSx for NetApp ONTAP volume from an existing Amazon FSx volume backup. *

* * @param createVolumeFromBackupRequest * @return A Java Future containing the result of the CreateVolumeFromBackup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BackupNotFoundException No Amazon FSx backups were found based upon the supplied parameters.
  • *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • MissingVolumeConfigurationException A volume configuration is required for this operation.
  • *
  • ServiceLimitExceededException An error indicating that a particular service limit was exceeded. You * can increase some service limits by contacting Amazon Web Services Support.
  • *
  • StorageVirtualMachineNotFoundException No FSx for ONTAP SVMs were found based upon the supplied * parameters.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.CreateVolumeFromBackup * @see AWS * API Documentation */ @Override public CompletableFuture createVolumeFromBackup( CreateVolumeFromBackupRequest createVolumeFromBackupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createVolumeFromBackupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateVolumeFromBackup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateVolumeFromBackupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateVolumeFromBackup") .withMarshaller(new CreateVolumeFromBackupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createVolumeFromBackupRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes an Amazon FSx backup. After deletion, the backup no longer exists, and its data is gone. *

*

* The DeleteBackup call returns instantly. The backup won't show up in later * DescribeBackups calls. *

* *

* The data in a deleted backup is also deleted and can't be recovered by any means. *

*
* * @param deleteBackupRequest * The request object for the DeleteBackup operation. * @return A Java Future containing the result of the DeleteBackup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • BackupInProgressException Another backup is already under way. Wait for completion before initiating * additional backups of this file system.
  • *
  • BackupNotFoundException No Amazon FSx backups were found based upon the supplied parameters.
  • *
  • BackupRestoringException You can't delete a backup while it's being used to restore a file system.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • BackupBeingCopiedException You can't delete a backup while it's being copied.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DeleteBackup * @see AWS API * Documentation */ @Override public CompletableFuture deleteBackup(DeleteBackupRequest deleteBackupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteBackupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteBackup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteBackupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteBackup").withMarshaller(new DeleteBackupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteBackupRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a data repository association on an Amazon FSx for Lustre file system. Deleting the data repository * association unlinks the file system from the Amazon S3 bucket. When deleting a data repository association, you * have the option of deleting the data in the file system that corresponds to the data repository association. Data * repository associations are supported for all file systems except for Scratch_1 deployment type. *

* * @param deleteDataRepositoryAssociationRequest * @return A Java Future containing the result of the DeleteDataRepositoryAssociation operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • DataRepositoryAssociationNotFoundException No data repository associations were found based upon the * supplied parameters.
  • *
  • ServiceLimitExceededException An error indicating that a particular service limit was exceeded. You * can increase some service limits by contacting Amazon Web Services Support.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DeleteDataRepositoryAssociation * @see AWS API Documentation */ @Override public CompletableFuture deleteDataRepositoryAssociation( DeleteDataRepositoryAssociationRequest deleteDataRepositoryAssociationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDataRepositoryAssociationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDataRepositoryAssociation"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteDataRepositoryAssociationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteDataRepositoryAssociation") .withMarshaller(new DeleteDataRepositoryAssociationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteDataRepositoryAssociationRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes an Amazon File Cache resource. After deletion, the cache no longer exists, and its data is gone. *

*

* The DeleteFileCache operation returns while the cache has the DELETING status. You can * check the cache deletion status by calling the DescribeFileCaches * operation, which returns a list of caches in your account. If you pass the cache ID for a deleted cache, the * DescribeFileCaches operation returns a FileCacheNotFound error. *

* *

* The data in a deleted cache is also deleted and can't be recovered by any means. *

*
* * @param deleteFileCacheRequest * @return A Java Future containing the result of the DeleteFileCache operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • FileCacheNotFoundException No caches were found based upon supplied parameters.
  • *
  • ServiceLimitExceededException An error indicating that a particular service limit was exceeded. You * can increase some service limits by contacting Amazon Web Services Support.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DeleteFileCache * @see AWS API * Documentation */ @Override public CompletableFuture deleteFileCache(DeleteFileCacheRequest deleteFileCacheRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteFileCacheRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteFileCache"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteFileCacheResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteFileCache") .withMarshaller(new DeleteFileCacheRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteFileCacheRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a file system. After deletion, the file system no longer exists, and its data is gone. Any existing * automatic backups and snapshots are also deleted. *

*

* To delete an Amazon FSx for NetApp ONTAP file system, first delete all the volumes and storage virtual machines * (SVMs) on the file system. Then provide a FileSystemId value to the DeleFileSystem * operation. *

*

* By default, when you delete an Amazon FSx for Windows File Server file system, a final backup is created upon * deletion. This final backup isn't subject to the file system's retention policy, and must be manually deleted. *

*

* The DeleteFileSystem operation returns while the file system has the DELETING status. * You can check the file system deletion status by calling the DescribeFileSystems * operation, which returns a list of file systems in your account. If you pass the file system ID for a deleted * file system, the DescribeFileSystems operation returns a FileSystemNotFound error. *

* *

* If a data repository task is in a PENDING or EXECUTING state, deleting an Amazon FSx * for Lustre file system will fail with an HTTP status code 400 (Bad Request). *

*
*

* The data in a deleted file system is also deleted and can't be recovered by any means. *

*
* * @param deleteFileSystemRequest * The request object for DeleteFileSystem operation. * @return A Java Future containing the result of the DeleteFileSystem operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • ServiceLimitExceededException An error indicating that a particular service limit was exceeded. You * can increase some service limits by contacting Amazon Web Services Support.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DeleteFileSystem * @see AWS API * Documentation */ @Override public CompletableFuture deleteFileSystem(DeleteFileSystemRequest deleteFileSystemRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteFileSystemRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteFileSystem"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteFileSystemResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteFileSystem") .withMarshaller(new DeleteFileSystemRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteFileSystemRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes an Amazon FSx for OpenZFS snapshot. After deletion, the snapshot no longer exists, and its data is gone. * Deleting a snapshot doesn't affect snapshots stored in a file system backup. *

*

* The DeleteSnapshot operation returns instantly. The snapshot appears with the lifecycle status of * DELETING until the deletion is complete. *

* * @param deleteSnapshotRequest * @return A Java Future containing the result of the DeleteSnapshot operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SnapshotNotFoundException No Amazon FSx snapshots were found based on the supplied parameters.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DeleteSnapshot * @see AWS API * Documentation */ @Override public CompletableFuture deleteSnapshot(DeleteSnapshotRequest deleteSnapshotRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSnapshotRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSnapshot"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteSnapshotResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteSnapshot") .withMarshaller(new DeleteSnapshotRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteSnapshotRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes an existing Amazon FSx for ONTAP storage virtual machine (SVM). Prior to deleting an SVM, you must delete * all non-root volumes in the SVM, otherwise the operation will fail. *

* * @param deleteStorageVirtualMachineRequest * @return A Java Future containing the result of the DeleteStorageVirtualMachine operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • StorageVirtualMachineNotFoundException No FSx for ONTAP SVMs were found based upon the supplied * parameters.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DeleteStorageVirtualMachine * @see AWS API Documentation */ @Override public CompletableFuture deleteStorageVirtualMachine( DeleteStorageVirtualMachineRequest deleteStorageVirtualMachineRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteStorageVirtualMachineRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteStorageVirtualMachine"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteStorageVirtualMachineResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteStorageVirtualMachine") .withMarshaller(new DeleteStorageVirtualMachineRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteStorageVirtualMachineRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes an Amazon FSx for NetApp ONTAP or Amazon FSx for OpenZFS volume. *

* * @param deleteVolumeRequest * @return A Java Future containing the result of the DeleteVolume operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • VolumeNotFoundException No Amazon FSx volumes were found based upon the supplied parameters.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DeleteVolume * @see AWS API * Documentation */ @Override public CompletableFuture deleteVolume(DeleteVolumeRequest deleteVolumeRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteVolumeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteVolume"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteVolumeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteVolume").withMarshaller(new DeleteVolumeRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteVolumeRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the description of a specific Amazon FSx backup, if a BackupIds value is provided for that * backup. Otherwise, it returns all backups owned by your Amazon Web Services account in the Amazon Web Services * Region of the endpoint that you're calling. *

*

* When retrieving all backups, you can optionally specify the MaxResults parameter to limit the number * of backups in a response. If more backups remain, Amazon FSx returns a NextToken value in the * response. In this case, send a later request with the NextToken request parameter set to the value * of the NextToken value from the last response. *

*

* This operation is used in an iterative process to retrieve a list of your backups. DescribeBackups * is called first without a NextToken value. Then the operation continues to be called with the * NextToken parameter set to the value of the last NextToken value until a response has * no NextToken value. *

*

* When using this operation, keep the following in mind: *

*
    *
  • *

    * The operation might return fewer than the MaxResults value of backup descriptions while still * including a NextToken value. *

    *
  • *
  • *

    * The order of the backups returned in the response of one DescribeBackups call and the order of the * backups returned across the responses of a multi-call iteration is unspecified. *

    *
  • *
* * @param describeBackupsRequest * The request object for the DescribeBackups operation. * @return A Java Future containing the result of the DescribeBackups operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • VolumeNotFoundException No Amazon FSx volumes were found based upon the supplied parameters.
  • *
  • BackupNotFoundException No Amazon FSx backups were found based upon the supplied parameters.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DescribeBackups * @see AWS API * Documentation */ @Override public CompletableFuture describeBackups(DescribeBackupsRequest describeBackupsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeBackupsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeBackups"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeBackupsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeBackups") .withMarshaller(new DescribeBackupsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeBackupsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the description of a specific Amazon FSx backup, if a BackupIds value is provided for that * backup. Otherwise, it returns all backups owned by your Amazon Web Services account in the Amazon Web Services * Region of the endpoint that you're calling. *

*

* When retrieving all backups, you can optionally specify the MaxResults parameter to limit the number * of backups in a response. If more backups remain, Amazon FSx returns a NextToken value in the * response. In this case, send a later request with the NextToken request parameter set to the value * of the NextToken value from the last response. *

*

* This operation is used in an iterative process to retrieve a list of your backups. DescribeBackups * is called first without a NextToken value. Then the operation continues to be called with the * NextToken parameter set to the value of the last NextToken value until a response has * no NextToken value. *

*

* When using this operation, keep the following in mind: *

*
    *
  • *

    * The operation might return fewer than the MaxResults value of backup descriptions while still * including a NextToken value. *

    *
  • *
  • *

    * The order of the backups returned in the response of one DescribeBackups call and the order of the * backups returned across the responses of a multi-call iteration is unspecified. *

    *
  • *
*
*

* This is a variant of {@link #describeBackups(software.amazon.awssdk.services.fsx.model.DescribeBackupsRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.fsx.paginators.DescribeBackupsPublisher publisher = client.describeBackupsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.fsx.paginators.DescribeBackupsPublisher publisher = client.describeBackupsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.fsx.model.DescribeBackupsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of MaxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #describeBackups(software.amazon.awssdk.services.fsx.model.DescribeBackupsRequest)} operation. *

* * @param describeBackupsRequest * The request object for the DescribeBackups operation. * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • VolumeNotFoundException No Amazon FSx volumes were found based upon the supplied parameters.
  • *
  • BackupNotFoundException No Amazon FSx backups were found based upon the supplied parameters.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DescribeBackups * @see AWS API * Documentation */ public DescribeBackupsPublisher describeBackupsPaginator(DescribeBackupsRequest describeBackupsRequest) { return new DescribeBackupsPublisher(this, applyPaginatorUserAgent(describeBackupsRequest)); } /** *

* Returns the description of specific Amazon FSx for Lustre or Amazon File Cache data repository associations, if * one or more AssociationIds values are provided in the request, or if filters are used in the * request. Data repository associations are supported on Amazon File Cache resources and all Amazon FSx for Lustre * file systems excluding Scratch_1 deployment types. *

*

* You can use filters to narrow the response to include just data repository associations for specific file systems * (use the file-system-id filter with the ID of the file system) or caches (use the * file-cache-id filter with the ID of the cache), or data repository associations for a specific * repository type (use the data-repository-type filter with a value of S3 or * NFS). If you don't use filters, the response returns all data repository associations owned by your * Amazon Web Services account in the Amazon Web Services Region of the endpoint that you're calling. *

*

* When retrieving all data repository associations, you can paginate the response by using the optional * MaxResults parameter to limit the number of data repository associations returned in a response. If * more data repository associations remain, a NextToken value is returned in the response. In this * case, send a later request with the NextToken request parameter set to the value of * NextToken from the last response. *

* * @param describeDataRepositoryAssociationsRequest * @return A Java Future containing the result of the DescribeDataRepositoryAssociations operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • DataRepositoryAssociationNotFoundException No data repository associations were found based upon the * supplied parameters.
  • *
  • InvalidDataRepositoryTypeException You have filtered the response to a data repository type that is * not supported.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DescribeDataRepositoryAssociations * @see AWS API Documentation */ @Override public CompletableFuture describeDataRepositoryAssociations( DescribeDataRepositoryAssociationsRequest describeDataRepositoryAssociationsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDataRepositoryAssociationsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDataRepositoryAssociations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DescribeDataRepositoryAssociationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeDataRepositoryAssociations") .withMarshaller(new DescribeDataRepositoryAssociationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeDataRepositoryAssociationsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the description of specific Amazon FSx for Lustre or Amazon File Cache data repository associations, if * one or more AssociationIds values are provided in the request, or if filters are used in the * request. Data repository associations are supported on Amazon File Cache resources and all Amazon FSx for Lustre * file systems excluding Scratch_1 deployment types. *

*

* You can use filters to narrow the response to include just data repository associations for specific file systems * (use the file-system-id filter with the ID of the file system) or caches (use the * file-cache-id filter with the ID of the cache), or data repository associations for a specific * repository type (use the data-repository-type filter with a value of S3 or * NFS). If you don't use filters, the response returns all data repository associations owned by your * Amazon Web Services account in the Amazon Web Services Region of the endpoint that you're calling. *

*

* When retrieving all data repository associations, you can paginate the response by using the optional * MaxResults parameter to limit the number of data repository associations returned in a response. If * more data repository associations remain, a NextToken value is returned in the response. In this * case, send a later request with the NextToken request parameter set to the value of * NextToken from the last response. *

*
*

* This is a variant of * {@link #describeDataRepositoryAssociations(software.amazon.awssdk.services.fsx.model.DescribeDataRepositoryAssociationsRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.fsx.paginators.DescribeDataRepositoryAssociationsPublisher publisher = client.describeDataRepositoryAssociationsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.fsx.paginators.DescribeDataRepositoryAssociationsPublisher publisher = client.describeDataRepositoryAssociationsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.fsx.model.DescribeDataRepositoryAssociationsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of MaxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #describeDataRepositoryAssociations(software.amazon.awssdk.services.fsx.model.DescribeDataRepositoryAssociationsRequest)} * operation. *

* * @param describeDataRepositoryAssociationsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • DataRepositoryAssociationNotFoundException No data repository associations were found based upon the * supplied parameters.
  • *
  • InvalidDataRepositoryTypeException You have filtered the response to a data repository type that is * not supported.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DescribeDataRepositoryAssociations * @see AWS API Documentation */ public DescribeDataRepositoryAssociationsPublisher describeDataRepositoryAssociationsPaginator( DescribeDataRepositoryAssociationsRequest describeDataRepositoryAssociationsRequest) { return new DescribeDataRepositoryAssociationsPublisher(this, applyPaginatorUserAgent(describeDataRepositoryAssociationsRequest)); } /** *

* Returns the description of specific Amazon FSx for Lustre or Amazon File Cache data repository tasks, if one or * more TaskIds values are provided in the request, or if filters are used in the request. You can use * filters to narrow the response to include just tasks for specific file systems or caches, or tasks in a specific * lifecycle state. Otherwise, it returns all data repository tasks owned by your Amazon Web Services account in the * Amazon Web Services Region of the endpoint that you're calling. *

*

* When retrieving all tasks, you can paginate the response by using the optional MaxResults parameter * to limit the number of tasks returned in a response. If more tasks remain, a NextToken value is * returned in the response. In this case, send a later request with the NextToken request parameter * set to the value of NextToken from the last response. *

* * @param describeDataRepositoryTasksRequest * @return A Java Future containing the result of the DescribeDataRepositoryTasks operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • DataRepositoryTaskNotFoundException The data repository task or tasks you specified could not be * found.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DescribeDataRepositoryTasks * @see AWS API Documentation */ @Override public CompletableFuture describeDataRepositoryTasks( DescribeDataRepositoryTasksRequest describeDataRepositoryTasksRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDataRepositoryTasksRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDataRepositoryTasks"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeDataRepositoryTasksResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeDataRepositoryTasks") .withMarshaller(new DescribeDataRepositoryTasksRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeDataRepositoryTasksRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the description of specific Amazon FSx for Lustre or Amazon File Cache data repository tasks, if one or * more TaskIds values are provided in the request, or if filters are used in the request. You can use * filters to narrow the response to include just tasks for specific file systems or caches, or tasks in a specific * lifecycle state. Otherwise, it returns all data repository tasks owned by your Amazon Web Services account in the * Amazon Web Services Region of the endpoint that you're calling. *

*

* When retrieving all tasks, you can paginate the response by using the optional MaxResults parameter * to limit the number of tasks returned in a response. If more tasks remain, a NextToken value is * returned in the response. In this case, send a later request with the NextToken request parameter * set to the value of NextToken from the last response. *

*
*

* This is a variant of * {@link #describeDataRepositoryTasks(software.amazon.awssdk.services.fsx.model.DescribeDataRepositoryTasksRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.fsx.paginators.DescribeDataRepositoryTasksPublisher publisher = client.describeDataRepositoryTasksPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.fsx.paginators.DescribeDataRepositoryTasksPublisher publisher = client.describeDataRepositoryTasksPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.fsx.model.DescribeDataRepositoryTasksResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of MaxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #describeDataRepositoryTasks(software.amazon.awssdk.services.fsx.model.DescribeDataRepositoryTasksRequest)} * operation. *

* * @param describeDataRepositoryTasksRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • DataRepositoryTaskNotFoundException The data repository task or tasks you specified could not be * found.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DescribeDataRepositoryTasks * @see AWS API Documentation */ public DescribeDataRepositoryTasksPublisher describeDataRepositoryTasksPaginator( DescribeDataRepositoryTasksRequest describeDataRepositoryTasksRequest) { return new DescribeDataRepositoryTasksPublisher(this, applyPaginatorUserAgent(describeDataRepositoryTasksRequest)); } /** *

* Returns the description of a specific Amazon File Cache resource, if a FileCacheIds value is * provided for that cache. Otherwise, it returns descriptions of all caches owned by your Amazon Web Services * account in the Amazon Web Services Region of the endpoint that you're calling. *

*

* When retrieving all cache descriptions, you can optionally specify the MaxResults parameter to limit * the number of descriptions in a response. If more cache descriptions remain, the operation returns a * NextToken value in the response. In this case, send a later request with the NextToken * request parameter set to the value of NextToken from the last response. *

*

* This operation is used in an iterative process to retrieve a list of your cache descriptions. * DescribeFileCaches is called first without a NextTokenvalue. Then the operation * continues to be called with the NextToken parameter set to the value of the last * NextToken value until a response has no NextToken. *

*

* When using this operation, keep the following in mind: *

*
    *
  • *

    * The implementation might return fewer than MaxResults cache descriptions while still including a * NextToken value. *

    *
  • *
  • *

    * The order of caches returned in the response of one DescribeFileCaches call and the order of caches * returned across the responses of a multicall iteration is unspecified. *

    *
  • *
* * @param describeFileCachesRequest * @return A Java Future containing the result of the DescribeFileCaches operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • FileCacheNotFoundException No caches were found based upon supplied parameters.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DescribeFileCaches * @see AWS API * Documentation */ @Override public CompletableFuture describeFileCaches(DescribeFileCachesRequest describeFileCachesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeFileCachesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeFileCaches"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeFileCachesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeFileCaches") .withMarshaller(new DescribeFileCachesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeFileCachesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the description of a specific Amazon File Cache resource, if a FileCacheIds value is * provided for that cache. Otherwise, it returns descriptions of all caches owned by your Amazon Web Services * account in the Amazon Web Services Region of the endpoint that you're calling. *

*

* When retrieving all cache descriptions, you can optionally specify the MaxResults parameter to limit * the number of descriptions in a response. If more cache descriptions remain, the operation returns a * NextToken value in the response. In this case, send a later request with the NextToken * request parameter set to the value of NextToken from the last response. *

*

* This operation is used in an iterative process to retrieve a list of your cache descriptions. * DescribeFileCaches is called first without a NextTokenvalue. Then the operation * continues to be called with the NextToken parameter set to the value of the last * NextToken value until a response has no NextToken. *

*

* When using this operation, keep the following in mind: *

*
    *
  • *

    * The implementation might return fewer than MaxResults cache descriptions while still including a * NextToken value. *

    *
  • *
  • *

    * The order of caches returned in the response of one DescribeFileCaches call and the order of caches * returned across the responses of a multicall iteration is unspecified. *

    *
  • *
*
*

* This is a variant of * {@link #describeFileCaches(software.amazon.awssdk.services.fsx.model.DescribeFileCachesRequest)} operation. The * return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.fsx.paginators.DescribeFileCachesPublisher publisher = client.describeFileCachesPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.fsx.paginators.DescribeFileCachesPublisher publisher = client.describeFileCachesPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.fsx.model.DescribeFileCachesResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of MaxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #describeFileCaches(software.amazon.awssdk.services.fsx.model.DescribeFileCachesRequest)} operation. *

* * @param describeFileCachesRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • FileCacheNotFoundException No caches were found based upon supplied parameters.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DescribeFileCaches * @see AWS API * Documentation */ public DescribeFileCachesPublisher describeFileCachesPaginator(DescribeFileCachesRequest describeFileCachesRequest) { return new DescribeFileCachesPublisher(this, applyPaginatorUserAgent(describeFileCachesRequest)); } /** *

* Returns the DNS aliases that are associated with the specified Amazon FSx for Windows File Server file system. A * history of all DNS aliases that have been associated with and disassociated from the file system is available in * the list of AdministrativeAction provided in the DescribeFileSystems operation response. *

* * @param describeFileSystemAliasesRequest * The request object for DescribeFileSystemAliases operation. * @return A Java Future containing the result of the DescribeFileSystemAliases operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DescribeFileSystemAliases * @see AWS * API Documentation */ @Override public CompletableFuture describeFileSystemAliases( DescribeFileSystemAliasesRequest describeFileSystemAliasesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeFileSystemAliasesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeFileSystemAliases"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeFileSystemAliasesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeFileSystemAliases") .withMarshaller(new DescribeFileSystemAliasesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeFileSystemAliasesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the DNS aliases that are associated with the specified Amazon FSx for Windows File Server file system. A * history of all DNS aliases that have been associated with and disassociated from the file system is available in * the list of AdministrativeAction provided in the DescribeFileSystems operation response. *

*
*

* This is a variant of * {@link #describeFileSystemAliases(software.amazon.awssdk.services.fsx.model.DescribeFileSystemAliasesRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.fsx.paginators.DescribeFileSystemAliasesPublisher publisher = client.describeFileSystemAliasesPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.fsx.paginators.DescribeFileSystemAliasesPublisher publisher = client.describeFileSystemAliasesPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.fsx.model.DescribeFileSystemAliasesResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of MaxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #describeFileSystemAliases(software.amazon.awssdk.services.fsx.model.DescribeFileSystemAliasesRequest)} * operation. *

* * @param describeFileSystemAliasesRequest * The request object for DescribeFileSystemAliases operation. * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DescribeFileSystemAliases * @see AWS * API Documentation */ public DescribeFileSystemAliasesPublisher describeFileSystemAliasesPaginator( DescribeFileSystemAliasesRequest describeFileSystemAliasesRequest) { return new DescribeFileSystemAliasesPublisher(this, applyPaginatorUserAgent(describeFileSystemAliasesRequest)); } /** *

* Returns the description of specific Amazon FSx file systems, if a FileSystemIds value is provided * for that file system. Otherwise, it returns descriptions of all file systems owned by your Amazon Web Services * account in the Amazon Web Services Region of the endpoint that you're calling. *

*

* When retrieving all file system descriptions, you can optionally specify the MaxResults parameter to * limit the number of descriptions in a response. If more file system descriptions remain, Amazon FSx returns a * NextToken value in the response. In this case, send a later request with the NextToken * request parameter set to the value of NextToken from the last response. *

*

* This operation is used in an iterative process to retrieve a list of your file system descriptions. * DescribeFileSystems is called first without a NextTokenvalue. Then the operation * continues to be called with the NextToken parameter set to the value of the last * NextToken value until a response has no NextToken. *

*

* When using this operation, keep the following in mind: *

*
    *
  • *

    * The implementation might return fewer than MaxResults file system descriptions while still including * a NextToken value. *

    *
  • *
  • *

    * The order of file systems returned in the response of one DescribeFileSystems call and the order of * file systems returned across the responses of a multicall iteration is unspecified. *

    *
  • *
* * @param describeFileSystemsRequest * The request object for DescribeFileSystems operation. * @return A Java Future containing the result of the DescribeFileSystems operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DescribeFileSystems * @see AWS API * Documentation */ @Override public CompletableFuture describeFileSystems( DescribeFileSystemsRequest describeFileSystemsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeFileSystemsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeFileSystems"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeFileSystemsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeFileSystems") .withMarshaller(new DescribeFileSystemsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeFileSystemsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the description of specific Amazon FSx file systems, if a FileSystemIds value is provided * for that file system. Otherwise, it returns descriptions of all file systems owned by your Amazon Web Services * account in the Amazon Web Services Region of the endpoint that you're calling. *

*

* When retrieving all file system descriptions, you can optionally specify the MaxResults parameter to * limit the number of descriptions in a response. If more file system descriptions remain, Amazon FSx returns a * NextToken value in the response. In this case, send a later request with the NextToken * request parameter set to the value of NextToken from the last response. *

*

* This operation is used in an iterative process to retrieve a list of your file system descriptions. * DescribeFileSystems is called first without a NextTokenvalue. Then the operation * continues to be called with the NextToken parameter set to the value of the last * NextToken value until a response has no NextToken. *

*

* When using this operation, keep the following in mind: *

*
    *
  • *

    * The implementation might return fewer than MaxResults file system descriptions while still including * a NextToken value. *

    *
  • *
  • *

    * The order of file systems returned in the response of one DescribeFileSystems call and the order of * file systems returned across the responses of a multicall iteration is unspecified. *

    *
  • *
*
*

* This is a variant of * {@link #describeFileSystems(software.amazon.awssdk.services.fsx.model.DescribeFileSystemsRequest)} operation. The * return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.fsx.paginators.DescribeFileSystemsPublisher publisher = client.describeFileSystemsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.fsx.paginators.DescribeFileSystemsPublisher publisher = client.describeFileSystemsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.fsx.model.DescribeFileSystemsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of MaxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #describeFileSystems(software.amazon.awssdk.services.fsx.model.DescribeFileSystemsRequest)} operation. *

* * @param describeFileSystemsRequest * The request object for DescribeFileSystems operation. * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DescribeFileSystems * @see AWS API * Documentation */ public DescribeFileSystemsPublisher describeFileSystemsPaginator(DescribeFileSystemsRequest describeFileSystemsRequest) { return new DescribeFileSystemsPublisher(this, applyPaginatorUserAgent(describeFileSystemsRequest)); } /** *

* Returns the description of specific Amazon FSx for OpenZFS snapshots, if a SnapshotIds value is * provided. Otherwise, this operation returns all snapshots owned by your Amazon Web Services account in the Amazon * Web Services Region of the endpoint that you're calling. *

*

* When retrieving all snapshots, you can optionally specify the MaxResults parameter to limit the * number of snapshots in a response. If more backups remain, Amazon FSx returns a NextToken value in * the response. In this case, send a later request with the NextToken request parameter set to the * value of NextToken from the last response. *

*

* Use this operation in an iterative process to retrieve a list of your snapshots. DescribeSnapshots * is called first without a NextToken value. Then the operation continues to be called with the * NextToken parameter set to the value of the last NextToken value until a response has * no NextToken value. *

*

* When using this operation, keep the following in mind: *

*
    *
  • *

    * The operation might return fewer than the MaxResults value of snapshot descriptions while still * including a NextToken value. *

    *
  • *
  • *

    * The order of snapshots returned in the response of one DescribeSnapshots call and the order of * backups returned across the responses of a multi-call iteration is unspecified. *

    *
  • *
* * @param describeSnapshotsRequest * @return A Java Future containing the result of the DescribeSnapshots operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SnapshotNotFoundException No Amazon FSx snapshots were found based on the supplied parameters.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DescribeSnapshots * @see AWS API * Documentation */ @Override public CompletableFuture describeSnapshots(DescribeSnapshotsRequest describeSnapshotsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeSnapshotsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeSnapshots"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeSnapshotsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeSnapshots") .withMarshaller(new DescribeSnapshotsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeSnapshotsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the description of specific Amazon FSx for OpenZFS snapshots, if a SnapshotIds value is * provided. Otherwise, this operation returns all snapshots owned by your Amazon Web Services account in the Amazon * Web Services Region of the endpoint that you're calling. *

*

* When retrieving all snapshots, you can optionally specify the MaxResults parameter to limit the * number of snapshots in a response. If more backups remain, Amazon FSx returns a NextToken value in * the response. In this case, send a later request with the NextToken request parameter set to the * value of NextToken from the last response. *

*

* Use this operation in an iterative process to retrieve a list of your snapshots. DescribeSnapshots * is called first without a NextToken value. Then the operation continues to be called with the * NextToken parameter set to the value of the last NextToken value until a response has * no NextToken value. *

*

* When using this operation, keep the following in mind: *

*
    *
  • *

    * The operation might return fewer than the MaxResults value of snapshot descriptions while still * including a NextToken value. *

    *
  • *
  • *

    * The order of snapshots returned in the response of one DescribeSnapshots call and the order of * backups returned across the responses of a multi-call iteration is unspecified. *

    *
  • *
*
*

* This is a variant of * {@link #describeSnapshots(software.amazon.awssdk.services.fsx.model.DescribeSnapshotsRequest)} operation. The * return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.fsx.paginators.DescribeSnapshotsPublisher publisher = client.describeSnapshotsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.fsx.paginators.DescribeSnapshotsPublisher publisher = client.describeSnapshotsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.fsx.model.DescribeSnapshotsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of MaxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #describeSnapshots(software.amazon.awssdk.services.fsx.model.DescribeSnapshotsRequest)} operation. *

* * @param describeSnapshotsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SnapshotNotFoundException No Amazon FSx snapshots were found based on the supplied parameters.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DescribeSnapshots * @see AWS API * Documentation */ public DescribeSnapshotsPublisher describeSnapshotsPaginator(DescribeSnapshotsRequest describeSnapshotsRequest) { return new DescribeSnapshotsPublisher(this, applyPaginatorUserAgent(describeSnapshotsRequest)); } /** *

* Describes one or more Amazon FSx for NetApp ONTAP storage virtual machines (SVMs). *

* * @param describeStorageVirtualMachinesRequest * @return A Java Future containing the result of the DescribeStorageVirtualMachines operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • StorageVirtualMachineNotFoundException No FSx for ONTAP SVMs were found based upon the supplied * parameters.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DescribeStorageVirtualMachines * @see AWS API Documentation */ @Override public CompletableFuture describeStorageVirtualMachines( DescribeStorageVirtualMachinesRequest describeStorageVirtualMachinesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeStorageVirtualMachinesRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeStorageVirtualMachines"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeStorageVirtualMachinesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeStorageVirtualMachines") .withMarshaller(new DescribeStorageVirtualMachinesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeStorageVirtualMachinesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes one or more Amazon FSx for NetApp ONTAP storage virtual machines (SVMs). *

*
*

* This is a variant of * {@link #describeStorageVirtualMachines(software.amazon.awssdk.services.fsx.model.DescribeStorageVirtualMachinesRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.fsx.paginators.DescribeStorageVirtualMachinesPublisher publisher = client.describeStorageVirtualMachinesPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.fsx.paginators.DescribeStorageVirtualMachinesPublisher publisher = client.describeStorageVirtualMachinesPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.fsx.model.DescribeStorageVirtualMachinesResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of MaxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #describeStorageVirtualMachines(software.amazon.awssdk.services.fsx.model.DescribeStorageVirtualMachinesRequest)} * operation. *

* * @param describeStorageVirtualMachinesRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • StorageVirtualMachineNotFoundException No FSx for ONTAP SVMs were found based upon the supplied * parameters.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DescribeStorageVirtualMachines * @see AWS API Documentation */ public DescribeStorageVirtualMachinesPublisher describeStorageVirtualMachinesPaginator( DescribeStorageVirtualMachinesRequest describeStorageVirtualMachinesRequest) { return new DescribeStorageVirtualMachinesPublisher(this, applyPaginatorUserAgent(describeStorageVirtualMachinesRequest)); } /** *

* Describes one or more Amazon FSx for NetApp ONTAP or Amazon FSx for OpenZFS volumes. *

* * @param describeVolumesRequest * @return A Java Future containing the result of the DescribeVolumes operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • VolumeNotFoundException No Amazon FSx volumes were found based upon the supplied parameters.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DescribeVolumes * @see AWS API * Documentation */ @Override public CompletableFuture describeVolumes(DescribeVolumesRequest describeVolumesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeVolumesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeVolumes"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeVolumesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeVolumes") .withMarshaller(new DescribeVolumesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeVolumesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes one or more Amazon FSx for NetApp ONTAP or Amazon FSx for OpenZFS volumes. *

*
*

* This is a variant of {@link #describeVolumes(software.amazon.awssdk.services.fsx.model.DescribeVolumesRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.fsx.paginators.DescribeVolumesPublisher publisher = client.describeVolumesPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.fsx.paginators.DescribeVolumesPublisher publisher = client.describeVolumesPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.fsx.model.DescribeVolumesResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of MaxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #describeVolumes(software.amazon.awssdk.services.fsx.model.DescribeVolumesRequest)} operation. *

* * @param describeVolumesRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • VolumeNotFoundException No Amazon FSx volumes were found based upon the supplied parameters.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DescribeVolumes * @see AWS API * Documentation */ public DescribeVolumesPublisher describeVolumesPaginator(DescribeVolumesRequest describeVolumesRequest) { return new DescribeVolumesPublisher(this, applyPaginatorUserAgent(describeVolumesRequest)); } /** *

* Use this action to disassociate, or remove, one or more Domain Name Service (DNS) aliases from an Amazon FSx for * Windows File Server file system. If you attempt to disassociate a DNS alias that is not associated with the file * system, Amazon FSx responds with a 400 Bad Request. For more information, see Working with DNS * Aliases. *

*

* The system generated response showing the DNS aliases that Amazon FSx is attempting to disassociate from the file * system. Use the API operation to monitor the status of the aliases Amazon FSx is disassociating with the file * system. *

* * @param disassociateFileSystemAliasesRequest * The request object of DNS aliases to disassociate from an Amazon FSx for Windows File Server file system. * @return A Java Future containing the result of the DisassociateFileSystemAliases operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.DisassociateFileSystemAliases * @see AWS API Documentation */ @Override public CompletableFuture disassociateFileSystemAliases( DisassociateFileSystemAliasesRequest disassociateFileSystemAliasesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateFileSystemAliasesRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateFileSystemAliases"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DisassociateFileSystemAliasesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DisassociateFileSystemAliases") .withMarshaller(new DisassociateFileSystemAliasesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(disassociateFileSystemAliasesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists tags for Amazon FSx resources. *

*

* When retrieving all tags, you can optionally specify the MaxResults parameter to limit the number of * tags in a response. If more tags remain, Amazon FSx returns a NextToken value in the response. In * this case, send a later request with the NextToken request parameter set to the value of * NextToken from the last response. *

*

* This action is used in an iterative process to retrieve a list of your tags. ListTagsForResource is * called first without a NextTokenvalue. Then the action continues to be called with the * NextToken parameter set to the value of the last NextToken value until a response has * no NextToken. *

*

* When using this action, keep the following in mind: *

*
    *
  • *

    * The implementation might return fewer than MaxResults file system descriptions while still including * a NextToken value. *

    *
  • *
  • *

    * The order of tags returned in the response of one ListTagsForResource call and the order of tags * returned across the responses of a multi-call iteration is unspecified. *

    *
  • *
* * @param listTagsForResourceRequest * The request object for ListTagsForResource operation. * @return A Java Future containing the result of the ListTagsForResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • ResourceNotFoundException The resource specified by the Amazon Resource Name (ARN) can't be found.
  • *
  • NotServiceResourceErrorException The resource specified for the tagging operation is not a resource * type owned by Amazon FSx. Use the API of the relevant service to perform the operation.
  • *
  • ResourceDoesNotSupportTaggingException The resource specified does not support tagging.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.ListTagsForResource * @see AWS API * Documentation */ @Override public CompletableFuture listTagsForResource( ListTagsForResourceRequest listTagsForResourceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListTagsForResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListTagsForResource") .withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listTagsForResourceRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists tags for Amazon FSx resources. *

*

* When retrieving all tags, you can optionally specify the MaxResults parameter to limit the number of * tags in a response. If more tags remain, Amazon FSx returns a NextToken value in the response. In * this case, send a later request with the NextToken request parameter set to the value of * NextToken from the last response. *

*

* This action is used in an iterative process to retrieve a list of your tags. ListTagsForResource is * called first without a NextTokenvalue. Then the action continues to be called with the * NextToken parameter set to the value of the last NextToken value until a response has * no NextToken. *

*

* When using this action, keep the following in mind: *

*
    *
  • *

    * The implementation might return fewer than MaxResults file system descriptions while still including * a NextToken value. *

    *
  • *
  • *

    * The order of tags returned in the response of one ListTagsForResource call and the order of tags * returned across the responses of a multi-call iteration is unspecified. *

    *
  • *
*
*

* This is a variant of * {@link #listTagsForResource(software.amazon.awssdk.services.fsx.model.ListTagsForResourceRequest)} operation. The * return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.fsx.paginators.ListTagsForResourcePublisher publisher = client.listTagsForResourcePaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.fsx.paginators.ListTagsForResourcePublisher publisher = client.listTagsForResourcePaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.fsx.model.ListTagsForResourceResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of MaxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listTagsForResource(software.amazon.awssdk.services.fsx.model.ListTagsForResourceRequest)} operation. *

* * @param listTagsForResourceRequest * The request object for ListTagsForResource operation. * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • ResourceNotFoundException The resource specified by the Amazon Resource Name (ARN) can't be found.
  • *
  • NotServiceResourceErrorException The resource specified for the tagging operation is not a resource * type owned by Amazon FSx. Use the API of the relevant service to perform the operation.
  • *
  • ResourceDoesNotSupportTaggingException The resource specified does not support tagging.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.ListTagsForResource * @see AWS API * Documentation */ public ListTagsForResourcePublisher listTagsForResourcePaginator(ListTagsForResourceRequest listTagsForResourceRequest) { return new ListTagsForResourcePublisher(this, applyPaginatorUserAgent(listTagsForResourceRequest)); } /** *

* Releases the file system lock from an Amazon FSx for OpenZFS file system. *

* * @param releaseFileSystemNfsV3LocksRequest * @return A Java Future containing the result of the ReleaseFileSystemNfsV3Locks operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • ServiceLimitExceededException An error indicating that a particular service limit was exceeded. You * can increase some service limits by contacting Amazon Web Services Support.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.ReleaseFileSystemNfsV3Locks * @see AWS API Documentation */ @Override public CompletableFuture releaseFileSystemNfsV3Locks( ReleaseFileSystemNfsV3LocksRequest releaseFileSystemNfsV3LocksRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, releaseFileSystemNfsV3LocksRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ReleaseFileSystemNfsV3Locks"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ReleaseFileSystemNfsV3LocksResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ReleaseFileSystemNfsV3Locks") .withMarshaller(new ReleaseFileSystemNfsV3LocksRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(releaseFileSystemNfsV3LocksRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns an Amazon FSx for OpenZFS volume to the state saved by the specified snapshot. *

* * @param restoreVolumeFromSnapshotRequest * @return A Java Future containing the result of the RestoreVolumeFromSnapshot operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • VolumeNotFoundException No Amazon FSx volumes were found based upon the supplied parameters.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.RestoreVolumeFromSnapshot * @see AWS * API Documentation */ @Override public CompletableFuture restoreVolumeFromSnapshot( RestoreVolumeFromSnapshotRequest restoreVolumeFromSnapshotRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, restoreVolumeFromSnapshotRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RestoreVolumeFromSnapshot"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RestoreVolumeFromSnapshotResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RestoreVolumeFromSnapshot") .withMarshaller(new RestoreVolumeFromSnapshotRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(restoreVolumeFromSnapshotRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Tags an Amazon FSx resource. *

* * @param tagResourceRequest * The request object for the TagResource operation. * @return A Java Future containing the result of the TagResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • ResourceNotFoundException The resource specified by the Amazon Resource Name (ARN) can't be found.
  • *
  • NotServiceResourceErrorException The resource specified for the tagging operation is not a resource * type owned by Amazon FSx. Use the API of the relevant service to perform the operation.
  • *
  • ResourceDoesNotSupportTaggingException The resource specified does not support tagging.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.TagResource * @see AWS API * Documentation */ @Override public CompletableFuture tagResource(TagResourceRequest tagResourceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, TagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("TagResource").withMarshaller(new TagResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(tagResourceRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* This action removes a tag from an Amazon FSx resource. *

* * @param untagResourceRequest * The request object for UntagResource action. * @return A Java Future containing the result of the UntagResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • ResourceNotFoundException The resource specified by the Amazon Resource Name (ARN) can't be found.
  • *
  • NotServiceResourceErrorException The resource specified for the tagging operation is not a resource * type owned by Amazon FSx. Use the API of the relevant service to perform the operation.
  • *
  • ResourceDoesNotSupportTaggingException The resource specified does not support tagging.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.UntagResource * @see AWS API * Documentation */ @Override public CompletableFuture untagResource(UntagResourceRequest untagResourceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UntagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UntagResource") .withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(untagResourceRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the configuration of an existing data repository association on an Amazon FSx for Lustre file system. * Data repository associations are supported for all file systems except for Scratch_1 deployment * type. *

* * @param updateDataRepositoryAssociationRequest * @return A Java Future containing the result of the UpdateDataRepositoryAssociation operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • DataRepositoryAssociationNotFoundException No data repository associations were found based upon the * supplied parameters.
  • *
  • ServiceLimitExceededException An error indicating that a particular service limit was exceeded. You * can increase some service limits by contacting Amazon Web Services Support.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.UpdateDataRepositoryAssociation * @see AWS API Documentation */ @Override public CompletableFuture updateDataRepositoryAssociation( UpdateDataRepositoryAssociationRequest updateDataRepositoryAssociationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateDataRepositoryAssociationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateDataRepositoryAssociation"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateDataRepositoryAssociationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateDataRepositoryAssociation") .withMarshaller(new UpdateDataRepositoryAssociationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateDataRepositoryAssociationRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the configuration of an existing Amazon File Cache resource. You can update multiple properties in a * single request. *

* * @param updateFileCacheRequest * @return A Java Future containing the result of the UpdateFileCache operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • UnsupportedOperationException The requested operation is not supported for this resource or API.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • FileCacheNotFoundException No caches were found based upon supplied parameters.
  • *
  • MissingFileCacheConfigurationException A cache configuration is required for this operation.
  • *
  • ServiceLimitExceededException An error indicating that a particular service limit was exceeded. You * can increase some service limits by contacting Amazon Web Services Support.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.UpdateFileCache * @see AWS API * Documentation */ @Override public CompletableFuture updateFileCache(UpdateFileCacheRequest updateFileCacheRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateFileCacheRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateFileCache"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateFileCacheResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateFileCache") .withMarshaller(new UpdateFileCacheRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateFileCacheRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Use this operation to update the configuration of an existing Amazon FSx file system. You can update multiple * properties in a single request. *

*

* For FSx for Windows File Server file systems, you can update the following properties: *

*
    *
  • *

    * AuditLogConfiguration *

    *
  • *
  • *

    * AutomaticBackupRetentionDays *

    *
  • *
  • *

    * DailyAutomaticBackupStartTime *

    *
  • *
  • *

    * SelfManagedActiveDirectoryConfiguration *

    *
  • *
  • *

    * StorageCapacity *

    *
  • *
  • *

    * ThroughputCapacity *

    *
  • *
  • *

    * WeeklyMaintenanceStartTime *

    *
  • *
*

* For FSx for Lustre file systems, you can update the following properties: *

*
    *
  • *

    * AutoImportPolicy *

    *
  • *
  • *

    * AutomaticBackupRetentionDays *

    *
  • *
  • *

    * DailyAutomaticBackupStartTime *

    *
  • *
  • *

    * DataCompressionType *

    *
  • *
  • *

    * LustreRootSquashConfiguration *

    *
  • *
  • *

    * StorageCapacity *

    *
  • *
  • *

    * WeeklyMaintenanceStartTime *

    *
  • *
*

* For FSx for ONTAP file systems, you can update the following properties: *

*
    *
  • *

    * AddRouteTableIds *

    *
  • *
  • *

    * AutomaticBackupRetentionDays *

    *
  • *
  • *

    * DailyAutomaticBackupStartTime *

    *
  • *
  • *

    * DiskIopsConfiguration *

    *
  • *
  • *

    * FsxAdminPassword *

    *
  • *
  • *

    * RemoveRouteTableIds *

    *
  • *
  • *

    * StorageCapacity *

    *
  • *
  • *

    * ThroughputCapacity *

    *
  • *
  • *

    * WeeklyMaintenanceStartTime *

    *
  • *
*

* For FSx for OpenZFS file systems, you can update the following properties: *

*
    *
  • *

    * AutomaticBackupRetentionDays *

    *
  • *
  • *

    * CopyTagsToBackups *

    *
  • *
  • *

    * CopyTagsToVolumes *

    *
  • *
  • *

    * DailyAutomaticBackupStartTime *

    *
  • *
  • *

    * DiskIopsConfiguration *

    *
  • *
  • *

    * StorageCapacity *

    *
  • *
  • *

    * ThroughputCapacity *

    *
  • *
  • *

    * WeeklyMaintenanceStartTime *

    *
  • *
* * @param updateFileSystemRequest * The request object for the UpdateFileSystem operation. * @return A Java Future containing the result of the UpdateFileSystem operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • UnsupportedOperationException The requested operation is not supported for this resource or API.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • InvalidNetworkSettingsException One or more network settings specified in the request are invalid.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • FileSystemNotFoundException No Amazon FSx file systems were found based upon supplied parameters.
  • *
  • MissingFileSystemConfigurationException A file system configuration is required for this operation.
  • *
  • ServiceLimitExceededException An error indicating that a particular service limit was exceeded. You * can increase some service limits by contacting Amazon Web Services Support.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.UpdateFileSystem * @see AWS API * Documentation */ @Override public CompletableFuture updateFileSystem(UpdateFileSystemRequest updateFileSystemRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateFileSystemRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateFileSystem"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateFileSystemResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateFileSystem") .withMarshaller(new UpdateFileSystemRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateFileSystemRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the name of an Amazon FSx for OpenZFS snapshot. *

* * @param updateSnapshotRequest * @return A Java Future containing the result of the UpdateSnapshot operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • SnapshotNotFoundException No Amazon FSx snapshots were found based on the supplied parameters.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.UpdateSnapshot * @see AWS API * Documentation */ @Override public CompletableFuture updateSnapshot(UpdateSnapshotRequest updateSnapshotRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateSnapshotRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateSnapshot"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateSnapshotResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateSnapshot") .withMarshaller(new UpdateSnapshotRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateSnapshotRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates an Amazon FSx for ONTAP storage virtual machine (SVM). *

* * @param updateStorageVirtualMachineRequest * @return A Java Future containing the result of the UpdateStorageVirtualMachine operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • StorageVirtualMachineNotFoundException No FSx for ONTAP SVMs were found based upon the supplied * parameters.
  • *
  • UnsupportedOperationException The requested operation is not supported for this resource or API.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.UpdateStorageVirtualMachine * @see AWS API Documentation */ @Override public CompletableFuture updateStorageVirtualMachine( UpdateStorageVirtualMachineRequest updateStorageVirtualMachineRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateStorageVirtualMachineRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateStorageVirtualMachine"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateStorageVirtualMachineResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateStorageVirtualMachine") .withMarshaller(new UpdateStorageVirtualMachineRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateStorageVirtualMachineRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the configuration of an Amazon FSx for NetApp ONTAP or Amazon FSx for OpenZFS volume. *

* * @param updateVolumeRequest * @return A Java Future containing the result of the UpdateVolume operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException A generic error indicating a failure with a client request.
  • *
  • IncompatibleParameterErrorException The error returned when a second request is received with the * same client request token but different parameters settings. A client request token should always * uniquely identify a single request.
  • *
  • InternalServerErrorException A generic error indicating a server-side failure.
  • *
  • MissingVolumeConfigurationException A volume configuration is required for this operation.
  • *
  • VolumeNotFoundException No Amazon FSx volumes were found based upon the supplied parameters.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • FSxException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample FSxAsyncClient.UpdateVolume * @see AWS API * Documentation */ @Override public CompletableFuture updateVolume(UpdateVolumeRequest updateVolumeRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateVolumeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FSx"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateVolume"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateVolumeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateVolume").withMarshaller(new UpdateVolumeRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateVolumeRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } @Override public final FSxServiceClientConfiguration serviceClientConfiguration() { return this.serviceClientConfiguration; } @Override public final String serviceName() { return SERVICE_NAME; } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(FSxException::builder) .protocol(AwsJsonProtocol.AWS_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidImportPath") .exceptionBuilderSupplier(InvalidImportPathException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidNetworkSettings") .exceptionBuilderSupplier(InvalidNetworkSettingsException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("FileSystemNotFound") .exceptionBuilderSupplier(FileSystemNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("DataRepositoryAssociationNotFound") .exceptionBuilderSupplier(DataRepositoryAssociationNotFoundException::builder) .httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceDoesNotSupportTagging") .exceptionBuilderSupplier(ResourceDoesNotSupportTaggingException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("DataRepositoryTaskNotFound") .exceptionBuilderSupplier(DataRepositoryTaskNotFoundException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("SourceBackupUnavailable") .exceptionBuilderSupplier(SourceBackupUnavailableException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceNotFound") .exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UnsupportedOperation") .exceptionBuilderSupplier(UnsupportedOperationException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("StorageVirtualMachineNotFound") .exceptionBuilderSupplier(StorageVirtualMachineNotFoundException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("BackupRestoring") .exceptionBuilderSupplier(BackupRestoringException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("BackupInProgress") .exceptionBuilderSupplier(BackupInProgressException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidExportPath") .exceptionBuilderSupplier(InvalidExportPathException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidRegion") .exceptionBuilderSupplier(InvalidRegionException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("MissingVolumeConfiguration") .exceptionBuilderSupplier(MissingVolumeConfigurationException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidSourceKmsKey") .exceptionBuilderSupplier(InvalidSourceKmsKeyException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("DataRepositoryTaskExecuting") .exceptionBuilderSupplier(DataRepositoryTaskExecutingException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("IncompatibleRegionForMultiAZ") .exceptionBuilderSupplier(IncompatibleRegionForMultiAzException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("MissingFileCacheConfiguration") .exceptionBuilderSupplier(MissingFileCacheConfigurationException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("BackupNotFound") .exceptionBuilderSupplier(BackupNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("FileCacheNotFound") .exceptionBuilderSupplier(FileCacheNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidDestinationKmsKey") .exceptionBuilderSupplier(InvalidDestinationKmsKeyException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("VolumeNotFound") .exceptionBuilderSupplier(VolumeNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ServiceLimitExceeded") .exceptionBuilderSupplier(ServiceLimitExceededException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("NotServiceResourceError") .exceptionBuilderSupplier(NotServiceResourceErrorException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("MissingFileSystemConfiguration") .exceptionBuilderSupplier(MissingFileSystemConfigurationException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("BackupBeingCopied") .exceptionBuilderSupplier(BackupBeingCopiedException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("IncompatibleParameterError") .exceptionBuilderSupplier(IncompatibleParameterErrorException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("DataRepositoryTaskEnded") .exceptionBuilderSupplier(DataRepositoryTaskEndedException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidDataRepositoryType") .exceptionBuilderSupplier(InvalidDataRepositoryTypeException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("SnapshotNotFound") .exceptionBuilderSupplier(SnapshotNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidPerUnitStorageThroughput") .exceptionBuilderSupplier(InvalidPerUnitStorageThroughputException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ActiveDirectoryError") .exceptionBuilderSupplier(ActiveDirectoryErrorException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("BadRequest") .exceptionBuilderSupplier(BadRequestException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InternalServerError") .exceptionBuilderSupplier(InternalServerErrorException::builder).httpStatusCode(500).build()); } private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration, RequestOverrideConfiguration requestOverrideConfiguration) { List publishers = null; if (requestOverrideConfiguration != null) { publishers = requestOverrideConfiguration.metricPublishers(); } if (publishers == null || publishers.isEmpty()) { publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS); } if (publishers == null) { publishers = Collections.emptyList(); } return publishers; } private T applyPaginatorUserAgent(T request) { Consumer userAgentApplier = b -> b.addApiName(ApiName.builder() .version(VersionInfo.SDK_VERSION).name("PAGINATED").build()); AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration() .map(c -> c.toBuilder().applyMutation(userAgentApplier).build()) .orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build())); return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build(); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } @Override public void close() { clientHandler.close(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy