Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/storage/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "cpp",
"TagPrefix": "cpp/storage",
"Tag": "cpp/storage_4783f09bdf"
"Tag": "cpp/storage_c84db7d3d4"
}
6 changes: 6 additions & 0 deletions sdk/storage/azure-storage-blobs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ elseif(NOT AZ_ALL_LIBRARIES)
find_package(azure-storage-common-cpp REQUIRED)
endif()
endif()
find_package(nanoarrow REQUIRED)

set(
AZURE_STORAGE_BLOBS_HEADER
Expand Down Expand Up @@ -92,6 +93,11 @@ target_include_directories(
)

target_link_libraries(azure-storage-blobs PUBLIC Azure::azure-storage-common)
add_library(flatccrt STATIC IMPORTED)
find_library(FLATCCRT_LIB_PATH_DEBUG NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}flatccrt_d${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_PREFIX}flatccrt${CMAKE_STATIC_LIBRARY_SUFFIX})
find_library(FLATCCRT_LIB_PATH_RELEASE NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}flatccrt${CMAKE_STATIC_LIBRARY_SUFFIX})
set_target_properties(flatccrt PROPERTIES IMPORTED_LOCATION_DEBUG ${FLATCCRT_LIB_PATH_DEBUG} IMPORTED_LOCATION_RELEASE ${FLATCCRT_LIB_PATH_RELEASE} IMPORTED_CONFIGURATIONS "Release;Debug")
target_link_libraries(azure-storage-blobs PRIVATE nanoarrow::nanoarrow nanoarrow::nanoarrow_ipc)

target_compile_definitions(azure-storage-blobs PRIVATE _azure_BUILDING_SDK)

Expand Down
10 changes: 10 additions & 0 deletions sdk/storage/azure-storage-blobs/cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "git",
"git": {
"RepositoryUrl": "https://github.com/apache/arrow-nanoarrow",
"CommitHash": "a579fbf5d192e85b6249935e117de7d02a6dc4e9"
}
},
"DevelopmentDependency": false
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,25 @@ namespace Azure { namespace Storage { namespace Blobs {
AccessConditions;
};

/**
* @brief Specifies the format used by the service for the listing response payload.
*/
enum class StorageResponseFormat
{
/**
* @brief Let the service choose the response format (default).
*/
Auto,
/**
* @brief Request the response in XML format.
*/
Xml,
/**
* @brief Request the response in Apache Arrow format.
*/
Arrow,
};

/**
* @brief Optional parameters for #Azure::Storage::Blobs::BlobContainerClient::ListBlobs and
* #Azure::Storage::Blobs::BlobContainerClient::ListBlobsByHierarchy.
Expand Down Expand Up @@ -481,6 +500,17 @@ namespace Azure { namespace Storage { namespace Blobs {
* @brief Specifies the relative path to list paths from.
*/
Azure::Nullable<std::string> StartFrom;

/**
* @brief Specifies the relative path to list paths until.
* @note This option is only valid when ResponseFormat is set to StorageResponseFormat::Arrow.
*/
Azure::Nullable<std::string> EndBefore;

/**
* @brief Specifies the response format the service should use for the listing response.
*/
StorageResponseFormat ResponseFormat = StorageResponseFormat::Auto;
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,5 +482,9 @@ namespace Azure { namespace Storage {
friend class Azure::Core::PagedResponse<GetPageRangesDiffPagedResponse>;
};

namespace _detail {
void ParseListBlobsResult(Models::_detail::ListBlobsResult& result);
} // namespace _detail

} // namespace Blobs
}} // namespace Azure::Storage
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace Azure { namespace Storage { namespace Blobs {
/**
* The version used for the operations to Azure storage services.
*/
constexpr static const char* ApiVersion = "2026-06-06";
constexpr static const char* ApiVersion = "2026-10-06";
} // namespace _detail
namespace Models {
/**
Expand Down Expand Up @@ -1369,6 +1369,10 @@ namespace Azure { namespace Storage { namespace Blobs {
* Indicates that this root blob has been deleted, but it has versions that are active.
*/
Nullable<bool> HasVersionsOnly;
/**
* Indicates this is a blob or blob prefix.
*/
Nullable<std::string> ResourceType;
/**
* Size in bytes.
*/
Expand Down Expand Up @@ -1422,29 +1426,16 @@ namespace Azure { namespace Storage { namespace Blobs {
}
namespace _detail {
/**
* @brief An enumeration of blobs.
* @brief Response type for #Azure::Storage::Blobs::BlobContainerClient::ListBlobsByHierarchy.
*/
struct ListBlobsResult final
{
std::unique_ptr<Core::IO::BodyStream> BodyStream;
std::string ServiceEndpoint;
std::string BlobContainerName;
std::string Prefix;
Nullable<std::string> ContinuationToken;
/**
* Array of BlobItem.
*/
std::vector<BlobItem> Items;
};
/**
* @brief An enumeration of blobs.
*/
struct ListBlobsByHierarchyResult final
{
std::string ServiceEndpoint;
std::string BlobContainerName;
std::string Prefix;
std::string Delimiter;
Nullable<std::string> ContinuationToken;
/**
* Array of BlobItem.
*/
Expand All @@ -1453,6 +1444,10 @@ namespace Azure { namespace Storage { namespace Blobs {
* Array of BlobName.
*/
std::vector<BlobName> BlobPrefixes;
/**
* The media type of the body of the response. For List Blobs this is 'application/xml'.
*/
std::string ContentType;
};
} // namespace _detail
/**
Expand Down Expand Up @@ -1599,6 +1594,26 @@ namespace Azure { namespace Storage { namespace Blobs {
* Indicates whether the blob has a legal hold.
*/
bool HasLegalHold = false;
/**
* The tier of page blob on a premium storage account or tier of block blob on blob storage or
* general purpose v2 account.
*/
Nullable<Models::AccessTier> AccessTier;
/**
* For page blobs on a premium storage account only. If the access tier is not explicitly set
* on the blob, the tier is inferred based on its content length and this header will be
* returned with true value.
*/
Nullable<bool> IsAccessTierInferred;
/**
* The time the tier was changed on the object. This is only returned if the tier on the block
* blob was ever set.
*/
Nullable<DateTime> AccessTierChangedOn;
/**
* The underlying tier of a smart tier blob. Only returned if the blob is in Smart tier.
*/
Nullable<Models::AccessTier> SmartAccessTier;
};
/**
* @brief Response type for #Azure::Storage::Blobs::BlobClient::Download.
Expand Down Expand Up @@ -2591,6 +2606,12 @@ namespace Azure { namespace Storage { namespace Blobs {
* header is returned so that the client can check for message content integrity.
*/
Nullable<ContentHash> TransactionalContentHash;
/**
* This header is returned so that the client can check for message content integrity. The
* value of this header is computed by the Blob service; it is not necessarily the same value
* specified in the request headers.
*/
Nullable<ContentHash> TransactionalContentHash2;
/**
* The current sequence number for the page blob.
*/
Expand Down Expand Up @@ -2654,6 +2675,12 @@ namespace Azure { namespace Storage { namespace Blobs {
* header is returned so that the client can check for message content integrity.
*/
Nullable<ContentHash> TransactionalContentHash;
/**
* This header is returned so that the client can check for message content integrity. The
* value of this header is computed by the Blob service; it is not necessarily the same value
* specified in the request headers.
*/
Nullable<ContentHash> TransactionalContentHash2;
/**
* The current sequence number for the page blob.
*/
Expand Down Expand Up @@ -2881,6 +2908,12 @@ namespace Azure { namespace Storage { namespace Blobs {
* header is returned so that the client can check for message content integrity.
*/
Nullable<ContentHash> TransactionalContentHash;
/**
* This header is returned so that the client can check for message content integrity. The
* value of this header is computed by the Blob service; it is not necessarily the same value
* specified in the request headers.
*/
Nullable<ContentHash> TransactionalContentHash2;
/**
* This response header is returned only for append operations. It returns the offset at which
* the block was committed, in bytes.
Expand Down Expand Up @@ -2929,6 +2962,12 @@ namespace Azure { namespace Storage { namespace Blobs {
* header is returned so that the client can check for message content integrity.
*/
Nullable<ContentHash> TransactionalContentHash;
/**
* This header is returned so that the client can check for message content integrity. The
* value of this header is computed by the Blob service; it is not necessarily the same value
* specified in the request headers.
*/
Nullable<ContentHash> TransactionalContentHash2;
/**
* This response header is returned only for append operations. It returns the offset at which
* the block was committed, in bytes.
Expand Down Expand Up @@ -2998,6 +3037,12 @@ namespace Azure { namespace Storage { namespace Blobs {
* header is returned so that the client can check for message content integrity.
*/
Nullable<ContentHash> TransactionalContentHash;
/**
* This header is returned so that the client can check for message content integrity. The
* value of this header is computed by the Blob service; it is not necessarily the same value
* specified in the request headers.
*/
Nullable<ContentHash> TransactionalContentHash2;
/**
* A DateTime value returned by the service that uniquely identifies the blob. The value of
* this header indicates the blob version, and may be used in subsequent requests to access
Expand Down Expand Up @@ -3042,6 +3087,12 @@ namespace Azure { namespace Storage { namespace Blobs {
* header is returned so that the client can check for message content integrity.
*/
Nullable<ContentHash> TransactionalContentHash;
/**
* This header is returned so that the client can check for message content integrity. The
* value of this header is computed by the Blob service; it is not necessarily the same value
* specified in the request headers.
*/
Nullable<ContentHash> TransactionalContentHash2;
/**
* A DateTime value returned by the service that uniquely identifies the blob. The value of
* this header indicates the blob version, and may be used in subsequent requests to access
Expand Down Expand Up @@ -3076,6 +3127,12 @@ namespace Azure { namespace Storage { namespace Blobs {
* specified in the request headers.
*/
Nullable<ContentHash> TransactionalContentHash;
/**
* This header is returned so that the client can check for message content integrity. The
* value of this header is computed by the Blob service; it is not necessarily the same value
* specified in the request headers.
*/
Nullable<ContentHash> TransactionalContentHash2;
/**
* The value of this header is set to true if the contents of the request are successfully
* encrypted using the specified algorithm, and false otherwise.
Expand Down Expand Up @@ -3104,6 +3161,12 @@ namespace Azure { namespace Storage { namespace Blobs {
* specified in the request headers.
*/
Nullable<ContentHash> TransactionalContentHash;
/**
* This header is returned so that the client can check for message content integrity. The
* value of this header is computed by the Blob service; it is not necessarily the same value
* specified in the request headers.
*/
Nullable<ContentHash> TransactionalContentHash2;
/**
* The value of this header is set to true if the contents of the request are successfully
* encrypted using the specified algorithm, and false otherwise.
Expand Down Expand Up @@ -3496,6 +3559,8 @@ namespace Azure { namespace Storage { namespace Blobs {
Nullable<std::int32_t> MaxResults;
Nullable<Models::ListBlobsIncludeFlags> Include;
Nullable<std::string> StartFrom;
Nullable<std::string> Accept;
Nullable<std::string> EndBefore;
};
static Response<Models::_detail::ListBlobsResult> ListBlobs(
Core::Http::_internal::HttpPipeline& pipeline,
Expand All @@ -3510,9 +3575,11 @@ namespace Azure { namespace Storage { namespace Blobs {
Nullable<std::int32_t> MaxResults;
Nullable<Models::ListBlobsIncludeFlags> Include;
Nullable<std::string> StartFrom;
Nullable<std::string> Accept;
Nullable<std::string> EndBefore;
Nullable<std::string> ShowOnly;
};
static Response<Models::_detail::ListBlobsByHierarchyResult> ListBlobsByHierarchy(
static Response<Models::_detail::ListBlobsResult> ListBlobsByHierarchy(
Core::Http::_internal::HttpPipeline& pipeline,
const Core::Url& url,
const ListBlobContainerBlobsByHierarchyOptions& options,
Expand Down
27 changes: 23 additions & 4 deletions sdk/storage/azure-storage-blobs/src/append_blob_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.EncryptionAlgorithm = m_customerProvidedKey.Value().Algorithm.ToString();
}
protocolLayerOptions.EncryptionScope = m_encryptionScope;
Nullable<Azure::Response<Models::AppendBlockResult>> responseNullable;
if (options.TransactionalContentHash.HasValue())
{
if (options.TransactionalContentHash.Value().Algorithm == HashAlgorithm::Md5)
Expand Down Expand Up @@ -191,11 +192,22 @@ namespace Azure { namespace Storage { namespace Blobs {
throw StorageException(
"Structured message response without x-ms-structured-body header.");
}
return response;
responseNullable = std::move(response);
}
}
return _detail::AppendBlobClient::AppendBlock(
*m_pipeline, m_blobUrl, content, protocolLayerOptions, context);
if (!responseNullable.HasValue())
{
responseNullable = _detail::AppendBlobClient::AppendBlock(
*m_pipeline, m_blobUrl, content, protocolLayerOptions, context);
}
auto response = std::move(responseNullable.Value());
if (response.Value.TransactionalContentHash2.HasValue()
&& !response.Value.TransactionalContentHash.HasValue())
{
response.Value.TransactionalContentHash = std::move(response.Value.TransactionalContentHash2);
response.Value.TransactionalContentHash2.Reset();
}
return response;
}

Azure::Response<Models::AppendBlockFromUriResult> AppendBlobClient::AppendBlockFromUri(
Expand Down Expand Up @@ -255,8 +267,15 @@ namespace Azure { namespace Storage { namespace Blobs {
= options.SourceCustomerProvidedKey.Value().Algorithm.ToString();
}

return _detail::AppendBlobClient::AppendBlockFromUri(
auto response = _detail::AppendBlobClient::AppendBlockFromUri(
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
if (response.Value.TransactionalContentHash2.HasValue()
&& !response.Value.TransactionalContentHash.HasValue())
{
response.Value.TransactionalContentHash = std::move(response.Value.TransactionalContentHash2);
response.Value.TransactionalContentHash2.Reset();
}
return response;
}

Azure::Response<Models::SealAppendBlobResult> AppendBlobClient::Seal(
Expand Down
Loading
Loading