|
The BlobClient allows you to manipulate Azure Storage blobs.
#include <blob_client.hpp>
Public Member Functions | |
virtual | ~BlobClient ()=default |
Destructor. More... | |
BlobClient (const std::string &blobUrl, std::shared_ptr< StorageSharedKeyCredential > credential, const BlobClientOptions &options=BlobClientOptions()) | |
Initialize a new instance of BlobClient. More... | |
BlobClient (const std::string &blobUrl, std::shared_ptr< Core::Credentials::TokenCredential > credential, const BlobClientOptions &options=BlobClientOptions()) | |
Initialize a new instance of BlobClient. More... | |
BlobClient (const std::string &blobUrl, const BlobClientOptions &options=BlobClientOptions()) | |
Initialize a new instance of BlobClient. More... | |
BlockBlobClient | AsBlockBlobClient () const |
Creates a new BlockBlobClient object with the same URL as this BlobClient. The new BlockBlobClient uses the same request policy pipeline as this BlobClient. More... | |
AppendBlobClient | AsAppendBlobClient () const |
Creates a new AppendBlobClient object with the same URL as this BlobClient. The new AppendBlobClient uses the same request policy pipeline as this BlobClient. More... | |
PageBlobClient | AsPageBlobClient () const |
Creates a new PageBlobClient object with the same URL as this BlobClient. The new PageBlobClient uses the same request policy pipeline as this BlobClient. More... | |
std::string | GetUrl () const |
Gets the blob's primary URL endpoint. More... | |
BlobClient | WithSnapshot (const std::string &snapshot) const |
Initializes a new instance of the BlobClient class with an identical URL source but the specified snapshot timestamp. More... | |
BlobClient | WithVersionId (const std::string &versionId) const |
Creates a clone of this instance that references a version ID rather than the base blob. More... | |
Azure::Response< Models::BlobProperties > | GetProperties (const GetBlobPropertiesOptions &options=GetBlobPropertiesOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const |
Returns all user-defined metadata, standard HTTP properties, and system properties for the blob. It does not return the content of the blob. More... | |
Azure::Response< Models::SetBlobHttpHeadersResult > | SetHttpHeaders (Models::BlobHttpHeaders httpHeaders, const SetBlobHttpHeadersOptions &options=SetBlobHttpHeadersOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const |
Sets system properties on the blob. More... | |
Azure::Response< Models::SetBlobMetadataResult > | SetMetadata (Metadata metadata, const SetBlobMetadataOptions &options=SetBlobMetadataOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const |
Sets user-defined metadata for the specified blob as one or more name-value pairs. More... | |
Azure::Response< Models::SetBlobAccessTierResult > | SetAccessTier (Models::AccessTier accessTier, const SetBlobAccessTierOptions &options=SetBlobAccessTierOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const |
Sets the tier on a blob. The operation is allowed on a page blob in a premium storage account and on a block blob in a blob storage or general purpose v2 account. More... | |
StartBlobCopyOperation | StartCopyFromUri (const std::string &sourceUri, const StartBlobCopyFromUriOptions &options=StartBlobCopyFromUriOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const |
Copies data at from the source to this blob. More... | |
Azure::Response< Models::AbortBlobCopyFromUriResult > | AbortCopyFromUri (const std::string ©Id, const AbortBlobCopyFromUriOptions &options=AbortBlobCopyFromUriOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const |
Aborts a pending StartCopyFromUri operation, and leaves this blob with zero length and full metadata. More... | |
Azure::Response< Models::DownloadBlobResult > | Download (const DownloadBlobOptions &options=DownloadBlobOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const |
Downloads a blob or a blob range from the service, including its metadata and properties. More... | |
Azure::Response< Models::DownloadBlobToResult > | DownloadTo (uint8_t *buffer, size_t bufferSize, const DownloadBlobToOptions &options=DownloadBlobToOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const |
Downloads a blob or a blob range from the service to a memory buffer using parallel requests. More... | |
Azure::Response< Models::DownloadBlobToResult > | DownloadTo (const std::string &fileName, const DownloadBlobToOptions &options=DownloadBlobToOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const |
Downloads a blob or a blob range from the service to a file using parallel requests. More... | |
Azure::Response< Models::CreateBlobSnapshotResult > | CreateSnapshot (const CreateBlobSnapshotOptions &options=CreateBlobSnapshotOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const |
Creates a read-only snapshot of a blob. More... | |
Azure::Response< Models::DeleteBlobResult > | Delete (const DeleteBlobOptions &options=DeleteBlobOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const |
Marks the specified blob or snapshot for deletion. The blob is later deleted during garbage collection. Note that in order to delete a blob, you must delete all of its snapshots. You can delete both at the same time using DeleteBlobOptions.DeleteSnapshots. More... | |
Azure::Response< Models::DeleteBlobResult > | DeleteIfExists (const DeleteBlobOptions &options=DeleteBlobOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const |
Marks the specified blob or snapshot for deletion if it exists. More... | |
Azure::Response< Models::UndeleteBlobResult > | Undelete (const UndeleteBlobOptions &options=UndeleteBlobOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const |
Restores the contents and metadata of a soft deleted blob and any associated soft deleted snapshots. More... | |
Azure::Response< Models::SetBlobTagsResult > | SetTags (std::map< std::string, std::string > tags, const SetBlobTagsOptions &options=SetBlobTagsOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const |
Sets tags on the underlying blob. More... | |
Azure::Response< std::map< std::string, std::string > > | GetTags (const GetBlobTagsOptions &options=GetBlobTagsOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const |
Gets the tags associated with the underlying blob. More... | |
Static Public Member Functions | |
static BlobClient | CreateFromConnectionString (const std::string &connectionString, const std::string &blobContainerName, const std::string &blobName, const BlobClientOptions &options=BlobClientOptions()) |
Initialize a new instance of BlobClient. More... | |
Protected Attributes | |
Azure::Core::Url | m_blobUrl |
std::shared_ptr< Azure::Core::Http::_internal::HttpPipeline > | m_pipeline |
Azure::Nullable< EncryptionKey > | m_customerProvidedKey |
Azure::Nullable< std::string > | m_encryptionScope |
Friends | |
class | BlobContainerClient |
class | Files::DataLake::DataLakeFileSystemClient |
class | Files::DataLake::DataLakeDirectoryClient |
class | Files::DataLake::DataLakeFileClient |
class | BlobLeaseClient |
|
virtualdefault |
|
explicit |
blobUrl | A URL referencing the blob that includes the name of the account, the name of the container, and the name of the blob. |
credential | The shared key credential used to sign requests. |
options | Optional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request. |
|
explicit |
blobUrl | A URL referencing the blob that includes the name of the account, the name of the container, and the name of the blob. |
credential | The token credential used to sign requests. |
options | Optional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request. |
|
explicit |
blobUrl | A URL referencing the blob that includes the name of the account, the name of the container, and the name of the blob, and possibly also a SAS token. |
options | Optional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request. |
Azure::Response< Models::AbortBlobCopyFromUriResult > Azure::Storage::Blobs::BlobClient::AbortCopyFromUri | ( | const std::string & | copyId, |
const AbortBlobCopyFromUriOptions & | options = AbortBlobCopyFromUriOptions() , |
||
const Azure::Core::Context & | context = Azure::Core::Context() |
||
) | const |
copyId | ID of the copy operation to abort. |
options | Optional parameters to execute this function. |
context | Context for cancelling long running operations. |
AppendBlobClient Azure::Storage::Blobs::BlobClient::AsAppendBlobClient | ( | ) | const |
BlockBlobClient Azure::Storage::Blobs::BlobClient::AsBlockBlobClient | ( | ) | const |
PageBlobClient Azure::Storage::Blobs::BlobClient::AsPageBlobClient | ( | ) | const |
|
static |
connectionString | A connection string includes the authentication information required for your application to access data in an Azure Storage account at runtime. |
blobContainerName | The name of the container containing this blob. |
blobName | The name of this blob. |
options | Optional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request. |
Azure::Response< Models::CreateBlobSnapshotResult > Azure::Storage::Blobs::BlobClient::CreateSnapshot | ( | const CreateBlobSnapshotOptions & | options = CreateBlobSnapshotOptions() , |
const Azure::Core::Context & | context = Azure::Core::Context() |
||
) | const |
options | Optional parameters to execute this function. |
context | Context for cancelling long running operations. |
Azure::Response< Models::DeleteBlobResult > Azure::Storage::Blobs::BlobClient::Delete | ( | const DeleteBlobOptions & | options = DeleteBlobOptions() , |
const Azure::Core::Context & | context = Azure::Core::Context() |
||
) | const |
options | Optional parameters to execute this function. |
context | Context for cancelling long running operations. |
Azure::Response< Models::DeleteBlobResult > Azure::Storage::Blobs::BlobClient::DeleteIfExists | ( | const DeleteBlobOptions & | options = DeleteBlobOptions() , |
const Azure::Core::Context & | context = Azure::Core::Context() |
||
) | const |
options | Optional parameters to execute this function. |
context | Context for cancelling long running operations. |
Azure::Response< Models::DownloadBlobResult > Azure::Storage::Blobs::BlobClient::Download | ( | const DownloadBlobOptions & | options = DownloadBlobOptions() , |
const Azure::Core::Context & | context = Azure::Core::Context() |
||
) | const |
options | Optional parameters to execute this function. |
context | Context for cancelling long running operations. |
Azure::Response< Models::DownloadBlobToResult > Azure::Storage::Blobs::BlobClient::DownloadTo | ( | const std::string & | fileName, |
const DownloadBlobToOptions & | options = DownloadBlobToOptions() , |
||
const Azure::Core::Context & | context = Azure::Core::Context() |
||
) | const |
fileName | A file path to write the downloaded content to. |
options | Optional parameters to execute this function. |
context | Context for cancelling long running operations. |
Azure::Response< Models::DownloadBlobToResult > Azure::Storage::Blobs::BlobClient::DownloadTo | ( | uint8_t * | buffer, |
size_t | bufferSize, | ||
const DownloadBlobToOptions & | options = DownloadBlobToOptions() , |
||
const Azure::Core::Context & | context = Azure::Core::Context() |
||
) | const |
buffer | A memory buffer to write the blob content to. |
bufferSize | Size of the memory buffer. Size must be larger or equal to size of the blob or blob range. |
options | Optional parameters to execute this function. |
context | Context for cancelling long running operations. |
Azure::Response< Models::BlobProperties > Azure::Storage::Blobs::BlobClient::GetProperties | ( | const GetBlobPropertiesOptions & | options = GetBlobPropertiesOptions() , |
const Azure::Core::Context & | context = Azure::Core::Context() |
||
) | const |
options | Optional parameters to execute this function. |
context | Context for cancelling long running operations. |
Azure::Response< std::map< std::string, std::string > > Azure::Storage::Blobs::BlobClient::GetTags | ( | const GetBlobTagsOptions & | options = GetBlobTagsOptions() , |
const Azure::Core::Context & | context = Azure::Core::Context() |
||
) | const |
options | Optional parameters to execute this function. |
context | Context for cancelling long running operations. |
|
inline |
Azure::Response< Models::SetBlobAccessTierResult > Azure::Storage::Blobs::BlobClient::SetAccessTier | ( | Models::AccessTier | accessTier, |
const SetBlobAccessTierOptions & | options = SetBlobAccessTierOptions() , |
||
const Azure::Core::Context & | context = Azure::Core::Context() |
||
) | const |
accessTier | Indicates the tier to be set on the blob. |
options | Optional parameters to execute this function. |
context | Context for cancelling long running operations. |
Azure::Response< Models::SetBlobHttpHeadersResult > Azure::Storage::Blobs::BlobClient::SetHttpHeaders | ( | Models::BlobHttpHeaders | httpHeaders, |
const SetBlobHttpHeadersOptions & | options = SetBlobHttpHeadersOptions() , |
||
const Azure::Core::Context & | context = Azure::Core::Context() |
||
) | const |
httpHeaders | The standard HTTP header system properties to set. |
options | Optional parameters to execute this function. |
context | Context for cancelling long running operations. |
Azure::Response< Models::SetBlobMetadataResult > Azure::Storage::Blobs::BlobClient::SetMetadata | ( | Metadata | metadata, |
const SetBlobMetadataOptions & | options = SetBlobMetadataOptions() , |
||
const Azure::Core::Context & | context = Azure::Core::Context() |
||
) | const |
metadata | Custom metadata to set for this blob. |
options | Optional parameters to execute this function. |
context | Context for cancelling long running operations. |
Azure::Response< Models::SetBlobTagsResult > Azure::Storage::Blobs::BlobClient::SetTags | ( | std::map< std::string, std::string > | tags, |
const SetBlobTagsOptions & | options = SetBlobTagsOptions() , |
||
const Azure::Core::Context & | context = Azure::Core::Context() |
||
) | const |
tags | The tags to set on the blob. |
options | Optional parameters to execute this function. |
context | Context for cancelling long running operations. |
StartBlobCopyOperation Azure::Storage::Blobs::BlobClient::StartCopyFromUri | ( | const std::string & | sourceUri, |
const StartBlobCopyFromUriOptions & | options = StartBlobCopyFromUriOptions() , |
||
const Azure::Core::Context & | context = Azure::Core::Context() |
||
) | const |
sourceUri | Specifies the uri of the source blob. The value may a uri of up to 2 KB in length that specifies a blob. A source blob in the same storage account can be authenticated via Shared Key. However, if the source is a blob in another account, the source blob must either be public or must be authenticated via a shared access signature. If the source blob is public, no authentication is required to perform the copy operation. |
options | Optional parameters to execute this function. |
context | Context for cancelling long running operations. |
Azure::Response< Models::UndeleteBlobResult > Azure::Storage::Blobs::BlobClient::Undelete | ( | const UndeleteBlobOptions & | options = UndeleteBlobOptions() , |
const Azure::Core::Context & | context = Azure::Core::Context() |
||
) | const |
options | Optional parameters to execute this function. |
context | Context for cancelling long running operations. |
BlobClient Azure::Storage::Blobs::BlobClient::WithSnapshot | ( | const std::string & | snapshot | ) | const |
snapshot | The snapshot identifier. |
BlobClient Azure::Storage::Blobs::BlobClient::WithVersionId | ( | const std::string & | versionId | ) | const |
versionId | The version ID returning a URL to the base blob. |