From 37e3af7a12d67303119e172f620763cf8a35c063 Mon Sep 17 00:00:00 2001 From: siminsavani-msft <77068571+siminsavani-msft@users.noreply.github.com> Date: Wed, 2 Aug 2023 11:30:31 -0400 Subject: [PATCH 1/2] Adding new rehydrate enum --- sdk/storage/azblob/container/constants.go | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/storage/azblob/container/constants.go b/sdk/storage/azblob/container/constants.go index 09a8e8ed3f2b..1b684290fcaf 100644 --- a/sdk/storage/azblob/container/constants.go +++ b/sdk/storage/azblob/container/constants.go @@ -99,6 +99,7 @@ type ArchiveStatus = generated.ArchiveStatus const ( ArchiveStatusRehydratePendingToCool ArchiveStatus = generated.ArchiveStatusRehydratePendingToCool ArchiveStatusRehydratePendingToHot ArchiveStatus = generated.ArchiveStatusRehydratePendingToHot + ArchiveStatusRehydratePendingToCold ArchiveStatus = generated.ArchiveStatusRehydratePendingToCold ) // PossibleArchiveStatusValues returns the possible values for the ArchiveStatus const type. From e4a5cd371ddcf8689b88af6c227630c2dcf1e03b Mon Sep 17 00:00:00 2001 From: siminsavani-msft <77068571+siminsavani-msft@users.noreply.github.com> Date: Thu, 24 Aug 2023 13:04:13 -0400 Subject: [PATCH 2/2] Added new enum, test, updated CHANGELOG.md --- sdk/storage/azblob/CHANGELOG.md | 1 + sdk/storage/azblob/assets.json | 2 +- sdk/storage/azblob/blob/constants.go | 1 + sdk/storage/azblob/blockblob/client_test.go | 17 +++++++++++++++++ sdk/storage/azblob/container/constants.go | 1 - 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/sdk/storage/azblob/CHANGELOG.md b/sdk/storage/azblob/CHANGELOG.md index ca1866f68783..5c814daed9fe 100644 --- a/sdk/storage/azblob/CHANGELOG.md +++ b/sdk/storage/azblob/CHANGELOG.md @@ -8,6 +8,7 @@ * Added [FilterBlobs by Tags](https://learn.microsoft.com/rest/api/storageservices/find-blobs-by-tags-container) API for container client. * Added `System` option to `ListContainersInclude` to allow listing of system containers (i.e, $web). * Updated the SAS Version to `2021-12-02` and added `Encryption Scope` to Account SAS, Service SAS, and User Delegation SAS +* Added `ArchiveStatusRehydratePendingToCold` value to `ArchiveStatus` enum. ### Breaking Changes diff --git a/sdk/storage/azblob/assets.json b/sdk/storage/azblob/assets.json index f9d16daba57b..24a2b0bedbf3 100644 --- a/sdk/storage/azblob/assets.json +++ b/sdk/storage/azblob/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "go", "TagPrefix": "go/storage/azblob", - "Tag": "go/storage/azblob_7a25fb98e8" + "Tag": "go/storage/azblob_c363103941" } diff --git a/sdk/storage/azblob/blob/constants.go b/sdk/storage/azblob/blob/constants.go index 8a9107954381..65653f2d2736 100644 --- a/sdk/storage/azblob/blob/constants.go +++ b/sdk/storage/azblob/blob/constants.go @@ -149,6 +149,7 @@ type ArchiveStatus = generated.ArchiveStatus const ( ArchiveStatusRehydratePendingToCool ArchiveStatus = generated.ArchiveStatusRehydratePendingToCool ArchiveStatusRehydratePendingToHot ArchiveStatus = generated.ArchiveStatusRehydratePendingToHot + ArchiveStatusRehydratePendingToCold ArchiveStatus = generated.ArchiveStatusRehydratePendingToCold ) // PossibleArchiveStatusValues returns the possible values for the ArchiveStatus const type. diff --git a/sdk/storage/azblob/blockblob/client_test.go b/sdk/storage/azblob/blockblob/client_test.go index bb1f46d90b54..1f0985b60481 100644 --- a/sdk/storage/azblob/blockblob/client_test.go +++ b/sdk/storage/azblob/blockblob/client_test.go @@ -2736,6 +2736,7 @@ func (s *BlockBlobRecordedTestsSuite) TestRehydrateStatus() { blobName1 := "rehydration_test_blob_1" blobName2 := "rehydration_test_blob_2" + blobName3 := "rehydration_test_blob_3" bbClient1 := testcommon.GetBlockBlobClient(blobName1, containerClient) reader1, _ := testcommon.GenerateData(1024) @@ -2780,6 +2781,22 @@ func (s *BlockBlobRecordedTestsSuite) TestRehydrateStatus() { _require.Nil(err) _require.Equal(*getResp2.AccessTier, string(blob.AccessTierArchive)) _require.Equal(*getResp2.ArchiveStatus, string(blob.ArchiveStatusRehydratePendingToHot)) + + // ------------------------------------------ + + bbClient3 := testcommon.GetBlockBlobClient(blobName3, containerClient) + reader3, _ := testcommon.GenerateData(1024) + _, err = bbClient3.Upload(context.Background(), reader3, nil) + _require.Nil(err) + _, err = bbClient3.SetTier(context.Background(), blob.AccessTierArchive, nil) + _require.Nil(err) + _, err = bbClient3.SetTier(context.Background(), blob.AccessTierCold, nil) + _require.Nil(err) + + getResp3, err := bbClient3.GetProperties(context.Background(), nil) + _require.Nil(err) + _require.Equal(*getResp3.AccessTier, string(blob.AccessTierArchive)) + _require.Equal(*getResp3.ArchiveStatus, string(blob.ArchiveStatusRehydratePendingToCold)) } func (s *BlockBlobRecordedTestsSuite) TestCopyBlobWithRehydratePriority() { diff --git a/sdk/storage/azblob/container/constants.go b/sdk/storage/azblob/container/constants.go index 1b684290fcaf..09a8e8ed3f2b 100644 --- a/sdk/storage/azblob/container/constants.go +++ b/sdk/storage/azblob/container/constants.go @@ -99,7 +99,6 @@ type ArchiveStatus = generated.ArchiveStatus const ( ArchiveStatusRehydratePendingToCool ArchiveStatus = generated.ArchiveStatusRehydratePendingToCool ArchiveStatusRehydratePendingToHot ArchiveStatus = generated.ArchiveStatusRehydratePendingToHot - ArchiveStatusRehydratePendingToCold ArchiveStatus = generated.ArchiveStatusRehydratePendingToCold ) // PossibleArchiveStatusValues returns the possible values for the ArchiveStatus const type.