Skip to content

Commit

Permalink
STG 79 80 81 Features (#3850)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinming-Hu authored Aug 5, 2022
1 parent bf65862 commit 93991ab
Show file tree
Hide file tree
Showing 27 changed files with 2,733 additions and 802 deletions.
15 changes: 15 additions & 0 deletions sdk/storage/azure-storage-blobs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Release History

## 12.6.0-beta1 (Unreleased)

### Features Added

- Bumped up API version to `2021-04-10`.
- Added support for encryption scope SAS (`ses` query parameter in SAS token).
- Added encryption scope support for `BlobClient::CopyFromUri()`.
- Added support for filtering blobs on container level.
- Added support for tags copy mode (replace or copy from source) when copying blobs from URL.
- Added support for permanent delete permission in SAS.

### Bugs Fixed

- Fixed listing blobs failure when blob name contains invalid characters in xml.

## 12.5.0 (2022-08-08)

### Features Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,24 @@ namespace Azure { namespace Storage { namespace Blobs {
const UploadBlockBlobOptions& options = UploadBlockBlobOptions(),
const Azure::Core::Context& context = Azure::Core::Context()) const;

/**
* @brief The Filter Blobs operation enables callers to list blobs in a container whose
* tags match a given search expression.
*
* @param tagFilterSqlExpression The where parameter enables the caller to query blobs
* whose tags match a given expression. The given expression must evaluate to true for a blob to
* be returned in the results. The [OData - ABNF] filter syntax rule defines the formal grammar
* for the value of the where query parameter, however, only a subset of the OData filter syntax
* is supported in the Blob service.
* @param options Optional parameters to execute this function.
* @param context Context for cancelling long running operations.
* @return A FindBlobsByTagsPagedResponse describing the blobs.
*/
FindBlobsByTagsPagedResponse FindBlobsByTags(
const std::string& tagFilterSqlExpression,
const FindBlobsByTagsOptions& options = FindBlobsByTagsOptions(),
const Azure::Core::Context& context = Azure::Core::Context()) const;

/**
* @brief Creates a new batch object to collect subrequests that can be submitted together via
* SubmitBatch.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,12 @@ namespace Azure { namespace Storage { namespace Blobs {
* Indicates whether the destination blob has a legal hold.
*/
Azure::Nullable<bool> HasLegalHold;

/**
* Indicates the tags on the destination blob should be copied from source or replaced by Tags
* in this option. Default is to replace.
*/
Models::BlobCopySourceTagsMode CopySourceTagsMode;
};

/**
Expand Down Expand Up @@ -932,6 +938,12 @@ namespace Azure { namespace Storage { namespace Blobs {
* If the two hashes do not match, the operation will fail.
*/
Azure::Nullable<ContentHash> TransactionalContentHash;

/**
* Indicates the tags on the destination blob should be copied from source or replaced by Tags
* in this option. Default is to replace.
*/
Models::BlobCopySourceTagsMode CopySourceTagsMode;
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,49 @@ namespace Azure { namespace Storage {
std::string LeaseId;
};

/**
* @brief An Azure Storage blob.
*/
struct BlobItem final
{
/**
* Blob name.
*/
std::string Name;
/**
* Indicates whether this blob was deleted.
*/
bool IsDeleted = bool();
/**
* A string value that uniquely identifies a blob snapshot.
*/
std::string Snapshot;
/**
* A string value that uniquely identifies a blob version.
*/
Nullable<std::string> VersionId;
/**
* Indicates if this is the current version of the blob.
*/
Nullable<bool> IsCurrentVersion;
/**
* Properties of a blob.
*/
BlobItemDetails Details;
/**
* Indicates that this root blob has been deleted, but it has versions that are active.
*/
Nullable<bool> HasVersionsOnly;
/**
* Size in bytes.
*/
int64_t BlobSize = int64_t();
/**
* Type of the blob.
*/
Models::BlobType BlobType;
};

/**
* @brief Response type for #Azure::Storage::Blobs::BlobBatchClient::SubmitBatch.
*/
Expand Down Expand Up @@ -267,10 +310,12 @@ namespace Azure { namespace Storage {
void OnNextPage(const Azure::Core::Context& context);

std::shared_ptr<BlobServiceClient> m_blobServiceClient;
std::shared_ptr<BlobContainerClient> m_blobContainerClient;
FindBlobsByTagsOptions m_operationOptions;
std::string m_tagFilterSqlExpression;

friend class BlobServiceClient;
friend class BlobContainerClient;
friend class Azure::Core::PagedResponse<FindBlobsByTagsPagedResponse>;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ namespace Azure { namespace Storage { namespace Sas {
*/
SetImmutabilityPolicy = 256,

/**
* @brief Indicates that permanent delete is permitted.
*/
PermanentDelete = 512,

/**
* @brief Indicates that all permissions are set.
*/
Expand Down Expand Up @@ -160,6 +165,11 @@ namespace Azure { namespace Storage { namespace Sas {
*/
SetImmutabilityPolicy = 128,

/**
* @brief Indicates that permanent delete is permitted.
*/
PermanentDelete = 256,

/**
* @brief Indicates that all permissions are set.
*/
Expand Down Expand Up @@ -269,6 +279,11 @@ namespace Azure { namespace Storage { namespace Sas {
*/
std::string ContentType;

/**
* @brief Optional encryption scope to use when sending requests authorized with this SAS url.
*/
std::string EncryptionScope;

/**
* @brief Sets the permissions for the blob container SAS.
*
Expand Down
Loading

0 comments on commit 93991ab

Please sign in to comment.