|
The BlobClient allows you to manipulate Azure Storage blobs. More...
#include <blob_client.hpp>
Public Member Functions | |
BlobClient (const std::string &blobUri, std::shared_ptr< SharedKeyCredential > credential, const BlobClientOptions &options=BlobClientOptions()) | |
Initialize a new instance of BlobClient. More... | |
BlobClient (const std::string &blobUri, std::shared_ptr< Core::Credentials::ClientSecretCredential > credential, const BlobClientOptions &options=BlobClientOptions()) | |
Initialize a new instance of BlobClient. More... | |
BlobClient (const std::string &blobUri, const BlobClientOptions &options=BlobClientOptions()) | |
Initialize a new instance of BlobClient. More... | |
BlockBlobClient | GetBlockBlobClient () const |
Creates a new BlockBlobClient object with the same uri as this BlobClient. The new BlockBlobClient uses the same request policy pipeline as this BlobClient. More... | |
AppendBlobClient | GetAppendBlobClient () const |
Creates a new AppendBlobClient object with the same uri as this BlobClient. The new AppendBlobClient uses the same request policy pipeline as this BlobClient. More... | |
PageBlobClient | GetPageBlobClient () const |
Creates a new PageBlobClient object with the same uri as this BlobClient. The new PageBlobClient uses the same request policy pipeline as this BlobClient. More... | |
std::string | GetUri () const |
Gets the blob's primary uri endpoint. More... | |
BlobClient | WithSnapshot (const std::string &snapshot) const |
Initializes a new instance of the BlobClient class with an identical uri 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::Core::Response< GetBlobPropertiesResult > | GetProperties (const GetBlobPropertiesOptions &options=GetBlobPropertiesOptions()) 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::Core::Response< SetBlobHttpHeadersResult > | SetHttpHeaders (BlobHttpHeaders httpHeaders, const SetBlobHttpHeadersOptions &options=SetBlobHttpHeadersOptions()) const |
Sets system properties on the blob. More... | |
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. More... | |
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 a block blob in a blob storage or general purpose v2 account. More... | |
Azure::Core::Response< StartCopyBlobFromUriResult > | StartCopyFromUri (const std::string &sourceUri, const StartCopyBlobFromUriOptions &options=StartCopyBlobFromUriOptions()) const |
Copies data at from the source to this blob. More... | |
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. More... | |
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. More... | |
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. More... | |
Azure::Core::Response< DownloadBlobToResult > | DownloadTo (const std::string &file, const DownloadBlobToOptions &options=DownloadBlobToOptions()) const |
Downloads a blob or a blob range from the service to a file using parallel requests. More... | |
Azure::Core::Response< CreateBlobSnapshotResult > | CreateSnapshot (const CreateBlobSnapshotOptions &options=CreateBlobSnapshotOptions()) const |
Creates a read-only snapshot of a blob. More... | |
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 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::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. More... | |
Azure::Core::Response< AcquireBlobLeaseResult > | AcquireLease (const std::string &proposedLeaseId, int32_t duration, const AcquireBlobLeaseOptions &options=AcquireBlobLeaseOptions()) const |
Acquires a lease on the blob. More... | |
Azure::Core::Response< RenewBlobLeaseResult > | RenewLease (const std::string &leaseId, const RenewBlobLeaseOptions &options=RenewBlobLeaseOptions()) const |
Renews the blob's previously-acquired lease. More... | |
Azure::Core::Response< ReleaseBlobLeaseResult > | ReleaseLease (const std::string &leaseId, const ReleaseBlobLeaseOptions &options=ReleaseBlobLeaseOptions()) const |
Releases the blob's previously-acquired lease. More... | |
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. More... | |
Azure::Core::Response< BreakBlobLeaseResult > | BreakLease (const BreakBlobLeaseOptions &options=BreakBlobLeaseOptions()) const |
Breaks the previously-acquired lease. More... | |
Azure::Core::Response< SetBlobTagsResult > | SetTags (std::map< std::string, std::string > tags, const SetBlobTagsOptions &options=SetBlobTagsOptions()) const |
Sets tags on the underlying blob. More... | |
Azure::Core::Response< GetBlobTagsResult > | GetTags (const GetBlobTagsOptions &options=GetBlobTagsOptions()) const |
Gets the tags associated with the underlying blob. More... | |
Static Public Member Functions | |
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. More... | |
Protected Attributes | |
Azure::Core::Http::Url | m_blobUrl |
std::shared_ptr< Azure::Core::Http::HttpPipeline > | m_pipeline |
Azure::Core::Nullable< EncryptionKey > | m_customerProvidedKey |
Azure::Core::Nullable< std::string > | m_encryptionScope |
Friends | |
class | BlobContainerClient |
class | Files::DataLake::DirectoryClient |
class | Files::DataLake::FileClient |
The BlobClient allows you to manipulate Azure Storage blobs.
|
explicit |
Initialize a new instance of BlobClient.
blobUri | A uri 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 |
Initialize a new instance of BlobClient.
blobUri | A uri referencing the blob that includes the name of the account, the name of the container, and the name of the blob. |
credential | The client secret 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 |
Initialize a new instance of BlobClient.
blobUri | A uri 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::Core::Response< AbortCopyBlobFromUriResult > Azure::Storage::Blobs::BlobClient::AbortCopyFromUri | ( | const std::string & | copyId, |
const AbortCopyBlobFromUriOptions & | options = AbortCopyBlobFromUriOptions() |
||
) | const |
Aborts a pending StartCopyFromUri operation, and leaves this blob with zero length and full metadata.
copyId | ID of the copy operation to abort. |
options | Optional parameters to execute this function. |
Azure::Core::Response< AcquireBlobLeaseResult > Azure::Storage::Blobs::BlobClient::AcquireLease | ( | const std::string & | proposedLeaseId, |
int32_t | duration, | ||
const AcquireBlobLeaseOptions & | options = AcquireBlobLeaseOptions() |
||
) | const |
Acquires a lease on the blob.
proposedLeaseId | Proposed lease ID, in a GUID string format. |
duration | Specifies the duration of the lease, in seconds, or Azure::Storage::c_InfiniteLeaseDuration for a lease that never expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or change. |
options | Optional parameters to execute this function. |
Azure::Core::Response< BreakBlobLeaseResult > Azure::Storage::Blobs::BlobClient::BreakLease | ( | const BreakBlobLeaseOptions & | options = BreakBlobLeaseOptions() | ) | const |
Breaks the previously-acquired lease.
options | Optional parameters to execute this function. |
Azure::Core::Response< ChangeBlobLeaseResult > Azure::Storage::Blobs::BlobClient::ChangeLease | ( | const std::string & | leaseId, |
const std::string & | proposedLeaseId, | ||
const ChangeBlobLeaseOptions & | options = ChangeBlobLeaseOptions() |
||
) | const |
Changes the lease of an active lease.
leaseId | ID of the previously-acquired lease. |
proposedLeaseId | Proposed lease ID, in a GUID string format. |
options | Optional parameters to execute this function. |
|
static |
Initialize a new instance of BlobClient.
connectionString | A connection string includes the authentication information required for your application to access data in an Azure Storage account at runtime. |
containerName | 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::Core::Response< CreateBlobSnapshotResult > Azure::Storage::Blobs::BlobClient::CreateSnapshot | ( | const CreateBlobSnapshotOptions & | options = CreateBlobSnapshotOptions() | ) | const |
Creates a read-only snapshot of a blob.
options | Optional parameters to execute this function. |
Azure::Core::Response< DeleteBlobResult > Azure::Storage::Blobs::BlobClient::Delete | ( | const DeleteBlobOptions & | options = DeleteBlobOptions() | ) | 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.
options | Optional parameters to execute this function. |
Azure::Core::Response< DownloadBlobResult > Azure::Storage::Blobs::BlobClient::Download | ( | const DownloadBlobOptions & | options = DownloadBlobOptions() | ) | const |
Downloads a blob or a blob range from the service, including its metadata and properties.
options | Optional parameters to execute this function. |
Azure::Core::Response< DownloadBlobToResult > Azure::Storage::Blobs::BlobClient::DownloadTo | ( | const std::string & | file, |
const DownloadBlobToOptions & | options = DownloadBlobToOptions() |
||
) | const |
Downloads a blob or a blob range from the service to a file using parallel requests.
file | A file path to write the downloaded content to. |
options | Optional parameters to execute this function. |
Azure::Core::Response< DownloadBlobToResult > Azure::Storage::Blobs::BlobClient::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.
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. |
AppendBlobClient Azure::Storage::Blobs::BlobClient::GetAppendBlobClient | ( | ) | const |
Creates a new AppendBlobClient object with the same uri as this BlobClient. The new AppendBlobClient uses the same request policy pipeline as this BlobClient.
BlockBlobClient Azure::Storage::Blobs::BlobClient::GetBlockBlobClient | ( | ) | const |
Creates a new BlockBlobClient object with the same uri as this BlobClient. The new BlockBlobClient uses the same request policy pipeline as this BlobClient.
PageBlobClient Azure::Storage::Blobs::BlobClient::GetPageBlobClient | ( | ) | const |
Creates a new PageBlobClient object with the same uri as this BlobClient. The new PageBlobClient uses the same request policy pipeline as this BlobClient.
Azure::Core::Response< GetBlobPropertiesResult > Azure::Storage::Blobs::BlobClient::GetProperties | ( | const GetBlobPropertiesOptions & | options = GetBlobPropertiesOptions() | ) | const |
Returns all user-defined metadata, standard HTTP properties, and system properties for the blob. It does not return the content of the blob.
options | Optional parameters to execute this function. |
Azure::Core::Response< GetBlobTagsResult > Azure::Storage::Blobs::BlobClient::GetTags | ( | const GetBlobTagsOptions & | options = GetBlobTagsOptions() | ) | const |
Gets the tags associated with the underlying blob.
options | Optional parameters to execute this function. |
|
inline |
Azure::Core::Response< ReleaseBlobLeaseResult > Azure::Storage::Blobs::BlobClient::ReleaseLease | ( | const std::string & | leaseId, |
const ReleaseBlobLeaseOptions & | options = ReleaseBlobLeaseOptions() |
||
) | const |
Releases the blob's previously-acquired lease.
leaseId | ID of the previously-acquired lease. |
options | Optional parameters to execute this function. |
Azure::Core::Response< RenewBlobLeaseResult > Azure::Storage::Blobs::BlobClient::RenewLease | ( | const std::string & | leaseId, |
const RenewBlobLeaseOptions & | options = RenewBlobLeaseOptions() |
||
) | const |
Renews the blob's previously-acquired lease.
leaseId | ID of the previously-acquired lease. |
options | Optional parameters to execute this function. |
Azure::Core::Response< SetBlobAccessTierResult > Azure::Storage::Blobs::BlobClient::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 a block blob in a blob storage or general purpose v2 account.
Tier | Indicates the tier to be set on the blob. |
options | Optional parameters to execute this function. |
Azure::Core::Response< SetBlobHttpHeadersResult > Azure::Storage::Blobs::BlobClient::SetHttpHeaders | ( | BlobHttpHeaders | httpHeaders, |
const SetBlobHttpHeadersOptions & | options = SetBlobHttpHeadersOptions() |
||
) | const |
Sets system properties on the blob.
httpHeaders | The standard HTTP header system properties to set. |
options | Optional parameters to execute this function. |
Azure::Core::Response< SetBlobMetadataResult > Azure::Storage::Blobs::BlobClient::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.
metadata | Custom metadata to set for this blob. |
options | Optional parameters to execute this function. |
Azure::Core::Response< SetBlobTagsResult > Azure::Storage::Blobs::BlobClient::SetTags | ( | std::map< std::string, std::string > | tags, |
const SetBlobTagsOptions & | options = SetBlobTagsOptions() |
||
) | const |
Sets tags on the underlying blob.
tags | The tags to set on the blob. |
options | Optional parameters to execute this function. |
Azure::Core::Response< StartCopyBlobFromUriResult > Azure::Storage::Blobs::BlobClient::StartCopyFromUri | ( | const std::string & | sourceUri, |
const StartCopyBlobFromUriOptions & | options = StartCopyBlobFromUriOptions() |
||
) | const |
Copies data at from the source to this blob.
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. |
Azure::Core::Response< UndeleteBlobResult > Azure::Storage::Blobs::BlobClient::Undelete | ( | const UndeleteBlobOptions & | options = UndeleteBlobOptions() | ) | const |
Restores the contents and metadata of a soft deleted blob and any associated soft deleted snapshots.
options | Optional parameters to execute this function. |
BlobClient Azure::Storage::Blobs::BlobClient::WithSnapshot | ( | const std::string & | snapshot | ) | const |
Initializes a new instance of the BlobClient class with an identical uri source but the specified snapshot timestamp.
snapshot | The snapshot identifier. |
BlobClient Azure::Storage::Blobs::BlobClient::WithVersionId | ( | const std::string & | versionId | ) | const |
Creates a clone of this instance that references a version ID rather than the base blob.
versionId | The version ID returning a URL to the base blob. |