/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace Aws
{
namespace Http
{
class HttpClient;
class HttpClientFactory;
} // namespace Http
namespace Utils
{
template< typename R, typename E> class Outcome;
namespace Threading
{
class Executor;
} // namespace Threading
} // namespace Utils
namespace Auth
{
class AWSCredentials;
class AWSCredentialsProvider;
} // namespace Auth
namespace Client
{
class RetryStrategy;
} // namespace Client
namespace EBS
{
namespace Model
{
class CompleteSnapshotRequest;
class GetSnapshotBlockRequest;
class ListChangedBlocksRequest;
class ListSnapshotBlocksRequest;
class PutSnapshotBlockRequest;
class StartSnapshotRequest;
typedef Aws::Utils::Outcome CompleteSnapshotOutcome;
typedef Aws::Utils::Outcome GetSnapshotBlockOutcome;
typedef Aws::Utils::Outcome ListChangedBlocksOutcome;
typedef Aws::Utils::Outcome ListSnapshotBlocksOutcome;
typedef Aws::Utils::Outcome PutSnapshotBlockOutcome;
typedef Aws::Utils::Outcome StartSnapshotOutcome;
typedef std::future CompleteSnapshotOutcomeCallable;
typedef std::future GetSnapshotBlockOutcomeCallable;
typedef std::future ListChangedBlocksOutcomeCallable;
typedef std::future ListSnapshotBlocksOutcomeCallable;
typedef std::future PutSnapshotBlockOutcomeCallable;
typedef std::future StartSnapshotOutcomeCallable;
} // namespace Model
class EBSClient;
typedef std::function&) > CompleteSnapshotResponseReceivedHandler;
typedef std::function&) > GetSnapshotBlockResponseReceivedHandler;
typedef std::function&) > ListChangedBlocksResponseReceivedHandler;
typedef std::function&) > ListSnapshotBlocksResponseReceivedHandler;
typedef std::function&) > PutSnapshotBlockResponseReceivedHandler;
typedef std::function&) > StartSnapshotResponseReceivedHandler;
/**
* You can use the Amazon Elastic Block Store (EBS) direct APIs to directly read
* the data on your EBS snapshots, and identify the difference between two
* snapshots. You can view the details of blocks in an EBS snapshot, compare the
* block difference between two snapshots, and directly access the data in a
* snapshot. If you're an independent software vendor (ISV) who offers backup
* services for EBS, the EBS direct APIs make it easier and more cost-effective to
* track incremental changes on your EBS volumes via EBS snapshots. This can be
* done without having to create new volumes from EBS snapshots.
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 EBS Snapshot in the Amazon Elastic Compute Cloud User
* Guide. For more information about the supported AWS Regions, endpoints, and
* service quotas for the EBS direct APIs, see Amazon
* Elastic Block Store Endpoints and Quotas in the AWS General
* Reference.
*/
class AWS_EBS_API EBSClient : public Aws::Client::AWSJsonClient
{
public:
typedef Aws::Client::AWSJsonClient BASECLASS;
/**
* Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
EBSClient(const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
/**
* Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
EBSClient(const Aws::Auth::AWSCredentials& credentials, const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
/**
* Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
* the default http client factory will be used
*/
EBSClient(const std::shared_ptr& credentialsProvider,
const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
virtual ~EBSClient();
/**
* 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.
See Also:
AWS
* API Reference
*/
virtual Model::CompleteSnapshotOutcome CompleteSnapshot(const Model::CompleteSnapshotRequest& request) const;
/**
* 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.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::CompleteSnapshotOutcomeCallable CompleteSnapshotCallable(const Model::CompleteSnapshotRequest& request) const;
/**
* 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.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void CompleteSnapshotAsync(const Model::CompleteSnapshotRequest& request, const CompleteSnapshotResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
/**
* Returns the data in a block in an Amazon Elastic Block Store
* snapshot.
See Also:
AWS
* API Reference
*/
virtual Model::GetSnapshotBlockOutcome GetSnapshotBlock(const Model::GetSnapshotBlockRequest& request) const;
/**
* Returns the data in a block in an Amazon Elastic Block Store
* snapshot.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::GetSnapshotBlockOutcomeCallable GetSnapshotBlockCallable(const Model::GetSnapshotBlockRequest& request) const;
/**
* Returns the data in a block in an Amazon Elastic Block Store
* snapshot.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void GetSnapshotBlockAsync(const Model::GetSnapshotBlockRequest& request, const GetSnapshotBlockResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
/**
* Returns the block indexes and block tokens for blocks that are different
* between two Amazon Elastic Block Store snapshots of the same volume/snapshot
* lineage.
See Also:
AWS
* API Reference
*/
virtual Model::ListChangedBlocksOutcome ListChangedBlocks(const Model::ListChangedBlocksRequest& request) const;
/**
* Returns the block indexes and block tokens for blocks that are different
* between two Amazon Elastic Block Store snapshots of the same volume/snapshot
* lineage.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::ListChangedBlocksOutcomeCallable ListChangedBlocksCallable(const Model::ListChangedBlocksRequest& request) const;
/**
* Returns the block indexes and block tokens for blocks that are different
* between two Amazon Elastic Block Store snapshots of the same volume/snapshot
* lineage.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void ListChangedBlocksAsync(const Model::ListChangedBlocksRequest& request, const ListChangedBlocksResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
/**
* Returns the block indexes and block tokens for blocks in an Amazon Elastic
* Block Store snapshot.
See Also:
AWS
* API Reference
*/
virtual Model::ListSnapshotBlocksOutcome ListSnapshotBlocks(const Model::ListSnapshotBlocksRequest& request) const;
/**
* Returns the block indexes and block tokens for blocks in an Amazon Elastic
* Block Store snapshot.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::ListSnapshotBlocksOutcomeCallable ListSnapshotBlocksCallable(const Model::ListSnapshotBlocksRequest& request) const;
/**
* Returns the block indexes and block tokens for blocks in an Amazon Elastic
* Block Store snapshot.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void ListSnapshotBlocksAsync(const Model::ListSnapshotBlocksRequest& request, const ListSnapshotBlocksResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
/**
* Writes a block of data to a block in the 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-byte sectors.
See Also:
AWS
* API Reference
*/
virtual Model::PutSnapshotBlockOutcome PutSnapshotBlock(const Model::PutSnapshotBlockRequest& request) const;
/**
* Writes a block of data to a block in the 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-byte sectors.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::PutSnapshotBlockOutcomeCallable PutSnapshotBlockCallable(const Model::PutSnapshotBlockRequest& request) const;
/**
* Writes a block of data to a block in the 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-byte sectors.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void PutSnapshotBlockAsync(const Model::PutSnapshotBlockRequest& request, const PutSnapshotBlockResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
/**
* 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.
See
* Also:
AWS
* API Reference
*/
virtual Model::StartSnapshotOutcome StartSnapshot(const Model::StartSnapshotRequest& request) const;
/**
* 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.
See
* Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::StartSnapshotOutcomeCallable StartSnapshotCallable(const Model::StartSnapshotRequest& request) const;
/**
* 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.
See
* Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void StartSnapshotAsync(const Model::StartSnapshotRequest& request, const StartSnapshotResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
void OverrideEndpoint(const Aws::String& endpoint);
private:
void init(const Aws::Client::ClientConfiguration& clientConfiguration);
void CompleteSnapshotAsyncHelper(const Model::CompleteSnapshotRequest& request, const CompleteSnapshotResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void GetSnapshotBlockAsyncHelper(const Model::GetSnapshotBlockRequest& request, const GetSnapshotBlockResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void ListChangedBlocksAsyncHelper(const Model::ListChangedBlocksRequest& request, const ListChangedBlocksResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void ListSnapshotBlocksAsyncHelper(const Model::ListSnapshotBlocksRequest& request, const ListSnapshotBlocksResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void PutSnapshotBlockAsyncHelper(const Model::PutSnapshotBlockRequest& request, const PutSnapshotBlockResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void StartSnapshotAsyncHelper(const Model::StartSnapshotRequest& request, const StartSnapshotResponseReceivedHandler& handler, const std::shared_ptr& context) const;
Aws::String m_uri;
Aws::String m_configScheme;
std::shared_ptr m_executor;
};
} // namespace EBS
} // namespace Aws