azure-storage-blobs
Public Member Functions | Static Public Member Functions | Friends | List of all members
Azure::Storage::Blobs::PageBlobClient Class Referencefinal

#include <page_blob_client.hpp>

Inheritance diagram for Azure::Storage::Blobs::PageBlobClient:
Azure::Storage::Blobs::BlobClient

Public Member Functions

 PageBlobClient (const std::string &blobUrl, std::shared_ptr< StorageSharedKeyCredential > credential, const BlobClientOptions &options=BlobClientOptions())
 Initialize a new instance of PageBlobClient. More...
 
 PageBlobClient (const std::string &blobUrl, std::shared_ptr< Core::Credentials::TokenCredential > credential, const BlobClientOptions &options=BlobClientOptions())
 Initialize a new instance of PageBlobClient. More...
 
 PageBlobClient (const std::string &blobUrl, const BlobClientOptions &options=BlobClientOptions())
 Initialize a new instance of PageBlobClient. More...
 
PageBlobClient WithSnapshot (const std::string &snapshot) const
 Initializes a new instance of the PageBlobClient class with an identical URL source but the specified snapshot timestamp. More...
 
PageBlobClient 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::CreatePageBlobResultCreate (int64_t blobSize, const CreatePageBlobOptions &options=CreatePageBlobOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Creates a new page blob of the specified size. The content of any existing blob is overwritten with the newly initialized page blob. More...
 
Azure::Response< Models::CreatePageBlobResultCreateIfNotExists (int64_t blobContentLength, const CreatePageBlobOptions &options=CreatePageBlobOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Creates a new page blob of the specified size. The content keeps unchanged if the blob already exists. More...
 
Azure::Response< Models::UploadPagesResultUploadPages (int64_t offset, Azure::Core::IO::BodyStream &content, const UploadPagesOptions &options=UploadPagesOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Writes content to a range of pages in a page blob, starting at offset. More...
 
Azure::Response< Models::UploadPagesFromUriResultUploadPagesFromUri (int64_t destinationOffset, std::string sourceUri, Azure::Core::Http::HttpRange sourceRange, const UploadPagesFromUriOptions &options=UploadPagesFromUriOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Writes a range of pages to a page blob where the contents are read from a uri. More...
 
Azure::Response< Models::ClearPagesResultClearPages (Azure::Core::Http::HttpRange range, const ClearPagesOptions &options=ClearPagesOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Clears one or more pages from the page blob, as specificed by range. More...
 
Azure::Response< Models::ResizePageBlobResultResize (int64_t blobSize, const ResizePageBlobOptions &options=ResizePageBlobOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Resizes the page blob to the specified size (which must be a multiple of 512). If the specified value is less than the current size of the blob, then all pages above the specified value are cleared. More...
 
GetPageRangesPagedResponse GetPageRanges (const GetPageRangesOptions &options=GetPageRangesOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Returns the list of valid page ranges for a page blob or snapshot of a page blob. More...
 
GetPageRangesDiffPagedResponse GetPageRangesDiff (const std::string &previousSnapshot, const GetPageRangesOptions &options=GetPageRangesOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Returns the list of page ranges that differ between a previous snapshot and this page blob. Changes include both updated and cleared pages. More...
 
GetPageRangesDiffPagedResponse GetManagedDiskPageRangesDiff (const std::string &previousSnapshotUrl, const GetPageRangesOptions &options=GetPageRangesOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Returns the list of page ranges that differ between a previous snapshot URL and this page blob. Changes include both updated and cleared pages. This API only works with managed disk storage accounts. More...
 
StartBlobCopyOperation StartCopyIncremental (const std::string &sourceUri, const StartBlobCopyIncrementalOptions &options=StartBlobCopyIncrementalOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Starts copying a snapshot of the sourceUri page blob to this page blob. The snapshot is copied such that only the differential changes between the previously copied snapshot are transferred to the destination. The copied snapshots are complete copies of the original snapshot and can be read or copied from as usual. More...
 
- Public Member Functions inherited from Azure::Storage::Blobs::BlobClient
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::BlobPropertiesGetProperties (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::SetBlobHttpHeadersResultSetHttpHeaders (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::SetBlobMetadataResultSetMetadata (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::SetBlobAccessTierResultSetAccessTier (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::AbortBlobCopyFromUriResultAbortCopyFromUri (const std::string &copyId, 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::DownloadBlobResultDownload (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::DownloadBlobToResultDownloadTo (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::DownloadBlobToResultDownloadTo (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::CreateBlobSnapshotResultCreateSnapshot (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::DeleteBlobResultDelete (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::DeleteBlobResultDeleteIfExists (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::UndeleteBlobResultUndelete (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::SetBlobTagsResultSetTags (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 PageBlobClient CreateFromConnectionString (const std::string &connectionString, const std::string &blobContainerName, const std::string &blobName, const BlobClientOptions &options=BlobClientOptions())
 Initialize a new instance of PageBlobClient. More...
 
- Static Public Member Functions inherited from Azure::Storage::Blobs::BlobClient
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...
 

Friends

class BlobClient
 

Additional Inherited Members

- Protected Attributes inherited from Azure::Storage::Blobs::BlobClient
Azure::Core::Url m_blobUrl
 
std::shared_ptr< Azure::Core::Http::_internal::HttpPipeline > m_pipeline
 
Azure::Nullable< EncryptionKeym_customerProvidedKey
 
Azure::Nullable< std::string > m_encryptionScope
 

Detailed Description

The PageBlobClient allows you to manipulate Azure Storage page blobs.

Page blobs are a collection of 512-byte pages optimized for random read and write operations. To create a page blob, you initialize the page blob and specify the maximum size the page blob will grow. To add or update the contents of a page blob, you write a page or pages by specifying an offset and a range that align to 512-byte page boundaries. Writes to page blobs happen in-place and are immediately committed to the blob.

Constructor & Destructor Documentation

◆ PageBlobClient() [1/3]

Azure::Storage::Blobs::PageBlobClient::PageBlobClient ( const std::string &  blobUrl,
std::shared_ptr< StorageSharedKeyCredential >  credential,
const BlobClientOptions options = BlobClientOptions() 
)
explicit
Parameters
blobUrlA URL referencing the blob that includes the name of the account, the name of the container, and the name of the blob.
credentialThe shared key credential used to sign requests.
optionsOptional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request.

◆ PageBlobClient() [2/3]

Azure::Storage::Blobs::PageBlobClient::PageBlobClient ( const std::string &  blobUrl,
std::shared_ptr< Core::Credentials::TokenCredential >  credential,
const BlobClientOptions options = BlobClientOptions() 
)
explicit
Parameters
blobUrlA URL referencing the blob that includes the name of the account, the name of the container, and the name of the blob.
credentialThe token credential used to sign requests.
optionsOptional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request.

◆ PageBlobClient() [3/3]

Azure::Storage::Blobs::PageBlobClient::PageBlobClient ( const std::string &  blobUrl,
const BlobClientOptions options = BlobClientOptions() 
)
explicit
Parameters
blobUrlA 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.
optionsOptional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request.

Member Function Documentation

◆ ClearPages()

Azure::Response< Models::ClearPagesResult > Azure::Storage::Blobs::PageBlobClient::ClearPages ( Azure::Core::Http::HttpRange  range,
const ClearPagesOptions options = ClearPagesOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
rangeSpecifies the range of bytes to be cleared. Both the start and end of the range must be specified. For a page clear operation, the page range can be up to the value of the blob's full size. Given that pages must be aligned with 512-byte boundaries, the start and length of the range must be a modulus of 512.
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A ClearPagesResult describing the state of the updated pages.

◆ Create()

Azure::Response< Models::CreatePageBlobResult > Azure::Storage::Blobs::PageBlobClient::Create ( int64_t  blobSize,
const CreatePageBlobOptions options = CreatePageBlobOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
blobSizeSpecifies the maximum size for the page blob. The size must be aligned to a 512-byte boundary.
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A CreatePageBlobResult describing the newly created page blob.

◆ CreateFromConnectionString()

PageBlobClient Azure::Storage::Blobs::PageBlobClient::CreateFromConnectionString ( const std::string &  connectionString,
const std::string &  blobContainerName,
const std::string &  blobName,
const BlobClientOptions options = BlobClientOptions() 
)
static
Parameters
connectionStringA connection string includes the authentication information required for your application to access data in an Azure Storage account at runtime.
blobContainerNameThe name of the container containing this blob.
blobNameThe name of this blob.
optionsOptional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request.
Returns
A new PageBlobClient instance.

◆ CreateIfNotExists()

Azure::Response< Models::CreatePageBlobResult > Azure::Storage::Blobs::PageBlobClient::CreateIfNotExists ( int64_t  blobContentLength,
const CreatePageBlobOptions options = CreatePageBlobOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
blobContentLengthSpecifies the maximum size for the page blob. The size must be aligned to a 512-byte boundary.
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A CreatePageBlobResult describing the newly created page blob. CreatePageBlobResult.Created is false if the blob already exists.

◆ GetManagedDiskPageRangesDiff()

GetPageRangesDiffPagedResponse Azure::Storage::Blobs::PageBlobClient::GetManagedDiskPageRangesDiff ( const std::string &  previousSnapshotUrl,
const GetPageRangesOptions options = GetPageRangesOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
previousSnapshotUrlThis parameter only works with managed disk storage accounts. Specifies that the response will contain only pages that were changed between target blob and previous snapshot. Changed pages include both updated and cleared pages. The target blob may be a snapshot, as long as the snapshot specified by previousSnapshotUrl is the older of the two.
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A GetPageRangesResult describing the valid page ranges for this blob.

◆ GetPageRanges()

GetPageRangesPagedResponse Azure::Storage::Blobs::PageBlobClient::GetPageRanges ( const GetPageRangesOptions options = GetPageRangesOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A GetPageRangesResult describing the valid page ranges for this blob.

◆ GetPageRangesDiff()

GetPageRangesDiffPagedResponse Azure::Storage::Blobs::PageBlobClient::GetPageRangesDiff ( const std::string &  previousSnapshot,
const GetPageRangesOptions options = GetPageRangesOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
previousSnapshotSpecifies that the response will contain only pages that were changed between target blob and previous snapshot. Changed pages include both updated and cleared pages. The target blob may be a snapshot, as long as the snapshot specified by previousSnapshot is the older of the two.
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A GetPageRangesResult describing the valid page ranges for this blob.

◆ Resize()

Azure::Response< Models::ResizePageBlobResult > Azure::Storage::Blobs::PageBlobClient::Resize ( int64_t  blobSize,
const ResizePageBlobOptions options = ResizePageBlobOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
blobSizeSpecifies the maximum size for the page blob. The size must be aligned to a 512-byte boundary.
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A ResizePageBlobResult describing the resized page blob.

◆ StartCopyIncremental()

StartBlobCopyOperation Azure::Storage::Blobs::PageBlobClient::StartCopyIncremental ( const std::string &  sourceUri,
const StartBlobCopyIncrementalOptions options = StartBlobCopyIncrementalOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
sourceUriSpecifies the to the source page blob as a uri up to 2 KB in length. The source blob must either be public or must be authenticated via a shared access signature.
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A StartBlobCopyOperation describing the state of the copy operation.

◆ UploadPages()

Azure::Response< Models::UploadPagesResult > Azure::Storage::Blobs::PageBlobClient::UploadPages ( int64_t  offset,
Azure::Core::IO::BodyStream &  content,
const UploadPagesOptions options = UploadPagesOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
offsetSpecifies the starting offset for the content to be written as a page. Given that pages must be aligned with 512-byte boundaries, the start offset must be a modulus of 512.
contentA BodyStream containing the content of the pages to upload.
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A UploadPagesResult describing the state of the updated pages.

◆ UploadPagesFromUri()

Azure::Response< Models::UploadPagesFromUriResult > Azure::Storage::Blobs::PageBlobClient::UploadPagesFromUri ( int64_t  destinationOffset,
std::string  sourceUri,
Azure::Core::Http::HttpRange  sourceRange,
const UploadPagesFromUriOptions options = UploadPagesFromUriOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
destinationOffsetSpecifies the starting offset for the content to be written. Given that pages must be aligned with 512-byte boundaries, the start offset must be a modulus of 512.
sourceUriSpecifies the uri of the source blob. The value may be a uri of up to 2 KB in length that specifies a blob. 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 operation.
sourceRangeOnly upload the bytes of the blob in the sourceUri in the specified range.
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A UploadPagesFromUriResult describing the state of the updated pages.

◆ WithSnapshot()

PageBlobClient Azure::Storage::Blobs::PageBlobClient::WithSnapshot ( const std::string &  snapshot) const
Parameters
snapshotThe snapshot identifier.
Returns
A new PageBlobClient instance.
Remarks
Pass empty string to remove the snapshot returning the base blob.

◆ WithVersionId()

PageBlobClient Azure::Storage::Blobs::PageBlobClient::WithVersionId ( const std::string &  versionId) const
Parameters
versionIdThe version ID returning a URL to the base blob.
Returns
A new PageBlobClient instance.
Remarks
Pass empty string to remove the version ID returning the base blob.

The documentation for this class was generated from the following files: