new field IsHnsEnabled in AccountInfo (#1068)

This commit is contained in:
JinmingHu 2020-12-03 13:53:52 +08:00 committed by GitHub
parent 72a6ea98a9
commit 222967cc89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 0 deletions

View File

@ -5,6 +5,7 @@
### New Features
* `CreateIfNotExists` and `DeleteIfExists` for blob containers and blobs.
* Add `IsHierarchicalNamespaceEnabled` in `GetAccountInfoResult`.
### Breaking Changes

View File

@ -683,6 +683,7 @@ namespace Azure { namespace Storage { namespace Blobs {
{
Blobs::Models::SkuName SkuName = Blobs::Models::SkuName::Unknown;
Blobs::Models::AccountKind AccountKind = Blobs::Models::AccountKind::Unknown;
bool IsHierarchicalNamespaceEnabled = false;
}; // struct GetAccountInfoResult
struct GetBlobContainerAccessPolicyResult
@ -1946,6 +1947,8 @@ namespace Azure { namespace Storage { namespace Blobs {
response.SkuName = SkuNameFromString(httpResponse.GetHeaders().at("x-ms-sku-name"));
response.AccountKind
= AccountKindFromString(httpResponse.GetHeaders().at("x-ms-account-kind"));
response.IsHierarchicalNamespaceEnabled
= httpResponse.GetHeaders().at("x-ms-is-hns-enabled") == "true";
return Azure::Core::Response<GetAccountInfoResult>(
std::move(response), std::move(pHttpResponse));
}

View File

@ -319,6 +319,12 @@ namespace Azure { namespace Storage { namespace Test {
auto accountInfo = *m_blobServiceClient.GetAccountInfo();
EXPECT_NE(accountInfo.SkuName, Blobs::Models::SkuName::Unknown);
EXPECT_NE(accountInfo.AccountKind, Blobs::Models::AccountKind::Unknown);
EXPECT_FALSE(accountInfo.IsHierarchicalNamespaceEnabled);
auto dataLakeServiceClient
= Blobs::BlobServiceClient::CreateFromConnectionString(AdlsGen2ConnectionString());
accountInfo = *dataLakeServiceClient.GetAccountInfo();
EXPECT_TRUE(accountInfo.IsHierarchicalNamespaceEnabled);
}
TEST_F(BlobServiceClientTest, Statistics)