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

#include <blob_container_client.hpp>

Public Member Functions

 BlobContainerClient (const std::string &blobContainerUrl, std::shared_ptr< StorageSharedKeyCredential > credential, const BlobClientOptions &options=BlobClientOptions())
 Initialize a new instance of BlobContainerClient. More...
 
 BlobContainerClient (const std::string &blobContainerUrl, std::shared_ptr< Core::Credentials::TokenCredential > credential, const BlobClientOptions &options=BlobClientOptions())
 Initialize a new instance of BlobContainerClient. More...
 
 BlobContainerClient (const std::string &blobContainerUrl, const BlobClientOptions &options=BlobClientOptions())
 Initialize a new instance of BlobContainerClient. More...
 
BlobClient GetBlobClient (const std::string &blobName) const
 Create a new BlobClient object by appending blobName to the end of URL. The new BlobClient uses the same request policy pipeline as this BlobContainerClient. More...
 
BlockBlobClient GetBlockBlobClient (const std::string &blobName) const
 Create a new BlockBlobClient object by appending blobName to the end of URL. The new BlockBlobClient uses the same request policy pipeline as this BlobContainerClient. More...
 
AppendBlobClient GetAppendBlobClient (const std::string &blobName) const
 Create a new AppendBlobClient object by appending blobName to the end of URL. The new AppendBlobClient uses the same request policy pipeline as this BlobContainerClient. More...
 
PageBlobClient GetPageBlobClient (const std::string &blobName) const
 Create a new PageBlobClient object by appending blobName to the end of URL. The new PageBlobClient uses the same request policy pipeline as this BlobContainerClient. More...
 
std::string GetUrl () const
 Gets the container's primary URL endpoint. More...
 
Azure::Response< Models::CreateBlobContainerResultCreate (const CreateBlobContainerOptions &options=CreateBlobContainerOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Creates a new container under the specified account. If the container with the same name already exists, the operation fails. More...
 
Azure::Response< Models::CreateBlobContainerResultCreateIfNotExists (const CreateBlobContainerOptions &options=CreateBlobContainerOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Creates a new container under the specified account. If the container with the same name already exists, it is not changed. More...
 
Azure::Response< Models::DeleteBlobContainerResultDelete (const DeleteBlobContainerOptions &options=DeleteBlobContainerOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Marks the specified container for deletion. The container and any blobs contained within it are later deleted during garbage collection. More...
 
Azure::Response< Models::DeleteBlobContainerResultDeleteIfExists (const DeleteBlobContainerOptions &options=DeleteBlobContainerOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Marks the specified container for deletion if it exists. The container and any blobs contained within it are later deleted during garbage collection. More...
 
Azure::Response< Models::BlobContainerPropertiesGetProperties (const GetBlobContainerPropertiesOptions &options=GetBlobContainerPropertiesOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Returns all user-defined metadata and system properties for the specified container. The data returned does not include the container's list of blobs. More...
 
Azure::Response< Models::SetBlobContainerMetadataResultSetMetadata (Metadata metadata, SetBlobContainerMetadataOptions options=SetBlobContainerMetadataOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Sets one or more user-defined name-value pairs for the specified container. More...
 
ListBlobsPagedResponse ListBlobs (const ListBlobsOptions &options=ListBlobsOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Returns a sequence of blobs in this container. Enumerating the blobs may make multiple requests to the service while fetching all the values. Blobs are ordered lexicographically by name. More...
 
ListBlobsByHierarchyPagedResponse ListBlobsByHierarchy (const std::string &delimiter, const ListBlobsOptions &options=ListBlobsOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Returns a collection of blobs in this container. Enumerating the blobs may make multiple requests to the service while fetching all the values. Blobs are ordered lexicographically by name. A delimiter can be used to traverse a virtual hierarchy of blobs as though it were a file system. More...
 
Azure::Response< Models::BlobContainerAccessPolicyGetAccessPolicy (const GetBlobContainerAccessPolicyOptions &options=GetBlobContainerAccessPolicyOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Gets the permissions for this container. The permissions indicate whether container data may be accessed publicly. More...
 
Azure::Response< Models::SetBlobContainerAccessPolicyResultSetAccessPolicy (const SetBlobContainerAccessPolicyOptions &options=SetBlobContainerAccessPolicyOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Sets the permissions for the specified container. The permissions indicate whether blob container data may be accessed publicly. More...
 
Azure::Response< Models::DeleteBlobResultDeleteBlob (const std::string &blobName, 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< BlockBlobClientUploadBlob (const std::string &blobName, Azure::Core::IO::BodyStream &content, const UploadBlockBlobOptions &options=UploadBlockBlobOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Creates a new block blob under this container. For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or see PageBlobClient or AppendBlobClient. More...
 

Static Public Member Functions

static BlobContainerClient CreateFromConnectionString (const std::string &connectionString, const std::string &blobContainerName, const BlobClientOptions &options=BlobClientOptions())
 Initialize a new instance of BlobContainerClient. More...
 

Friends

class BlobServiceClient
 
class BlobLeaseClient
 

Detailed Description

The BlobContainerClient allows you to manipulate Azure Storage containers and their blobs.

Constructor & Destructor Documentation

◆ BlobContainerClient() [1/3]

Azure::Storage::Blobs::BlobContainerClient::BlobContainerClient ( const std::string &  blobContainerUrl,
std::shared_ptr< StorageSharedKeyCredential >  credential,
const BlobClientOptions options = BlobClientOptions() 
)
explicit
Parameters
blobContainerUrlA url referencing the blob container that includes the name of the account and the name of the container.
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.

◆ BlobContainerClient() [2/3]

Azure::Storage::Blobs::BlobContainerClient::BlobContainerClient ( const std::string &  blobContainerUrl,
std::shared_ptr< Core::Credentials::TokenCredential >  credential,
const BlobClientOptions options = BlobClientOptions() 
)
explicit
Parameters
blobContainerUrlA url referencing the blob container that includes the name of the account and the name of the container.
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.

◆ BlobContainerClient() [3/3]

Azure::Storage::Blobs::BlobContainerClient::BlobContainerClient ( const std::string &  blobContainerUrl,
const BlobClientOptions options = BlobClientOptions() 
)
explicit
Parameters
blobContainerUrlA url referencing the blob that includes the name of the account and the name of the container, 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

◆ Create()

Azure::Response< Models::CreateBlobContainerResult > Azure::Storage::Blobs::BlobContainerClient::Create ( const CreateBlobContainerOptions options = CreateBlobContainerOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A CreateBlobContainerResult describing the newly created blob container.

◆ CreateFromConnectionString()

BlobContainerClient Azure::Storage::Blobs::BlobContainerClient::CreateFromConnectionString ( const std::string &  connectionString,
const std::string &  blobContainerName,
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.
optionsOptional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request.
Returns
A new BlobContainerClient instance.

◆ CreateIfNotExists()

Azure::Response< Models::CreateBlobContainerResult > Azure::Storage::Blobs::BlobContainerClient::CreateIfNotExists ( const CreateBlobContainerOptions options = CreateBlobContainerOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A CreateBlobContainerResult describing the newly created blob container if the container doesn't exist. CreateBlobContainerResult.Created is false if the container already exists.

◆ Delete()

Azure::Response< Models::DeleteBlobContainerResult > Azure::Storage::Blobs::BlobContainerClient::Delete ( const DeleteBlobContainerOptions options = DeleteBlobContainerOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A DeleteBlobContainerResult if successful.

◆ DeleteBlob()

Azure::Response< Models::DeleteBlobResult > Azure::Storage::Blobs::BlobContainerClient::DeleteBlob ( const std::string &  blobName,
const DeleteBlobOptions options = DeleteBlobOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
blobNameThe name of the blob to delete.
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A DeleteBlobResult on successfully deleting.

◆ DeleteIfExists()

Azure::Response< Models::DeleteBlobContainerResult > Azure::Storage::Blobs::BlobContainerClient::DeleteIfExists ( const DeleteBlobContainerOptions options = DeleteBlobContainerOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A DeleteBlobContainerResult if the container exists. DeleteBlobContainerResult.Deleted is false if the container doesn't exist.

◆ GetAccessPolicy()

Azure::Response< Models::BlobContainerAccessPolicy > Azure::Storage::Blobs::BlobContainerClient::GetAccessPolicy ( const GetBlobContainerAccessPolicyOptions options = GetBlobContainerAccessPolicyOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A BlobContainerAccessPolicy describing the container's access policy.

◆ GetAppendBlobClient()

AppendBlobClient Azure::Storage::Blobs::BlobContainerClient::GetAppendBlobClient ( const std::string &  blobName) const
Parameters
blobNameThe name of the blob.
Returns
A new AppendBlobClient instance.

◆ GetBlobClient()

BlobClient Azure::Storage::Blobs::BlobContainerClient::GetBlobClient ( const std::string &  blobName) const
Parameters
blobNameThe name of the blob.
Returns
A new BlobClient instance.

◆ GetBlockBlobClient()

BlockBlobClient Azure::Storage::Blobs::BlobContainerClient::GetBlockBlobClient ( const std::string &  blobName) const
Parameters
blobNameThe name of the blob.
Returns
A new BlockBlobClient instance.

◆ GetPageBlobClient()

PageBlobClient Azure::Storage::Blobs::BlobContainerClient::GetPageBlobClient ( const std::string &  blobName) const
Parameters
blobNameThe name of the blob.
Returns
A new PageBlobClient instance.

◆ GetProperties()

Azure::Response< Models::BlobContainerProperties > Azure::Storage::Blobs::BlobContainerClient::GetProperties ( const GetBlobContainerPropertiesOptions options = GetBlobContainerPropertiesOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A BlobContainerProperties describing the container and its properties.

◆ GetUrl()

std::string Azure::Storage::Blobs::BlobContainerClient::GetUrl ( ) const
inline
Returns
The container's primary URL endpoint.

◆ ListBlobs()

ListBlobsPagedResponse Azure::Storage::Blobs::BlobContainerClient::ListBlobs ( const ListBlobsOptions options = ListBlobsOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A ListBlobsPagedResponse describing the blobs in the container.

◆ ListBlobsByHierarchy()

ListBlobsByHierarchyPagedResponse Azure::Storage::Blobs::BlobContainerClient::ListBlobsByHierarchy ( const std::string &  delimiter,
const ListBlobsOptions options = ListBlobsOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
delimiterThis can be used to to traverse a virtual hierarchy of blobs as though it were a file system. The delimiter may be a single character or a string.
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A ListBlobsByHierarchyPagedResponse describing the blobs in the container.

◆ SetAccessPolicy()

Azure::Response< Models::SetBlobContainerAccessPolicyResult > Azure::Storage::Blobs::BlobContainerClient::SetAccessPolicy ( const SetBlobContainerAccessPolicyOptions options = SetBlobContainerAccessPolicyOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A SetBlobContainerAccessPolicyResult describing the updated container.

◆ SetMetadata()

Azure::Response< Models::SetBlobContainerMetadataResult > Azure::Storage::Blobs::BlobContainerClient::SetMetadata ( Metadata  metadata,
SetBlobContainerMetadataOptions  options = SetBlobContainerMetadataOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
metadataCustom metadata to set for this container.
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A SetBlobContainerMetadataResult if successful.

◆ UploadBlob()

Azure::Response< BlockBlobClient > Azure::Storage::Blobs::BlobContainerClient::UploadBlob ( const std::string &  blobName,
Azure::Core::IO::BodyStream &  content,
const UploadBlockBlobOptions options = UploadBlockBlobOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
blobNameThe name of the blob to create.
contentA BodyStream containing the content to upload.
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
A BlockBlobClient referencing the newly created block blob.

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