unify blob client options (#989)
* unify blob client options * Unified client options is datalake/files and adapt blob breaking change. Co-authored-by: Tank Tang <kat@microsoft.com>
This commit is contained in:
parent
c9258ee33f
commit
485b526a26
@ -96,7 +96,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
*/
|
||||
static BlobBatchClient CreateFromConnectionString(
|
||||
const std::string& connectionString,
|
||||
const BlobBatchClientOptions& options = BlobBatchClientOptions());
|
||||
const BlobClientOptions& options = BlobClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Initialize a new instance of BlobBatchClient.
|
||||
@ -109,7 +109,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
explicit BlobBatchClient(
|
||||
const std::string& serviceUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const BlobBatchClientOptions& options = BlobBatchClientOptions());
|
||||
const BlobClientOptions& options = BlobClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Initialize a new instance of BlobBatchClient.
|
||||
@ -122,7 +122,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
explicit BlobBatchClient(
|
||||
const std::string& serviceUri,
|
||||
std::shared_ptr<Core::TokenCredential> credential,
|
||||
const BlobBatchClientOptions& options = BlobBatchClientOptions());
|
||||
const BlobClientOptions& options = BlobClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Initialize a new instance of BlobBatchClient.
|
||||
@ -134,7 +134,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
*/
|
||||
explicit BlobBatchClient(
|
||||
const std::string& serviceUri,
|
||||
const BlobBatchClientOptions& options = BlobBatchClientOptions());
|
||||
const BlobClientOptions& options = BlobClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Creates a new BlobBatch to collect sub-operations that can be submitted
|
||||
|
||||
@ -34,7 +34,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
static BlobContainerClient CreateFromConnectionString(
|
||||
const std::string& connectionString,
|
||||
const std::string& containerName,
|
||||
const BlobContainerClientOptions& options = BlobContainerClientOptions());
|
||||
const BlobClientOptions& options = BlobClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Initialize a new instance of BlobContainerClient.
|
||||
@ -50,7 +50,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
explicit BlobContainerClient(
|
||||
const std::string& containerUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const BlobContainerClientOptions& options = BlobContainerClientOptions());
|
||||
const BlobClientOptions& options = BlobClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Initialize a new instance of BlobContainerClient.
|
||||
@ -65,7 +65,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
explicit BlobContainerClient(
|
||||
const std::string& containerUri,
|
||||
std::shared_ptr<Identity::ClientSecretCredential> credential,
|
||||
const BlobContainerClientOptions& options = BlobContainerClientOptions());
|
||||
const BlobClientOptions& options = BlobClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Initialize a new instance of BlobContainerClient.
|
||||
@ -79,7 +79,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
*/
|
||||
explicit BlobContainerClient(
|
||||
const std::string& containerUri,
|
||||
const BlobContainerClientOptions& options = BlobContainerClientOptions());
|
||||
const BlobClientOptions& options = BlobClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Create a new BlobClient object by appending blobName to the end of uri. The
|
||||
@ -313,8 +313,12 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
private:
|
||||
explicit BlobContainerClient(
|
||||
Azure::Core::Http::Url containerUri,
|
||||
std::shared_ptr<Azure::Core::Http::HttpPipeline> pipeline)
|
||||
: m_containerUrl(std::move(containerUri)), m_pipeline(std::move(pipeline))
|
||||
std::shared_ptr<Azure::Core::Http::HttpPipeline> pipeline,
|
||||
Azure::Core::Nullable<EncryptionKey> customerProvidedKey,
|
||||
Azure::Core::Nullable<std::string> encryptionScope)
|
||||
: m_containerUrl(std::move(containerUri)), m_pipeline(std::move(pipeline)),
|
||||
m_customerProvidedKey(std::move(customerProvidedKey)),
|
||||
m_encryptionScope(std::move(encryptionScope))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -86,9 +86,31 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Service client options used to initalize BlobServiceClient.
|
||||
* @brief Wrapper for an encryption key to be used with client provided key server-side
|
||||
* encryption.
|
||||
*/
|
||||
struct BlobServiceClientOptions
|
||||
struct EncryptionKey
|
||||
{
|
||||
/**
|
||||
* @brief Base64 encoded string of the AES256 encryption key.
|
||||
*/
|
||||
std::string Key;
|
||||
|
||||
/**
|
||||
* @brief Base64 encoded string of the AES256 encryption key's SHA256 hash.
|
||||
*/
|
||||
std::string KeyHash;
|
||||
|
||||
/**
|
||||
* @brief The algorithm for Azure Blob Storage to encrypt with.
|
||||
*/
|
||||
Models::EncryptionAlgorithmType Algorithm;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Client options used to initalize all kinds of blob clients.
|
||||
*/
|
||||
struct BlobClientOptions
|
||||
{
|
||||
/**
|
||||
* @brief Transport pipeline policies for authentication, additional HTTP headers, etc., that
|
||||
@ -102,6 +124,16 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
*/
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerRetryPolicies;
|
||||
|
||||
/**
|
||||
* @brief Holds the customer provided key used when making requests.
|
||||
*/
|
||||
Azure::Core::Nullable<EncryptionKey> CustomerProvidedKey;
|
||||
|
||||
/**
|
||||
* @brief Holds the encryption scope used when making requests.
|
||||
*/
|
||||
Azure::Core::Nullable<std::string> EncryptionScope;
|
||||
|
||||
/**
|
||||
* @brief Specify the number of retries and other retry-related options.
|
||||
*/
|
||||
@ -229,66 +261,6 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
Azure::Core::Nullable<int32_t> MaxResults;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Wrapper for an encryption key to be used with client provided key server-side
|
||||
* encryption.
|
||||
*/
|
||||
struct EncryptionKey
|
||||
{
|
||||
/**
|
||||
* @brief Base64 encoded string of the AES256 encryption key.
|
||||
*/
|
||||
std::string Key;
|
||||
|
||||
/**
|
||||
* @brief Base64 encoded string of the AES256 encryption key's SHA256 hash.
|
||||
*/
|
||||
std::string KeyHash;
|
||||
|
||||
/**
|
||||
* @brief The algorithm for Azure Blob Storage to encrypt with.
|
||||
*/
|
||||
Models::EncryptionAlgorithmType Algorithm;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Container client options used to initalize BlobContainerClient.
|
||||
*/
|
||||
struct BlobContainerClientOptions
|
||||
{
|
||||
/**
|
||||
* @brief Transport pipeline policies for authentication, additional HTTP headers, etc., that
|
||||
* are applied to every request.
|
||||
*/
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerOperationPolicies;
|
||||
|
||||
/**
|
||||
* @brief Transport pipeline policies for authentication, additional HTTP headers, etc., that
|
||||
* are applied to every retrial.
|
||||
*/
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerRetryPolicies;
|
||||
|
||||
/**
|
||||
* @brief Holds the customer provided key used when making requests.
|
||||
*/
|
||||
Azure::Core::Nullable<EncryptionKey> CustomerProvidedKey;
|
||||
|
||||
/**
|
||||
* @brief Holds the encryption scope used when making requests.
|
||||
*/
|
||||
Azure::Core::Nullable<std::string> EncryptionScope;
|
||||
|
||||
/**
|
||||
* @brief Specify the number of retries and other retry-related options.
|
||||
*/
|
||||
StorageRetryWithSecondaryOptions RetryOptions;
|
||||
|
||||
/**
|
||||
* @brief Customized HTTP client. We're going to use the default one if this is empty.
|
||||
*/
|
||||
Azure::Core::Http::TransportPolicyOptions TransportPolicyOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Optional parameters for BlobContainerClient::Create.
|
||||
*/
|
||||
@ -526,44 +498,6 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
Azure::Core::Nullable<int32_t> BreakPeriod;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Blob client options used to initalize BlobClient.
|
||||
*/
|
||||
struct BlobClientOptions
|
||||
{
|
||||
/**
|
||||
* @brief Transport pipeline policies for authentication, additional HTTP headers, etc., that
|
||||
* are applied to every request.
|
||||
*/
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerOperationPolicies;
|
||||
|
||||
/**
|
||||
* @brief Transport pipeline policies for authentication, additional HTTP headers, etc., that
|
||||
* are applied to every retrial.
|
||||
*/
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerRetryPolicies;
|
||||
|
||||
/**
|
||||
* @brief Holds the customer provided key used when making requests.
|
||||
*/
|
||||
Azure::Core::Nullable<EncryptionKey> CustomerProvidedKey;
|
||||
|
||||
/**
|
||||
* @brief Holds the encryption scope used when making requests.
|
||||
*/
|
||||
Azure::Core::Nullable<std::string> EncryptionScope;
|
||||
|
||||
/**
|
||||
* @brief Specify the number of retries and other retry-related options.
|
||||
*/
|
||||
StorageRetryWithSecondaryOptions RetryOptions;
|
||||
|
||||
/**
|
||||
* @brief Customized HTTP client. We're going to use the default one if this is empty.
|
||||
*/
|
||||
Azure::Core::Http::TransportPolicyOptions TransportPolicyOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Optional parameters for BlobClient::GetProperties.
|
||||
*/
|
||||
@ -1429,34 +1363,6 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
BlobAccessConditions AccessConditions;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Batch client options used to initalize BlobBatchClient.
|
||||
*/
|
||||
struct BlobBatchClientOptions
|
||||
{
|
||||
/**
|
||||
* @brief Transport pipeline policies for authentication, additional HTTP headers, etc., that
|
||||
* are applied to every request.
|
||||
*/
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerOperationPolicies;
|
||||
|
||||
/**
|
||||
* @brief Transport pipeline policies for authentication, additional HTTP headers, etc., that
|
||||
* are applied to every retrial.
|
||||
*/
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerRetryPolicies;
|
||||
|
||||
/**
|
||||
* @brief Specify the number of retries and other retry-related options.
|
||||
*/
|
||||
StorageRetryWithSecondaryOptions RetryOptions;
|
||||
|
||||
/**
|
||||
* @brief Customized HTTP client. We're going to use the default one if this is empty.
|
||||
*/
|
||||
Azure::Core::Http::TransportPolicyOptions TransportPolicyOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Optional parameters for BlobBatchClient::SubmitBatch.
|
||||
*/
|
||||
|
||||
@ -31,7 +31,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
*/
|
||||
static BlobServiceClient CreateFromConnectionString(
|
||||
const std::string& connectionString,
|
||||
const BlobServiceClientOptions& options = BlobServiceClientOptions());
|
||||
const BlobClientOptions& options = BlobClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Initialize a new instance of BlobServiceClient.
|
||||
@ -44,7 +44,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
explicit BlobServiceClient(
|
||||
const std::string& serviceUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const BlobServiceClientOptions& options = BlobServiceClientOptions());
|
||||
const BlobClientOptions& options = BlobClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Initialize a new instance of BlobServiceClient.
|
||||
@ -57,7 +57,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
explicit BlobServiceClient(
|
||||
const std::string& serviceUri,
|
||||
std::shared_ptr<Identity::ClientSecretCredential> credential,
|
||||
const BlobServiceClientOptions& options = BlobServiceClientOptions());
|
||||
const BlobClientOptions& options = BlobClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Initialize a new instance of BlobServiceClient.
|
||||
@ -69,7 +69,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
*/
|
||||
explicit BlobServiceClient(
|
||||
const std::string& serviceUri,
|
||||
const BlobServiceClientOptions& options = BlobServiceClientOptions());
|
||||
const BlobClientOptions& options = BlobClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Creates a new BlobContainerClient object with the same uri as this BlobServiceClient.
|
||||
@ -182,6 +182,8 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
protected:
|
||||
Azure::Core::Http::Url m_serviceUrl;
|
||||
std::shared_ptr<Azure::Core::Http::HttpPipeline> m_pipeline;
|
||||
Azure::Core::Nullable<EncryptionKey> m_customerProvidedKey;
|
||||
Azure::Core::Nullable<std::string> m_encryptionScope;
|
||||
|
||||
private:
|
||||
friend class BlobBatchClient;
|
||||
|
||||
@ -67,7 +67,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
|
||||
BlobBatchClient BlobBatchClient::CreateFromConnectionString(
|
||||
const std::string& connectionString,
|
||||
const BlobBatchClientOptions& options)
|
||||
const BlobClientOptions& options)
|
||||
{
|
||||
auto parsedConnectionString = Storage::Details::ParseConnectionString(connectionString);
|
||||
auto serviceUri = std::move(parsedConnectionString.BlobServiceUri);
|
||||
@ -86,7 +86,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
BlobBatchClient::BlobBatchClient(
|
||||
const std::string& serviceUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const BlobBatchClientOptions& options)
|
||||
const BlobClientOptions& options)
|
||||
: m_serviceUrl(serviceUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
@ -127,7 +127,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
BlobBatchClient::BlobBatchClient(
|
||||
const std::string& serviceUri,
|
||||
std::shared_ptr<Core::TokenCredential> credential,
|
||||
const BlobBatchClientOptions& options)
|
||||
const BlobClientOptions& options)
|
||||
: m_serviceUrl(serviceUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
@ -167,9 +167,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
m_subRequestPipeline = std::make_shared<Azure::Core::Http::HttpPipeline>(policies);
|
||||
}
|
||||
|
||||
BlobBatchClient::BlobBatchClient(
|
||||
const std::string& serviceUri,
|
||||
const BlobBatchClientOptions& options)
|
||||
BlobBatchClient::BlobBatchClient(const std::string& serviceUri, const BlobClientOptions& options)
|
||||
: m_serviceUrl(serviceUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
|
||||
@ -19,7 +19,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
BlobContainerClient BlobContainerClient::CreateFromConnectionString(
|
||||
const std::string& connectionString,
|
||||
const std::string& containerName,
|
||||
const BlobContainerClientOptions& options)
|
||||
const BlobClientOptions& options)
|
||||
{
|
||||
auto parsedConnectionString = Storage::Details::ParseConnectionString(connectionString);
|
||||
auto containerUri = std::move(parsedConnectionString.BlobServiceUri);
|
||||
@ -39,7 +39,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
BlobContainerClient::BlobContainerClient(
|
||||
const std::string& containerUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const BlobContainerClientOptions& options)
|
||||
const BlobClientOptions& options)
|
||||
: BlobContainerClient(containerUri, options)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
@ -65,7 +65,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
BlobContainerClient::BlobContainerClient(
|
||||
const std::string& containerUri,
|
||||
std::shared_ptr<Identity::ClientSecretCredential> credential,
|
||||
const BlobContainerClientOptions& options)
|
||||
const BlobClientOptions& options)
|
||||
: BlobContainerClient(containerUri, options)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
@ -91,7 +91,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
|
||||
BlobContainerClient::BlobContainerClient(
|
||||
const std::string& containerUri,
|
||||
const BlobContainerClientOptions& options)
|
||||
const BlobClientOptions& options)
|
||||
: m_containerUrl(containerUri), m_customerProvidedKey(options.CustomerProvidedKey),
|
||||
m_encryptionScope(options.EncryptionScope)
|
||||
{
|
||||
|
||||
@ -15,7 +15,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
|
||||
BlobServiceClient BlobServiceClient::CreateFromConnectionString(
|
||||
const std::string& connectionString,
|
||||
const BlobServiceClientOptions& options)
|
||||
const BlobClientOptions& options)
|
||||
{
|
||||
auto parsedConnectionString = Storage::Details::ParseConnectionString(connectionString);
|
||||
auto serviceUri = std::move(parsedConnectionString.BlobServiceUri);
|
||||
@ -34,7 +34,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
BlobServiceClient::BlobServiceClient(
|
||||
const std::string& serviceUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const BlobServiceClientOptions& options)
|
||||
const BlobClientOptions& options)
|
||||
: m_serviceUrl(serviceUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
@ -60,7 +60,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
BlobServiceClient::BlobServiceClient(
|
||||
const std::string& serviceUri,
|
||||
std::shared_ptr<Identity::ClientSecretCredential> credential,
|
||||
const BlobServiceClientOptions& options)
|
||||
const BlobClientOptions& options)
|
||||
: m_serviceUrl(serviceUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
@ -86,7 +86,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
|
||||
BlobServiceClient::BlobServiceClient(
|
||||
const std::string& serviceUri,
|
||||
const BlobServiceClientOptions& options)
|
||||
const BlobClientOptions& options)
|
||||
: m_serviceUrl(serviceUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
@ -113,7 +113,8 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
{
|
||||
auto containerUri = m_serviceUrl;
|
||||
containerUri.AppendPath(Storage::Details::UrlEncodePath(containerName));
|
||||
return BlobContainerClient(std::move(containerUri), m_pipeline);
|
||||
return BlobContainerClient(
|
||||
std::move(containerUri), m_pipeline, m_customerProvidedKey, m_encryptionScope);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::ListContainersSegmentResult>
|
||||
|
||||
@ -441,7 +441,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
{
|
||||
std::string containerName = LowercaseRandomString();
|
||||
std::string blobName = RandomString();
|
||||
Blobs::BlobContainerClientOptions options;
|
||||
Blobs::BlobClientOptions options;
|
||||
options.EncryptionScope = c_TestEncryptionScope;
|
||||
auto containerClient = Azure::Storage::Blobs::BlobContainerClient::CreateFromConnectionString(
|
||||
StandardStorageConnectionString(), containerName, options);
|
||||
@ -508,7 +508,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
return key;
|
||||
};
|
||||
|
||||
Blobs::BlobContainerClientOptions options;
|
||||
Blobs::BlobClientOptions options;
|
||||
options.CustomerProvidedKey = getRandomCustomerProvidedKey();
|
||||
auto containerClient = Azure::Storage::Blobs::BlobContainerClient::CreateFromConnectionString(
|
||||
StandardStorageConnectionString(), m_containerName, options);
|
||||
|
||||
@ -31,7 +31,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
const std::string& connectionString,
|
||||
const std::string& fileSystemName,
|
||||
const std::string& directoryPath,
|
||||
const DirectoryClientOptions& options = DirectoryClientOptions());
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Shared key authentication client.
|
||||
@ -42,7 +42,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
explicit DirectoryClient(
|
||||
const std::string& directoryUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const DirectoryClientOptions& options = DirectoryClientOptions());
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Bearer token authentication client.
|
||||
@ -53,7 +53,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
explicit DirectoryClient(
|
||||
const std::string& directoryUri,
|
||||
std::shared_ptr<Identity::ClientSecretCredential> credential,
|
||||
const DirectoryClientOptions& options = DirectoryClientOptions());
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Anonymous/SAS/customized pipeline auth.
|
||||
@ -62,7 +62,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
*/
|
||||
explicit DirectoryClient(
|
||||
const std::string& directoryUri,
|
||||
const DirectoryClientOptions& options = DirectoryClientOptions());
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Create a FileClient from current DirectoryClient
|
||||
|
||||
@ -32,7 +32,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
const std::string& connectionString,
|
||||
const std::string& fileSystemName,
|
||||
const std::string& filePath,
|
||||
const FileClientOptions& options = FileClientOptions());
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Shared key authentication client.
|
||||
@ -43,7 +43,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
explicit FileClient(
|
||||
const std::string& fileUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const FileClientOptions& options = FileClientOptions());
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Bearer token authentication client.
|
||||
@ -54,7 +54,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
explicit FileClient(
|
||||
const std::string& fileUri,
|
||||
std::shared_ptr<Identity::ClientSecretCredential> credential,
|
||||
const FileClientOptions& options = FileClientOptions());
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Anonymous/SAS/customized pipeline auth.
|
||||
@ -63,7 +63,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
*/
|
||||
explicit FileClient(
|
||||
const std::string& fileUri,
|
||||
const FileClientOptions& options = FileClientOptions());
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Gets the file's primary uri endpoint. This is the endpoint used for blob
|
||||
|
||||
@ -34,7 +34,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
static FileSystemClient CreateFromConnectionString(
|
||||
const std::string& connectionString,
|
||||
const std::string& fileSystemName,
|
||||
const FileSystemClientOptions& options = FileSystemClientOptions());
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Shared key authentication client.
|
||||
@ -45,7 +45,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
explicit FileSystemClient(
|
||||
const std::string& fileSystemUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const FileSystemClientOptions& options = FileSystemClientOptions());
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Bearer token authentication client.
|
||||
@ -56,7 +56,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
explicit FileSystemClient(
|
||||
const std::string& fileSystemUri,
|
||||
std::shared_ptr<Identity::ClientSecretCredential> credential,
|
||||
const FileSystemClientOptions& options = FileSystemClientOptions());
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Anonymous/SAS/customized pipeline auth.
|
||||
@ -65,7 +65,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
*/
|
||||
explicit FileSystemClient(
|
||||
const std::string& fileSystemUri,
|
||||
const FileSystemClientOptions& options = FileSystemClientOptions());
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Create a PathClient from current FileSystemClient
|
||||
|
||||
@ -19,11 +19,21 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
using GetUserDelegationKeyOptions = Blobs::GetUserDelegationKeyOptions;
|
||||
|
||||
/**
|
||||
* @brief Service client options used to initalize ServiceClient.
|
||||
* @brief Client options used to initalize DataLakeServiceClient, FileSystemClient, PathClient,
|
||||
* FileClient and DirectoryClient.
|
||||
*/
|
||||
struct DataLakeServiceClientOptions
|
||||
struct DataLakeClientOptions
|
||||
{
|
||||
/**
|
||||
* @brief Transport pipeline policies for authentication, additional HTTP headers, etc., that
|
||||
* are applied to every request.
|
||||
*/
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerOperationPolicies;
|
||||
|
||||
/**
|
||||
* @brief Transport pipeline policies for authentication, additional HTTP headers, etc., that
|
||||
* are applied to every retrial.
|
||||
*/
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerRetryPolicies;
|
||||
|
||||
/**
|
||||
@ -37,58 +47,6 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
Azure::Core::Http::TransportPolicyOptions TransportPolicyOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief File system client options used to initalize FileSystemClient.
|
||||
*/
|
||||
struct FileSystemClientOptions
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerOperationPolicies;
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerRetryPolicies;
|
||||
|
||||
/**
|
||||
* @brief Specify the number of retries and other retry-related options.
|
||||
*/
|
||||
StorageRetryWithSecondaryOptions RetryOptions;
|
||||
|
||||
/**
|
||||
* @brief Customized HTTP client. We're going to use the default one if this is empty.
|
||||
*/
|
||||
Azure::Core::Http::TransportPolicyOptions TransportPolicyOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Path client options used to initalize PathClient.
|
||||
*/
|
||||
struct PathClientOptions
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerOperationPolicies;
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerRetryPolicies;
|
||||
|
||||
/**
|
||||
* @brief Specify the number of retries and other retry-related options.
|
||||
*/
|
||||
StorageRetryWithSecondaryOptions RetryOptions;
|
||||
|
||||
/**
|
||||
* @brief Customized HTTP client. We're going to use the default one if this is empty.
|
||||
*/
|
||||
Azure::Core::Http::TransportPolicyOptions TransportPolicyOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief File client options used to initalize FileClient.
|
||||
*/
|
||||
struct FileClientOptions : public PathClientOptions
|
||||
{
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Directory client options used to initalize DirectoryClient.
|
||||
*/
|
||||
struct DirectoryClientOptions : public PathClientOptions
|
||||
{
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Specifies access conditions for a file system.
|
||||
*/
|
||||
|
||||
@ -32,7 +32,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
const std::string& connectionString,
|
||||
const std::string& fileSystemName,
|
||||
const std::string& path,
|
||||
const PathClientOptions& options = PathClientOptions());
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Shared key authentication client.
|
||||
@ -43,7 +43,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
explicit PathClient(
|
||||
const std::string& pathUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const PathClientOptions& options = PathClientOptions());
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Bearer token authentication client.
|
||||
@ -54,7 +54,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
explicit PathClient(
|
||||
const std::string& pathUri,
|
||||
std::shared_ptr<Identity::ClientSecretCredential> credential,
|
||||
const PathClientOptions& options = PathClientOptions());
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Anonymous/SAS/customized pipeline auth.
|
||||
@ -63,7 +63,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
*/
|
||||
explicit PathClient(
|
||||
const std::string& pathUri,
|
||||
const PathClientOptions& options = PathClientOptions());
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Gets the path's primary uri endpoint. This is the endpoint used for blob
|
||||
|
||||
@ -29,7 +29,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
*/
|
||||
static DataLakeServiceClient CreateFromConnectionString(
|
||||
const std::string& connectionString,
|
||||
const DataLakeServiceClientOptions& options = DataLakeServiceClientOptions());
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Shared key authentication client.
|
||||
@ -40,7 +40,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
explicit DataLakeServiceClient(
|
||||
const std::string& serviceUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const DataLakeServiceClientOptions& options = DataLakeServiceClientOptions());
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Bearer token authentication client.
|
||||
@ -51,7 +51,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
explicit DataLakeServiceClient(
|
||||
const std::string& serviceUri,
|
||||
std::shared_ptr<Identity::ClientSecretCredential> credential,
|
||||
const DataLakeServiceClientOptions& options = DataLakeServiceClientOptions());
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Anonymous/SAS/customized pipeline auth.
|
||||
@ -60,7 +60,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
*/
|
||||
explicit DataLakeServiceClient(
|
||||
const std::string& serviceUri,
|
||||
const DataLakeServiceClientOptions& options = DataLakeServiceClientOptions());
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Create a FileSystemClient from current DataLakeServiceClient
|
||||
|
||||
@ -24,7 +24,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
const std::string& connectionString,
|
||||
const std::string& fileSystemName,
|
||||
const std::string& path,
|
||||
const DirectoryClientOptions& options)
|
||||
const DataLakeClientOptions& options)
|
||||
{
|
||||
auto parsedConnectionString = Azure::Storage::Details::ParseConnectionString(connectionString);
|
||||
auto directoryUri = std::move(parsedConnectionString.DataLakeServiceUri);
|
||||
@ -45,7 +45,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
DirectoryClient::DirectoryClient(
|
||||
const std::string& directoryUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const DirectoryClientOptions& options)
|
||||
const DataLakeClientOptions& options)
|
||||
: PathClient(directoryUri, credential, options)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
@ -75,7 +75,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
DirectoryClient::DirectoryClient(
|
||||
const std::string& directoryUri,
|
||||
std::shared_ptr<Identity::ClientSecretCredential> credential,
|
||||
const DirectoryClientOptions& options)
|
||||
const DataLakeClientOptions& options)
|
||||
: PathClient(directoryUri, credential, options)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
@ -104,7 +104,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
|
||||
DirectoryClient::DirectoryClient(
|
||||
const std::string& directoryUri,
|
||||
const DirectoryClientOptions& options)
|
||||
const DataLakeClientOptions& options)
|
||||
: PathClient(directoryUri, options)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
|
||||
@ -102,7 +102,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
const std::string& connectionString,
|
||||
const std::string& fileSystemName,
|
||||
const std::string& filePath,
|
||||
const FileClientOptions& options)
|
||||
const DataLakeClientOptions& options)
|
||||
{
|
||||
auto parsedConnectionString = Azure::Storage::Details::ParseConnectionString(connectionString);
|
||||
auto fileUri = std::move(parsedConnectionString.DataLakeServiceUri);
|
||||
@ -122,7 +122,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
FileClient::FileClient(
|
||||
const std::string& fileUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const FileClientOptions& options)
|
||||
const DataLakeClientOptions& options)
|
||||
: PathClient(fileUri, credential, options),
|
||||
m_blockBlobClient(m_blobClient.GetBlockBlobClient())
|
||||
{
|
||||
@ -153,7 +153,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
FileClient::FileClient(
|
||||
const std::string& fileUri,
|
||||
std::shared_ptr<Identity::ClientSecretCredential> credential,
|
||||
const FileClientOptions& options)
|
||||
const DataLakeClientOptions& options)
|
||||
: PathClient(fileUri, credential, options),
|
||||
m_blockBlobClient(m_blobClient.GetBlockBlobClient())
|
||||
{
|
||||
@ -182,7 +182,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
m_pipeline = std::make_shared<Azure::Core::Http::HttpPipeline>(policies);
|
||||
}
|
||||
|
||||
FileClient::FileClient(const std::string& fileUri, const FileClientOptions& options)
|
||||
FileClient::FileClient(const std::string& fileUri, const DataLakeClientOptions& options)
|
||||
: PathClient(fileUri, options), m_blockBlobClient(m_blobClient.GetBlockBlobClient())
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
|
||||
@ -20,10 +20,9 @@
|
||||
|
||||
namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
namespace {
|
||||
Blobs::BlobContainerClientOptions GetBlobContainerClientOptions(
|
||||
const FileSystemClientOptions& options)
|
||||
Blobs::BlobClientOptions GetBlobContainerClientOptions(const DataLakeClientOptions& options)
|
||||
{
|
||||
Blobs::BlobContainerClientOptions blobOptions;
|
||||
Blobs::BlobClientOptions blobOptions;
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
blobOptions.PerOperationPolicies.emplace_back(p->Clone());
|
||||
@ -42,7 +41,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
FileSystemClient FileSystemClient::CreateFromConnectionString(
|
||||
const std::string& connectionString,
|
||||
const std::string& fileSystemName,
|
||||
const FileSystemClientOptions& options)
|
||||
const DataLakeClientOptions& options)
|
||||
{
|
||||
auto parsedConnectionString = Azure::Storage::Details::ParseConnectionString(connectionString);
|
||||
auto fileSystemUri = std::move(parsedConnectionString.DataLakeServiceUri);
|
||||
@ -62,7 +61,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
FileSystemClient::FileSystemClient(
|
||||
const std::string& fileSystemUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const FileSystemClientOptions& options)
|
||||
const DataLakeClientOptions& options)
|
||||
: m_dfsUri(Details::GetDfsUriFromUri(fileSystemUri)),
|
||||
m_blobContainerClient(
|
||||
Details::GetBlobUriFromUri(fileSystemUri),
|
||||
@ -97,7 +96,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
FileSystemClient::FileSystemClient(
|
||||
const std::string& fileSystemUri,
|
||||
std::shared_ptr<Identity::ClientSecretCredential> credential,
|
||||
const FileSystemClientOptions& options)
|
||||
const DataLakeClientOptions& options)
|
||||
: m_dfsUri(Details::GetDfsUriFromUri(fileSystemUri)),
|
||||
m_blobContainerClient(
|
||||
Details::GetBlobUriFromUri(fileSystemUri),
|
||||
@ -131,7 +130,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
|
||||
FileSystemClient::FileSystemClient(
|
||||
const std::string& fileSystemUri,
|
||||
const FileSystemClientOptions& options)
|
||||
const DataLakeClientOptions& options)
|
||||
: m_dfsUri(Details::GetDfsUriFromUri(fileSystemUri)),
|
||||
m_blobContainerClient(
|
||||
Details::GetBlobUriFromUri(fileSystemUri),
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
namespace {
|
||||
Blobs::BlobClientOptions GetBlobClientOptions(const PathClientOptions& options)
|
||||
Blobs::BlobClientOptions GetBlobClientOptions(const DataLakeClientOptions& options)
|
||||
{
|
||||
Blobs::BlobClientOptions blobOptions;
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
@ -86,7 +86,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
const std::string& connectionString,
|
||||
const std::string& fileSystemName,
|
||||
const std::string& path,
|
||||
const PathClientOptions& options)
|
||||
const DataLakeClientOptions& options)
|
||||
{
|
||||
auto parsedConnectionString = Azure::Storage::Details::ParseConnectionString(connectionString);
|
||||
auto pathUri = std::move(parsedConnectionString.DataLakeServiceUri);
|
||||
@ -106,7 +106,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
PathClient::PathClient(
|
||||
const std::string& pathUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const PathClientOptions& options)
|
||||
const DataLakeClientOptions& options)
|
||||
: m_dfsUri(Details::GetDfsUriFromUri(pathUri)),
|
||||
m_blobClient(Details::GetBlobUriFromUri(pathUri), credential, GetBlobClientOptions(options))
|
||||
{
|
||||
@ -137,7 +137,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
PathClient::PathClient(
|
||||
const std::string& pathUri,
|
||||
std::shared_ptr<Identity::ClientSecretCredential> credential,
|
||||
const PathClientOptions& options)
|
||||
const DataLakeClientOptions& options)
|
||||
: m_dfsUri(Details::GetDfsUriFromUri(pathUri)),
|
||||
m_blobClient(Details::GetBlobUriFromUri(pathUri), credential, GetBlobClientOptions(options))
|
||||
{
|
||||
@ -166,7 +166,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
m_pipeline = std::make_shared<Azure::Core::Http::HttpPipeline>(policies);
|
||||
}
|
||||
|
||||
PathClient::PathClient(const std::string& pathUri, const PathClientOptions& options)
|
||||
PathClient::PathClient(const std::string& pathUri, const DataLakeClientOptions& options)
|
||||
: m_dfsUri(Details::GetDfsUriFromUri(pathUri)),
|
||||
m_blobClient(Details::GetBlobUriFromUri(pathUri), GetBlobClientOptions(options))
|
||||
{
|
||||
|
||||
@ -18,10 +18,9 @@
|
||||
|
||||
namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
namespace {
|
||||
Blobs::BlobServiceClientOptions GetBlobServiceClientOptions(
|
||||
const DataLakeServiceClientOptions& options)
|
||||
Blobs::BlobClientOptions GetBlobServiceClientOptions(const DataLakeClientOptions& options)
|
||||
{
|
||||
Blobs::BlobServiceClientOptions blobOptions;
|
||||
Blobs::BlobClientOptions blobOptions;
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
blobOptions.PerOperationPolicies.emplace_back(p->Clone());
|
||||
@ -54,7 +53,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
|
||||
DataLakeServiceClient DataLakeServiceClient::CreateFromConnectionString(
|
||||
const std::string& connectionString,
|
||||
const DataLakeServiceClientOptions& options)
|
||||
const DataLakeClientOptions& options)
|
||||
{
|
||||
auto parsedConnectionString = Azure::Storage::Details::ParseConnectionString(connectionString);
|
||||
auto serviceUri = std::move(parsedConnectionString.DataLakeServiceUri);
|
||||
@ -73,7 +72,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
DataLakeServiceClient::DataLakeServiceClient(
|
||||
const std::string& serviceUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const DataLakeServiceClientOptions& options)
|
||||
const DataLakeClientOptions& options)
|
||||
: m_dfsUri(Details::GetDfsUriFromUri(serviceUri)), m_blobServiceClient(
|
||||
Details::GetBlobUriFromUri(serviceUri),
|
||||
credential,
|
||||
@ -105,7 +104,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
DataLakeServiceClient::DataLakeServiceClient(
|
||||
const std::string& serviceUri,
|
||||
std::shared_ptr<Identity::ClientSecretCredential> credential,
|
||||
const DataLakeServiceClientOptions& options)
|
||||
const DataLakeClientOptions& options)
|
||||
: m_dfsUri(Details::GetDfsUriFromUri(serviceUri)), m_blobServiceClient(
|
||||
Details::GetBlobUriFromUri(serviceUri),
|
||||
credential,
|
||||
@ -137,7 +136,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
|
||||
DataLakeServiceClient::DataLakeServiceClient(
|
||||
const std::string& serviceUri,
|
||||
const DataLakeServiceClientOptions& options)
|
||||
const DataLakeClientOptions& options)
|
||||
: m_dfsUri(Details::GetDfsUriFromUri(serviceUri)), m_blobServiceClient(
|
||||
Details::GetBlobUriFromUri(serviceUri),
|
||||
GetBlobServiceClientOptions(options))
|
||||
|
||||
@ -34,7 +34,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
const std::string& connectionString,
|
||||
const std::string& shareName,
|
||||
const std::string& directoryPath,
|
||||
const DirectoryClientOptions& options = DirectoryClientOptions());
|
||||
const ShareClientOptions& options = ShareClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Initialize a new instance of DirectoryClient using shared key authentication.
|
||||
@ -45,7 +45,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
explicit DirectoryClient(
|
||||
const std::string& shareDirectoryUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const DirectoryClientOptions& options = DirectoryClientOptions());
|
||||
const ShareClientOptions& options = ShareClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Initialize a new instance of DirectoryClient using token authentication.
|
||||
@ -56,7 +56,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
explicit DirectoryClient(
|
||||
const std::string& shareDirectoryUri,
|
||||
std::shared_ptr<Identity::ClientSecretCredential> credential,
|
||||
const DirectoryClientOptions& options = DirectoryClientOptions());
|
||||
const ShareClientOptions& options = ShareClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Initialize a new instance of DirectoryClient using anonymous access or shared access
|
||||
@ -66,7 +66,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
*/
|
||||
explicit DirectoryClient(
|
||||
const std::string& shareDirectoryUri,
|
||||
const DirectoryClientOptions& options = DirectoryClientOptions());
|
||||
const ShareClientOptions& options = ShareClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Gets the directory's primary uri endpoint.
|
||||
|
||||
@ -33,7 +33,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
const std::string& connectionString,
|
||||
const std::string& shareName,
|
||||
const std::string& filePath,
|
||||
const FileClientOptions& options = FileClientOptions());
|
||||
const ShareClientOptions& options = ShareClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Initialize a new instance of FileClient using shared key authentication.
|
||||
@ -44,7 +44,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
explicit FileClient(
|
||||
const std::string& shareFileUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const FileClientOptions& options = FileClientOptions());
|
||||
const ShareClientOptions& options = ShareClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Initialize a new instance of FileClient using token authentication.
|
||||
@ -55,7 +55,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
explicit FileClient(
|
||||
const std::string& shareFileUri,
|
||||
std::shared_ptr<Identity::ClientSecretCredential> credential,
|
||||
const FileClientOptions& options = FileClientOptions());
|
||||
const ShareClientOptions& options = ShareClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Initialize a new instance of FileClient using anonymous access or shared access
|
||||
@ -65,7 +65,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
*/
|
||||
explicit FileClient(
|
||||
const std::string& shareFileUri,
|
||||
const FileClientOptions& options = FileClientOptions());
|
||||
const ShareClientOptions& options = ShareClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Gets the file's primary uri endpoint.
|
||||
|
||||
@ -17,68 +17,21 @@
|
||||
namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
|
||||
/**
|
||||
* @brief Service client options used to initalize ServiceClient.
|
||||
*/
|
||||
struct ShareServiceClientOptions
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerOperationPolicies;
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerRetryPolicies;
|
||||
|
||||
/**
|
||||
* @brief Specify the number of retries and other retry-related options.
|
||||
*/
|
||||
StorageRetryOptions RetryOptions;
|
||||
|
||||
/**
|
||||
* @brief Customized HTTP client. We're going to use the default one if this is empty.
|
||||
*/
|
||||
Azure::Core::Http::TransportPolicyOptions TransportPolicyOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Share client options used to initalize ShareClient.
|
||||
* @brief Client options used to initalize ShareServiceClient, ShareClient, ShareFileClient and
|
||||
* ShareDirectoryClient.
|
||||
*/
|
||||
struct ShareClientOptions
|
||||
{
|
||||
/**
|
||||
* @brief Transport pipeline policies for authentication, additional HTTP headers, etc., that
|
||||
* are applied to every request.
|
||||
*/
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerOperationPolicies;
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerRetryPolicies;
|
||||
|
||||
/**
|
||||
* @brief Specify the number of retries and other retry-related options.
|
||||
* @brief Transport pipeline policies for authentication, additional HTTP headers, etc., that
|
||||
* are applied to every retrial.
|
||||
*/
|
||||
StorageRetryOptions RetryOptions;
|
||||
|
||||
/**
|
||||
* @brief Customized HTTP client. We're going to use the default one if this is empty.
|
||||
*/
|
||||
Azure::Core::Http::TransportPolicyOptions TransportPolicyOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Directory client options used to initalize DirectoryClient.
|
||||
*/
|
||||
struct DirectoryClientOptions
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerOperationPolicies;
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerRetryPolicies;
|
||||
|
||||
/**
|
||||
* @brief Specify the number of retries and other retry-related options.
|
||||
*/
|
||||
StorageRetryOptions RetryOptions;
|
||||
|
||||
/**
|
||||
* @brief Customized HTTP client. We're going to use the default one if this is empty.
|
||||
*/
|
||||
Azure::Core::Http::TransportPolicyOptions TransportPolicyOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief File client options used to initalize FileClient.
|
||||
*/
|
||||
struct FileClientOptions
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerOperationPolicies;
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerRetryPolicies;
|
||||
|
||||
/**
|
||||
|
||||
@ -29,7 +29,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
*/
|
||||
static ShareServiceClient CreateFromConnectionString(
|
||||
const std::string& connectionString,
|
||||
const ShareServiceClientOptions& options = ShareServiceClientOptions());
|
||||
const ShareClientOptions& options = ShareClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Initialize a new instance of ShareServiceClient using shared key authentication.
|
||||
@ -40,7 +40,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
explicit ShareServiceClient(
|
||||
const std::string& serviceUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const ShareServiceClientOptions& options = ShareServiceClientOptions());
|
||||
const ShareClientOptions& options = ShareClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Initialize a new instance of ShareServiceClient using token authentication.
|
||||
@ -51,7 +51,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
explicit ShareServiceClient(
|
||||
const std::string& serviceUri,
|
||||
std::shared_ptr<Identity::ClientSecretCredential> credential,
|
||||
const ShareServiceClientOptions& options = ShareServiceClientOptions());
|
||||
const ShareClientOptions& options = ShareClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Initialize a new instance of ShareServiceClient using anonymous access or shared
|
||||
@ -61,7 +61,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
*/
|
||||
explicit ShareServiceClient(
|
||||
const std::string& serviceUri,
|
||||
const ShareServiceClientOptions& options = ShareServiceClientOptions());
|
||||
const ShareClientOptions& options = ShareClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Create a ShareClient from current ShareServiceClient
|
||||
|
||||
@ -20,7 +20,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
const std::string& connectionString,
|
||||
const std::string& shareName,
|
||||
const std::string& directoryPath,
|
||||
const DirectoryClientOptions& options)
|
||||
const ShareClientOptions& options)
|
||||
{
|
||||
auto parsedConnectionString = Azure::Storage::Details::ParseConnectionString(connectionString);
|
||||
auto directoryUri = std::move(parsedConnectionString.FileServiceUri);
|
||||
@ -41,7 +41,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
DirectoryClient::DirectoryClient(
|
||||
const std::string& shareDirectoryUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const DirectoryClientOptions& options)
|
||||
const ShareClientOptions& options)
|
||||
: m_shareDirectoryUri(shareDirectoryUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
@ -67,7 +67,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
DirectoryClient::DirectoryClient(
|
||||
const std::string& shareDirectoryUri,
|
||||
std::shared_ptr<Identity::ClientSecretCredential> credential,
|
||||
const DirectoryClientOptions& options)
|
||||
const ShareClientOptions& options)
|
||||
: m_shareDirectoryUri(shareDirectoryUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
@ -93,7 +93,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
|
||||
DirectoryClient::DirectoryClient(
|
||||
const std::string& shareDirectoryUri,
|
||||
const DirectoryClientOptions& options)
|
||||
const ShareClientOptions& options)
|
||||
: m_shareDirectoryUri(shareDirectoryUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
|
||||
@ -23,7 +23,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
const std::string& connectionString,
|
||||
const std::string& shareName,
|
||||
const std::string& filePath,
|
||||
const FileClientOptions& options)
|
||||
const ShareClientOptions& options)
|
||||
{
|
||||
auto parsedConnectionString = Azure::Storage::Details::ParseConnectionString(connectionString);
|
||||
auto fileUri = std::move(parsedConnectionString.FileServiceUri);
|
||||
@ -43,7 +43,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
FileClient::FileClient(
|
||||
const std::string& shareFileUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const FileClientOptions& options)
|
||||
const ShareClientOptions& options)
|
||||
: m_shareFileUri(shareFileUri)
|
||||
{
|
||||
|
||||
@ -70,7 +70,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
FileClient::FileClient(
|
||||
const std::string& shareFileUri,
|
||||
std::shared_ptr<Identity::ClientSecretCredential> credential,
|
||||
const FileClientOptions& options)
|
||||
const ShareClientOptions& options)
|
||||
: m_shareFileUri(shareFileUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
@ -94,7 +94,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_pipeline = std::make_shared<Azure::Core::Http::HttpPipeline>(policies);
|
||||
}
|
||||
|
||||
FileClient::FileClient(const std::string& shareFileUri, const FileClientOptions& options)
|
||||
FileClient::FileClient(const std::string& shareFileUri, const ShareClientOptions& options)
|
||||
: m_shareFileUri(shareFileUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
ShareServiceClient ShareServiceClient::CreateFromConnectionString(
|
||||
const std::string& connectionString,
|
||||
const ShareServiceClientOptions& options)
|
||||
const ShareClientOptions& options)
|
||||
{
|
||||
auto parsedConnectionString = Azure::Storage::Details::ParseConnectionString(connectionString);
|
||||
auto serviceUri = std::move(parsedConnectionString.FileServiceUri);
|
||||
@ -36,7 +36,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
ShareServiceClient::ShareServiceClient(
|
||||
const std::string& serviceUri,
|
||||
std::shared_ptr<SharedKeyCredential> credential,
|
||||
const ShareServiceClientOptions& options)
|
||||
const ShareClientOptions& options)
|
||||
: m_serviceUri(serviceUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
@ -62,7 +62,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
ShareServiceClient::ShareServiceClient(
|
||||
const std::string& serviceUri,
|
||||
std::shared_ptr<Identity::ClientSecretCredential> credential,
|
||||
const ShareServiceClientOptions& options)
|
||||
const ShareClientOptions& options)
|
||||
: m_serviceUri(serviceUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
@ -88,7 +88,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
|
||||
ShareServiceClient::ShareServiceClient(
|
||||
const std::string& serviceUri,
|
||||
const ShareServiceClientOptions& options)
|
||||
const ShareClientOptions& options)
|
||||
: m_serviceUri(serviceUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user