Skip to content

Commit

Permalink
ArchieveStatus - RehydratePendingToCold (#21441)
Browse files Browse the repository at this point in the history
* Adding new rehydrate enum

* Added new enum, test, updated CHANGELOG.md
  • Loading branch information
siminsavani-msft committed Aug 28, 2023
1 parent 66a9d3d commit 1a39105
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions sdk/storage/azblob/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
* Content length limit for `AppendBlob.AppendBlock()` and `AppendBlob.AppendBlockFromURL()` raised from 4 MB to 100 MB.

### Breaking Changes
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/azblob/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
1 change: 1 addition & 0 deletions sdk/storage/azblob/blob/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,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.
Expand Down
17 changes: 17 additions & 0 deletions sdk/storage/azblob/blockblob/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 1a39105

Please sign in to comment.