/* * 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. */ /* * Do not modify this file. This file is generated from the ebs-2019-11-02.normal.json service model. */ using System; using System.Collections.Generic; using System.Net; using Amazon.EBS.Model; using Amazon.EBS.Model.Internal.MarshallTransformations; using Amazon.EBS.Internal; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Auth; using Amazon.Runtime.Internal.Transform; namespace Amazon.EBS { /// /// Implementation for accessing EBS /// /// You can use the Amazon Elastic Block Store (Amazon EBS) direct APIs to create Amazon /// EBS snapshots, write data directly to your snapshots, read data on your snapshots, /// and identify the differences or changes between two snapshots. If you’re an independent /// software vendor (ISV) who offers backup services for Amazon EBS, the EBS direct APIs /// make it more efficient and cost-effective to track incremental changes on your Amazon /// EBS volumes through snapshots. This can be done without having to create new volumes /// from snapshots, and then use Amazon Elastic Compute Cloud (Amazon EC2) instances to /// compare the differences. /// /// /// /// You can create incremental snapshots directly from data on-premises into volumes and /// the cloud to use for quick disaster recovery. With the ability to write and read snapshots, /// you can write your on-premises data to an snapshot during a disaster. Then after recovery, /// you can restore it back to Amazon Web Services or on-premises from the snapshot. You /// no longer need to build and maintain complex mechanisms to copy data to and from Amazon /// EBS. /// /// /// /// This API reference provides detailed information about the actions, data types, parameters, /// and errors of the EBS direct APIs. For more information about the elements that make /// up the EBS direct APIs, and examples of how to use them effectively, see Accessing /// the Contents of an Amazon EBS Snapshot in the Amazon Elastic Compute Cloud /// User Guide. For more information about the supported Amazon Web Services Regions, /// endpoints, and service quotas for the EBS direct APIs, see Amazon /// Elastic Block Store Endpoints and Quotas in the Amazon Web Services General /// Reference. /// /// public partial class AmazonEBSClient : AmazonServiceClient, IAmazonEBS { private static IServiceMetadata serviceMetadata = new AmazonEBSMetadata(); #if BCL45 || AWS_ASYNC_ENUMERABLES_API private IEBSPaginatorFactory _paginators; /// /// Paginators for the service /// public IEBSPaginatorFactory Paginators { get { if (this._paginators == null) { this._paginators = new EBSPaginatorFactory(this); } return this._paginators; } } #endif #region Constructors /// /// Constructs AmazonEBSClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// /// <?xml version="1.0" encoding="utf-8" ?> /// <configuration> /// <appSettings> /// <add key="AWSProfileName" value="AWS Default"/> /// </appSettings> /// </configuration> /// /// /// public AmazonEBSClient() : base(FallbackCredentialsFactory.GetCredentials(), new AmazonEBSConfig()) { } /// /// Constructs AmazonEBSClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// /// <?xml version="1.0" encoding="utf-8" ?> /// <configuration> /// <appSettings> /// <add key="AWSProfileName" value="AWS Default"/> /// </appSettings> /// </configuration> /// /// /// /// The region to connect. public AmazonEBSClient(RegionEndpoint region) : base(FallbackCredentialsFactory.GetCredentials(), new AmazonEBSConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonEBSClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// /// <?xml version="1.0" encoding="utf-8" ?> /// <configuration> /// <appSettings> /// <add key="AWSProfileName" value="AWS Default"/> /// </appSettings> /// </configuration> /// /// /// /// The AmazonEBSClient Configuration Object public AmazonEBSClient(AmazonEBSConfig config) : base(FallbackCredentialsFactory.GetCredentials(config), config){} /// /// Constructs AmazonEBSClient with AWS Credentials /// /// AWS Credentials public AmazonEBSClient(AWSCredentials credentials) : this(credentials, new AmazonEBSConfig()) { } /// /// Constructs AmazonEBSClient with AWS Credentials /// /// AWS Credentials /// The region to connect. public AmazonEBSClient(AWSCredentials credentials, RegionEndpoint region) : this(credentials, new AmazonEBSConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonEBSClient with AWS Credentials and an /// AmazonEBSClient Configuration object. /// /// AWS Credentials /// The AmazonEBSClient Configuration Object public AmazonEBSClient(AWSCredentials credentials, AmazonEBSConfig clientConfig) : base(credentials, clientConfig) { } /// /// Constructs AmazonEBSClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key public AmazonEBSClient(string awsAccessKeyId, string awsSecretAccessKey) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonEBSConfig()) { } /// /// Constructs AmazonEBSClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// The region to connect. public AmazonEBSClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonEBSConfig() {RegionEndpoint=region}) { } /// /// Constructs AmazonEBSClient with AWS Access Key ID, AWS Secret Key and an /// AmazonEBSClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// The AmazonEBSClient Configuration Object public AmazonEBSClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonEBSConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, clientConfig) { } /// /// Constructs AmazonEBSClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token public AmazonEBSClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonEBSConfig()) { } /// /// Constructs AmazonEBSClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token /// The region to connect. public AmazonEBSClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonEBSConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonEBSClient with AWS Access Key ID, AWS Secret Key and an /// AmazonEBSClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token /// The AmazonEBSClient Configuration Object public AmazonEBSClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonEBSConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig) { } #endregion #region Overrides /// /// Creates the signer for the service. /// protected override AbstractAWSSigner CreateSigner() { return new AWS4Signer(); } /// /// Customize the pipeline /// /// protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline) { pipeline.RemoveHandler(); pipeline.AddHandlerAfter(new AmazonEBSEndpointResolver()); } /// /// Capture metadata for the service. /// protected override IServiceMetadata ServiceMetadata { get { return serviceMetadata; } } #endregion #region Dispose /// /// Disposes the service client. /// protected override void Dispose(bool disposing) { base.Dispose(disposing); } #endregion #region CompleteSnapshot /// /// Seals and completes the snapshot after all of the required blocks of data have been /// written to it. Completing the snapshot changes the status to completed. /// You cannot write new blocks to a snapshot after it has been completed. /// /// /// /// You should always retry requests that receive server (5xx) error responses, /// and ThrottlingException and RequestThrottledException client /// error responses. For more information see Error /// retries in the Amazon Elastic Compute Cloud User Guide. /// /// /// /// Container for the necessary parameters to execute the CompleteSnapshot service method. /// /// The response from the CompleteSnapshot service method, as returned by EBS. /// /// You do not have sufficient access to perform this action. /// /// /// An internal error has occurred. For more information see Error /// retries. /// /// /// The number of API requests has exceeded the maximum allowed API request throttling /// limit for the snapshot. For more information see Error /// retries. /// /// /// The specified resource does not exist. /// /// /// Your current service quotas do not allow you to perform this action. /// /// /// The input fails to satisfy the constraints of the EBS direct APIs. /// /// REST API Reference for CompleteSnapshot Operation public virtual CompleteSnapshotResponse CompleteSnapshot(CompleteSnapshotRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CompleteSnapshotRequestMarshaller.Instance; options.ResponseUnmarshaller = CompleteSnapshotResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Initiates the asynchronous execution of the CompleteSnapshot operation. /// /// /// Container for the necessary parameters to execute the CompleteSnapshot operation on AmazonEBSClient. /// An AsyncCallback delegate that is invoked when the operation completes. /// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property. /// /// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCompleteSnapshot /// operation. /// REST API Reference for CompleteSnapshot Operation public virtual IAsyncResult BeginCompleteSnapshot(CompleteSnapshotRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = CompleteSnapshotRequestMarshaller.Instance; options.ResponseUnmarshaller = CompleteSnapshotResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// /// Finishes the asynchronous execution of the CompleteSnapshot operation. /// /// /// The IAsyncResult returned by the call to BeginCompleteSnapshot. /// /// Returns a CompleteSnapshotResult from EBS. /// REST API Reference for CompleteSnapshot Operation public virtual CompleteSnapshotResponse EndCompleteSnapshot(IAsyncResult asyncResult) { return EndInvoke(asyncResult); } #endregion #region GetSnapshotBlock /// /// Returns the data in a block in an Amazon Elastic Block Store snapshot. /// /// /// /// You should always retry requests that receive server (5xx) error responses, /// and ThrottlingException and RequestThrottledException client /// error responses. For more information see Error /// retries in the Amazon Elastic Compute Cloud User Guide. /// /// /// /// Container for the necessary parameters to execute the GetSnapshotBlock service method. /// /// The response from the GetSnapshotBlock service method, as returned by EBS. /// /// You do not have sufficient access to perform this action. /// /// /// An internal error has occurred. For more information see Error /// retries. /// /// /// The number of API requests has exceeded the maximum allowed API request throttling /// limit for the snapshot. For more information see Error /// retries. /// /// /// The specified resource does not exist. /// /// /// Your current service quotas do not allow you to perform this action. /// /// /// The input fails to satisfy the constraints of the EBS direct APIs. /// /// REST API Reference for GetSnapshotBlock Operation public virtual GetSnapshotBlockResponse GetSnapshotBlock(GetSnapshotBlockRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetSnapshotBlockRequestMarshaller.Instance; options.ResponseUnmarshaller = GetSnapshotBlockResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Initiates the asynchronous execution of the GetSnapshotBlock operation. /// /// /// Container for the necessary parameters to execute the GetSnapshotBlock operation on AmazonEBSClient. /// An AsyncCallback delegate that is invoked when the operation completes. /// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property. /// /// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetSnapshotBlock /// operation. /// REST API Reference for GetSnapshotBlock Operation public virtual IAsyncResult BeginGetSnapshotBlock(GetSnapshotBlockRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = GetSnapshotBlockRequestMarshaller.Instance; options.ResponseUnmarshaller = GetSnapshotBlockResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// /// Finishes the asynchronous execution of the GetSnapshotBlock operation. /// /// /// The IAsyncResult returned by the call to BeginGetSnapshotBlock. /// /// Returns a GetSnapshotBlockResult from EBS. /// REST API Reference for GetSnapshotBlock Operation public virtual GetSnapshotBlockResponse EndGetSnapshotBlock(IAsyncResult asyncResult) { return EndInvoke(asyncResult); } #endregion #region ListChangedBlocks /// /// Returns information about the blocks that are different between two Amazon Elastic /// Block Store snapshots of the same volume/snapshot lineage. /// /// /// /// You should always retry requests that receive server (5xx) error responses, /// and ThrottlingException and RequestThrottledException client /// error responses. For more information see Error /// retries in the Amazon Elastic Compute Cloud User Guide. /// /// /// /// Container for the necessary parameters to execute the ListChangedBlocks service method. /// /// The response from the ListChangedBlocks service method, as returned by EBS. /// /// You do not have sufficient access to perform this action. /// /// /// An internal error has occurred. For more information see Error /// retries. /// /// /// The number of API requests has exceeded the maximum allowed API request throttling /// limit for the snapshot. For more information see Error /// retries. /// /// /// The specified resource does not exist. /// /// /// Your current service quotas do not allow you to perform this action. /// /// /// The input fails to satisfy the constraints of the EBS direct APIs. /// /// REST API Reference for ListChangedBlocks Operation public virtual ListChangedBlocksResponse ListChangedBlocks(ListChangedBlocksRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListChangedBlocksRequestMarshaller.Instance; options.ResponseUnmarshaller = ListChangedBlocksResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Initiates the asynchronous execution of the ListChangedBlocks operation. /// /// /// Container for the necessary parameters to execute the ListChangedBlocks operation on AmazonEBSClient. /// An AsyncCallback delegate that is invoked when the operation completes. /// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property. /// /// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListChangedBlocks /// operation. /// REST API Reference for ListChangedBlocks Operation public virtual IAsyncResult BeginListChangedBlocks(ListChangedBlocksRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = ListChangedBlocksRequestMarshaller.Instance; options.ResponseUnmarshaller = ListChangedBlocksResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// /// Finishes the asynchronous execution of the ListChangedBlocks operation. /// /// /// The IAsyncResult returned by the call to BeginListChangedBlocks. /// /// Returns a ListChangedBlocksResult from EBS. /// REST API Reference for ListChangedBlocks Operation public virtual ListChangedBlocksResponse EndListChangedBlocks(IAsyncResult asyncResult) { return EndInvoke(asyncResult); } #endregion #region ListSnapshotBlocks /// /// Returns information about the blocks in an Amazon Elastic Block Store snapshot. /// /// /// /// You should always retry requests that receive server (5xx) error responses, /// and ThrottlingException and RequestThrottledException client /// error responses. For more information see Error /// retries in the Amazon Elastic Compute Cloud User Guide. /// /// /// /// Container for the necessary parameters to execute the ListSnapshotBlocks service method. /// /// The response from the ListSnapshotBlocks service method, as returned by EBS. /// /// You do not have sufficient access to perform this action. /// /// /// An internal error has occurred. For more information see Error /// retries. /// /// /// The number of API requests has exceeded the maximum allowed API request throttling /// limit for the snapshot. For more information see Error /// retries. /// /// /// The specified resource does not exist. /// /// /// Your current service quotas do not allow you to perform this action. /// /// /// The input fails to satisfy the constraints of the EBS direct APIs. /// /// REST API Reference for ListSnapshotBlocks Operation public virtual ListSnapshotBlocksResponse ListSnapshotBlocks(ListSnapshotBlocksRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListSnapshotBlocksRequestMarshaller.Instance; options.ResponseUnmarshaller = ListSnapshotBlocksResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Initiates the asynchronous execution of the ListSnapshotBlocks operation. /// /// /// Container for the necessary parameters to execute the ListSnapshotBlocks operation on AmazonEBSClient. /// An AsyncCallback delegate that is invoked when the operation completes. /// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property. /// /// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListSnapshotBlocks /// operation. /// REST API Reference for ListSnapshotBlocks Operation public virtual IAsyncResult BeginListSnapshotBlocks(ListSnapshotBlocksRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = ListSnapshotBlocksRequestMarshaller.Instance; options.ResponseUnmarshaller = ListSnapshotBlocksResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// /// Finishes the asynchronous execution of the ListSnapshotBlocks operation. /// /// /// The IAsyncResult returned by the call to BeginListSnapshotBlocks. /// /// Returns a ListSnapshotBlocksResult from EBS. /// REST API Reference for ListSnapshotBlocks Operation public virtual ListSnapshotBlocksResponse EndListSnapshotBlocks(IAsyncResult asyncResult) { return EndInvoke(asyncResult); } #endregion #region PutSnapshotBlock /// /// Writes a block of data to a snapshot. If the specified block contains data, the existing /// data is overwritten. The target snapshot must be in the pending state. /// /// /// /// Data written to a snapshot must be aligned with 512-KiB sectors. /// /// /// /// You should always retry requests that receive server (5xx) error responses, /// and ThrottlingException and RequestThrottledException client /// error responses. For more information see Error /// retries in the Amazon Elastic Compute Cloud User Guide. /// /// /// /// Container for the necessary parameters to execute the PutSnapshotBlock service method. /// /// The response from the PutSnapshotBlock service method, as returned by EBS. /// /// You do not have sufficient access to perform this action. /// /// /// An internal error has occurred. For more information see Error /// retries. /// /// /// The number of API requests has exceeded the maximum allowed API request throttling /// limit for the snapshot. For more information see Error /// retries. /// /// /// The specified resource does not exist. /// /// /// Your current service quotas do not allow you to perform this action. /// /// /// The input fails to satisfy the constraints of the EBS direct APIs. /// /// REST API Reference for PutSnapshotBlock Operation public virtual PutSnapshotBlockResponse PutSnapshotBlock(PutSnapshotBlockRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PutSnapshotBlockRequestMarshaller.Instance; options.ResponseUnmarshaller = PutSnapshotBlockResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Initiates the asynchronous execution of the PutSnapshotBlock operation. /// /// /// Container for the necessary parameters to execute the PutSnapshotBlock operation on AmazonEBSClient. /// An AsyncCallback delegate that is invoked when the operation completes. /// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property. /// /// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndPutSnapshotBlock /// operation. /// REST API Reference for PutSnapshotBlock Operation public virtual IAsyncResult BeginPutSnapshotBlock(PutSnapshotBlockRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = PutSnapshotBlockRequestMarshaller.Instance; options.ResponseUnmarshaller = PutSnapshotBlockResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// /// Finishes the asynchronous execution of the PutSnapshotBlock operation. /// /// /// The IAsyncResult returned by the call to BeginPutSnapshotBlock. /// /// Returns a PutSnapshotBlockResult from EBS. /// REST API Reference for PutSnapshotBlock Operation public virtual PutSnapshotBlockResponse EndPutSnapshotBlock(IAsyncResult asyncResult) { return EndInvoke(asyncResult); } #endregion #region StartSnapshot /// /// Creates a new Amazon EBS snapshot. The new snapshot enters the pending /// state after the request completes. /// /// /// /// After creating the snapshot, use /// PutSnapshotBlock to write blocks of data to the snapshot. /// /// /// /// You should always retry requests that receive server (5xx) error responses, /// and ThrottlingException and RequestThrottledException client /// error responses. For more information see Error /// retries in the Amazon Elastic Compute Cloud User Guide. /// /// /// /// Container for the necessary parameters to execute the StartSnapshot service method. /// /// The response from the StartSnapshot service method, as returned by EBS. /// /// You do not have sufficient access to perform this action. /// /// /// You have reached the limit for concurrent API requests. For more information, see /// Optimizing /// performance of the EBS direct APIs in the Amazon Elastic Compute Cloud User /// Guide. /// /// /// The request uses the same client token as a previous, but non-identical request. /// /// /// An internal error has occurred. For more information see Error /// retries. /// /// /// The number of API requests has exceeded the maximum allowed API request throttling /// limit for the snapshot. For more information see Error /// retries. /// /// /// The specified resource does not exist. /// /// /// Your current service quotas do not allow you to perform this action. /// /// /// The input fails to satisfy the constraints of the EBS direct APIs. /// /// REST API Reference for StartSnapshot Operation public virtual StartSnapshotResponse StartSnapshot(StartSnapshotRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = StartSnapshotRequestMarshaller.Instance; options.ResponseUnmarshaller = StartSnapshotResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Initiates the asynchronous execution of the StartSnapshot operation. /// /// /// Container for the necessary parameters to execute the StartSnapshot operation on AmazonEBSClient. /// An AsyncCallback delegate that is invoked when the operation completes. /// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property. /// /// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStartSnapshot /// operation. /// REST API Reference for StartSnapshot Operation public virtual IAsyncResult BeginStartSnapshot(StartSnapshotRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = StartSnapshotRequestMarshaller.Instance; options.ResponseUnmarshaller = StartSnapshotResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// /// Finishes the asynchronous execution of the StartSnapshot operation. /// /// /// The IAsyncResult returned by the call to BeginStartSnapshot. /// /// Returns a StartSnapshotResult from EBS. /// REST API Reference for StartSnapshot Operation public virtual StartSnapshotResponse EndStartSnapshot(IAsyncResult asyncResult) { return EndInvoke(asyncResult); } #endregion } }