azure-storage-blobs
Loading...
Searching...
No Matches
block_blob_client.hpp
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4#pragma once
5
6#include "azure/storage/blobs/blob_client.hpp"
7
8#include <cstdint>
9#include <string>
10#include <vector>
11
12namespace Azure { namespace Storage { namespace Files { namespace DataLake {
13 class FileClient;
14}}}} // namespace Azure::Storage::Files::DataLake
15
16namespace Azure { namespace Storage { namespace Blobs {
17
31 class BlockBlobClient final : public BlobClient {
32 public:
45 const std::string& connectionString,
46 const std::string& blobContainerName,
47 const std::string& blobName,
48 const BlobClientOptions& options = BlobClientOptions());
49
62 const std::string& blobUrl,
63 std::shared_ptr<StorageSharedKeyCredential> credential,
64 const BlobClientOptions& options = BlobClientOptions());
65
77 const std::string& blobUrl,
78 std::shared_ptr<const Core::Credentials::TokenCredential> credential,
79 const BlobClientOptions& options = BlobClientOptions());
80
92 const std::string& blobUrl,
93 const BlobClientOptions& options = BlobClientOptions());
94
104 BlockBlobClient WithSnapshot(const std::string& snapshot) const;
105
114 BlockBlobClient WithVersionId(const std::string& versionId) const;
115
125 Azure::Response<Models::UploadBlockBlobResult> Upload(
126 Azure::Core::IO::BodyStream& content,
128 const Azure::Core::Context& context = Azure::Core::Context()) const;
129
140 Azure::Response<Models::UploadBlockBlobFromResult> UploadFrom(
141 const uint8_t* buffer,
142 size_t bufferSize,
144 const Azure::Core::Context& context = Azure::Core::Context()) const;
145
155 Azure::Response<Models::UploadBlockBlobFromResult> UploadFrom(
156 const std::string& fileName,
158 const Azure::Core::Context& context = Azure::Core::Context()) const;
159
168 Azure::Response<Models::UploadBlockBlobFromUriResult> UploadFromUri(
169 const std::string& sourceUri,
171 const Azure::Core::Context& context = Azure::Core::Context()) const;
172
184 Azure::Response<Models::StageBlockResult> StageBlock(
185 const std::string& blockId,
186 Azure::Core::IO::BodyStream& content,
187 const StageBlockOptions& options = StageBlockOptions(),
188 const Azure::Core::Context& context = Azure::Core::Context()) const;
189
204 Azure::Response<Models::StageBlockFromUriResult> StageBlockFromUri(
205 const std::string& blockId,
206 const std::string& sourceUri,
208 const Azure::Core::Context& context = Azure::Core::Context()) const;
209
224 Azure::Response<Models::CommitBlockListResult> CommitBlockList(
225 const std::vector<std::string>& blockIds,
227 const Azure::Core::Context& context = Azure::Core::Context()) const;
228
240 Azure::Response<Models::GetBlockListResult> GetBlockList(
241 const GetBlockListOptions& options = GetBlockListOptions(),
242 const Azure::Core::Context& context = Azure::Core::Context()) const;
243
252 Azure::Response<Models::QueryBlobResult> Query(
253 const std::string& querySqlExpression,
254 const QueryBlobOptions& options = QueryBlobOptions(),
255 const Azure::Core::Context& context = Azure::Core::Context()) const;
256
257 private:
258 explicit BlockBlobClient(BlobClient blobClient);
259 friend class BlobClient;
260 friend class Files::DataLake::DataLakeFileClient;
261 };
262
263}}} // namespace Azure::Storage::Blobs
The BlobClient allows you to manipulate Azure Storage blobs.
Definition blob_client.hpp:39
The BlockBlobClient allows you to manipulate Azure Storage block blobs.
Definition block_blob_client.hpp:31
BlockBlobClient WithSnapshot(const std::string &snapshot) const
Initializes a new instance of the BlockBlobClient class with an identical URL source but the specifie...
Azure::Response< Models::GetBlockListResult > GetBlockList(const GetBlockListOptions &options=GetBlockListOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
Retrieves the list of blocks that have been uploaded as part of a block blob. There are two block lis...
BlockBlobClient(const std::string &blobUrl, std::shared_ptr< const Core::Credentials::TokenCredential > credential, const BlobClientOptions &options=BlobClientOptions())
Initialize a new instance of BlockBlobClient.
Azure::Response< Models::UploadBlockBlobFromResult > UploadFrom(const uint8_t *buffer, size_t bufferSize, const UploadBlockBlobFromOptions &options=UploadBlockBlobFromOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
Creates a new block blob, or updates the content of an existing block blob. Updating an existing bloc...
Azure::Response< Models::StageBlockResult > StageBlock(const std::string &blockId, Azure::Core::IO::BodyStream &content, const StageBlockOptions &options=StageBlockOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
Creates a new block as part of a block blob's staging area to be eventually committed via the CommitB...
Azure::Response< Models::UploadBlockBlobResult > Upload(Azure::Core::IO::BodyStream &content, const UploadBlockBlobOptions &options=UploadBlockBlobOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
Creates a new block blob, or updates the content of an existing block blob. Updating an existing bloc...
Azure::Response< Models::CommitBlockListResult > CommitBlockList(const std::vector< std::string > &blockIds, const CommitBlockListOptions &options=CommitBlockListOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
Writes a blob by specifying the list of block IDs that make up the blob. In order to be written as pa...
Azure::Response< Models::QueryBlobResult > Query(const std::string &querySqlExpression, const QueryBlobOptions &options=QueryBlobOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
Returns the result of a query against the blob.
Azure::Response< Models::UploadBlockBlobFromUriResult > UploadFromUri(const std::string &sourceUri, const UploadBlockBlobFromUriOptions &options=UploadBlockBlobFromUriOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
Creates a new Block Blob where the contents of the blob are read from a given URL.
Azure::Response< Models::UploadBlockBlobFromResult > UploadFrom(const std::string &fileName, const UploadBlockBlobFromOptions &options=UploadBlockBlobFromOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
Creates a new block blob, or updates the content of an existing block blob. Updating an existing bloc...
BlockBlobClient(const std::string &blobUrl, std::shared_ptr< StorageSharedKeyCredential > credential, const BlobClientOptions &options=BlobClientOptions())
Initialize a new instance of BlockBlobClient.
BlockBlobClient(const std::string &blobUrl, const BlobClientOptions &options=BlobClientOptions())
Initialize a new instance of BlockBlobClient.
Azure::Response< Models::StageBlockFromUriResult > StageBlockFromUri(const std::string &blockId, const std::string &sourceUri, const StageBlockFromUriOptions &options=StageBlockFromUriOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
Creates a new block to be committed as part of a blob where the contents are read from the sourceUri.
BlockBlobClient WithVersionId(const std::string &versionId) const
Creates a clone of this instance that references a version ID rather than the base blob.
static BlockBlobClient CreateFromConnectionString(const std::string &connectionString, const std::string &blobContainerName, const std::string &blobName, const BlobClientOptions &options=BlobClientOptions())
Initialize a new instance of BlockBlobClient.
Client options used to initialize all kinds of blob clients.
Definition blob_options.hpp:175
Optional parameters for Azure::Storage::Blobs::BlockBlobClient::CommitBlockList.
Definition blob_options.hpp:1100
Optional parameters for Azure::Storage::Blobs::BlockBlobClient::GetBlockList.
Definition blob_options.hpp:1141
Optional parameters for Azure::Storage::Blobs::BlockBlobClient::Query.
Definition blob_options.hpp:1280
Optional parameters for Azure::Storage::Blobs::BlockBlobClient::StageBlockFromUri.
Definition blob_options.hpp:1056
Optional parameters for Azure::Storage::Blobs::BlockBlobClient::StageBlock.
Definition blob_options.hpp:1038
Optional parameters for Azure::Storage::Blobs::BlockBlobClient::UploadFrom.
Definition blob_options.hpp:904
Optional parameters for Azure::Storage::Blobs::BlockBlobClient::UploadFromUri.
Definition blob_options.hpp:963
Optional parameters for Azure::Storage::Blobs::BlockBlobClient::Upload.
Definition blob_options.hpp:856