6 #include "azure/core/credentials/credentials.hpp"
7 #include "azure/storage/blobs/blob_options.hpp"
8 #include "azure/storage/blobs/blob_responses.hpp"
9 #include "azure/storage/blobs/protocol/blob_rest_client.hpp"
10 #include "azure/storage/common/storage_credential.hpp"
16 namespace Azure {
namespace Storage {
namespace Files {
namespace DataLake {
17 class DirectoryClient;
21 namespace Azure {
namespace Storage {
namespace Blobs {
23 class BlockBlobClient;
24 class AppendBlobClient;
44 const std::string& connectionString,
45 const std::string& containerName,
46 const std::string& blobName,
59 const std::string& blobUri,
60 std::shared_ptr<SharedKeyCredential> credential,
73 const std::string& blobUri,
74 std::shared_ptr<Core::Credentials::ClientSecretCredential> credential,
87 const std::string& blobUri,
120 std::string
GetUri()
const {
return m_blobUrl.GetAbsoluteUrl(); }
149 Azure::Core::Response<GetBlobPropertiesResult>
GetProperties(
172 Azure::Core::Response<SetBlobMetadataResult>
SetMetadata(
173 std::map<std::string, std::string> metadata,
185 Azure::Core::Response<SetBlobAccessTierResult>
SetAccessTier(
202 const std::string& sourceUri,
214 const std::string& copyId,
225 Azure::Core::Response<DownloadBlobResult>
Download(
238 Azure::Core::Response<DownloadBlobToResult>
DownloadTo(
240 std::size_t bufferSize,
251 Azure::Core::Response<DownloadBlobToResult>
DownloadTo(
252 const std::string& file,
272 Azure::Core::Response<DeleteBlobResult>
Delete(
282 Azure::Core::Response<UndeleteBlobResult>
Undelete(
296 Azure::Core::Response<AcquireBlobLeaseResult>
AcquireLease(
297 const std::string& proposedLeaseId,
308 Azure::Core::Response<RenewBlobLeaseResult>
RenewLease(
309 const std::string& leaseId,
319 Azure::Core::Response<ReleaseBlobLeaseResult>
ReleaseLease(
320 const std::string& leaseId,
332 Azure::Core::Response<ChangeBlobLeaseResult>
ChangeLease(
333 const std::string& leaseId,
334 const std::string& proposedLeaseId,
343 Azure::Core::Response<BreakBlobLeaseResult>
BreakLease(
353 Azure::Core::Response<SetBlobTagsResult>
SetTags(
354 std::map<std::string, std::string> tags,
363 Azure::Core::Response<GetBlobTagsResult>
GetTags(
367 Azure::Core::Http::Url m_blobUrl;
368 std::shared_ptr<Azure::Core::Http::HttpPipeline> m_pipeline;
369 Azure::Core::Nullable<EncryptionKey> m_customerProvidedKey;
370 Azure::Core::Nullable<std::string> m_encryptionScope;
374 Azure::Core::Http::Url blobUri,
375 std::shared_ptr<Azure::Core::Http::HttpPipeline> pipeline,
376 Azure::Core::Nullable<EncryptionKey> customerProvidedKey,
377 Azure::Core::Nullable<std::string> encryptionScope)
378 : m_blobUrl(std::move(blobUri)), m_pipeline(std::move(pipeline)),
379 m_customerProvidedKey(std::move(customerProvidedKey)),
380 m_encryptionScope(std::move(encryptionScope))
384 friend class BlobContainerClient;
385 friend class Files::DataLake::DirectoryClient;
386 friend class Files::DataLake::FileClient;
Azure::Core::Response< CreateBlobSnapshotResult > CreateSnapshot(const CreateBlobSnapshotOptions &options=CreateBlobSnapshotOptions()) const
Creates a read-only snapshot of a blob.
Definition: blob_client.cpp:586
Azure::Core::Response< UndeleteBlobResult > Undelete(const UndeleteBlobOptions &options=UndeleteBlobOptions()) const
Restores the contents and metadata of a soft deleted blob and any associated soft deleted snapshots.
Definition: blob_client.cpp:622
static BlobClient CreateFromConnectionString(const std::string &connectionString, const std::string &containerName, const std::string &blobName, const BlobClientOptions &options=BlobClientOptions())
Initialize a new instance of BlobClient.
Definition: blob_client.cpp:22
Azure::Core::Response< DownloadBlobResult > Download(const DownloadBlobOptions &options=DownloadBlobOptions()) const
Downloads a blob or a blob range from the service, including its metadata and properties.
Definition: blob_client.cpp:157
Optional parameters for BlobClient::Download.
Definition: blob_options.hpp:691
BlobClient WithVersionId(const std::string &versionId) const
Creates a clone of this instance that references a version ID rather than the base blob.
Definition: blob_client.cpp:143
The BlobClient allows you to manipulate Azure Storage blobs.
Definition: blob_client.hpp:30
Optional parameters for BlobClient::AcquireLease.
Definition: blob_options.hpp:817
Azure::Core::Response< AbortCopyBlobFromUriResult > AbortCopyFromUri(const std::string ©Id, const AbortCopyBlobFromUriOptions &options=AbortCopyBlobFromUriOptions()) const
Aborts a pending StartCopyFromUri operation, and leaves this blob with zero length and full metadata.
Definition: blob_client.cpp:575
PageBlobClient GetPageBlobClient() const
Creates a new PageBlobClient object with the same uri as this BlobClient. The new PageBlobClient uses...
Definition: blob_client.cpp:127
Azure::Core::Response< StartCopyBlobFromUriResult > StartCopyFromUri(const std::string &sourceUri, const StartCopyBlobFromUriOptions &options=StartCopyBlobFromUriOptions()) const
Copies data at from the source to this blob.
Definition: blob_client.cpp:549
Optional parameters for BlobClient::BreakLease.
Definition: blob_options.hpp:869
Optional parameters for BlobClient::ChangeLease.
Definition: blob_options.hpp:843
Optional parameters for BlobClient::StartCopyFromUri.
Definition: blob_options.hpp:628
Definition: page_blob_client.hpp:26
Azure::Core::Response< GetBlobPropertiesResult > GetProperties(const GetBlobPropertiesOptions &options=GetBlobPropertiesOptions()) const
Returns all user-defined metadata, standard HTTP properties, and system properties for the blob....
Definition: blob_client.cpp:479
Blob client options used to initalize BlobClient.
Definition: blob_options.hpp:513
Azure::Core::Response< SetBlobAccessTierResult > SetAccessTier(AccessTier Tier, const SetBlobAccessTierOptions &options=SetBlobAccessTierOptions()) const
Sets the tier on a blob. The operation is allowed on a page blob in a premium storage account and on ...
Definition: blob_client.cpp:538
BlobClient(const std::string &blobUri, std::shared_ptr< SharedKeyCredential > credential, const BlobClientOptions &options=BlobClientOptions())
Initialize a new instance of BlobClient.
Definition: blob_client.cpp:43
BlockBlobClient GetBlockBlobClient() const
Creates a new BlockBlobClient object with the same uri as this BlobClient. The new BlockBlobClient us...
Definition: blob_client.cpp:123
Azure::Core::Response< SetBlobTagsResult > SetTags(std::map< std::string, std::string > tags, const SetBlobTagsOptions &options=SetBlobTagsOptions()) const
Sets tags on the underlying blob.
Definition: blob_client.cpp:708
Azure::Core::Response< RenewBlobLeaseResult > RenewLease(const std::string &leaseId, const RenewBlobLeaseOptions &options=RenewBlobLeaseOptions()) const
Renews the blob's previously-acquired lease.
Definition: blob_client.cpp:647
Azure::Core::Response< ChangeBlobLeaseResult > ChangeLease(const std::string &leaseId, const std::string &proposedLeaseId, const ChangeBlobLeaseOptions &options=ChangeBlobLeaseOptions()) const
Changes the lease of an active lease.
Definition: blob_client.cpp:677
Optional parameters for BlobClient::RenewLease.
Definition: blob_options.hpp:830
Optional parameters for BlobClient::Delete.
Definition: blob_options.hpp:781
Azure::Core::Response< DownloadBlobToResult > DownloadTo(uint8_t *buffer, std::size_t bufferSize, const DownloadBlobToOptions &options=DownloadBlobToOptions()) const
Downloads a blob or a blob range from the service to a memory buffer using parallel requests.
Definition: blob_client.cpp:221
Azure::Core::Response< ReleaseBlobLeaseResult > ReleaseLease(const std::string &leaseId, const ReleaseBlobLeaseOptions &options=ReleaseBlobLeaseOptions()) const
Releases the blob's previously-acquired lease.
Definition: blob_client.cpp:662
AppendBlobClient GetAppendBlobClient() const
Creates a new AppendBlobClient object with the same uri as this BlobClient. The new AppendBlobClient ...
Definition: blob_client.cpp:125
Optional parameters for BlobClient::CreateSnapshot.
Definition: blob_options.hpp:757
Azure::Core::Response< GetBlobTagsResult > GetTags(const GetBlobTagsOptions &options=GetBlobTagsOptions()) const
Gets the tags associated with the underlying blob.
Definition: blob_client.cpp:719
The BlockBlobClient allows you to manipulate Azure Storage block blobs.
Definition: block_blob_client.hpp:34
Azure::Core::Response< BreakBlobLeaseResult > BreakLease(const BreakBlobLeaseOptions &options=BreakBlobLeaseOptions()) const
Breaks the previously-acquired lease.
Definition: blob_client.cpp:694
Azure::Core::Response< AcquireBlobLeaseResult > AcquireLease(const std::string &proposedLeaseId, int32_t duration, const AcquireBlobLeaseOptions &options=AcquireBlobLeaseOptions()) const
Acquires a lease on the blob.
Definition: blob_client.cpp:630
The AppendBlobClient allows you to manipulate Azure Storage append blobs.
Definition: append_blob_client.hpp:24
Optional parameters for BlobClient::DownloadTo.
Definition: blob_options.hpp:718
Optional parameters for BlobClient::ReleaseLease.
Definition: blob_options.hpp:856
Optional parameters for BlobClient::GetProperties.
Definition: blob_options.hpp:562
Azure::Core::Response< SetBlobHttpHeadersResult > SetHttpHeaders(BlobHttpHeaders httpHeaders, const SetBlobHttpHeadersOptions &options=SetBlobHttpHeadersOptions()) const
Sets system properties on the blob.
Definition: blob_client.cpp:499
Azure::Core::Response< DeleteBlobResult > Delete(const DeleteBlobOptions &options=DeleteBlobOptions()) const
Marks the specified blob or snapshot for deletion. The blob is later deleted during garbage collectio...
Definition: blob_client.cpp:608
BlobClient WithSnapshot(const std::string &snapshot) const
Initializes a new instance of the BlobClient class with an identical uri source but the specified sna...
Definition: blob_client.cpp:129
Optional parameters for BlobClient::Undelete.
Definition: blob_options.hpp:804
Azure::Core::Response< SetBlobMetadataResult > SetMetadata(std::map< std::string, std::string > metadata, const SetBlobMetadataOptions &options=SetBlobMetadataOptions()) const
Sets user-defined metadata for the specified blob as one or more name-value pairs.
Definition: blob_client.cpp:515
Optional parameters for BlobClient::AbortCopyFromUri.
Definition: blob_options.hpp:675
std::string GetUri() const
Gets the blob's primary uri endpoint.
Definition: blob_client.hpp:120
Optional parameters for BlobClient::SetAccessTier.
Definition: blob_options.hpp:610