-
Notifications
You must be signed in to change notification settings - Fork 848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature STG 85/86] Cold Tier #21024
Closed
siminsavani-msft
wants to merge
29
commits into
Azure:feature/azblob-stg85/86
from
siminsavani-msft:cold-tier
Closed
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
7b65a42
Regenerating azblob to stg 85/86
siminsavani-msft e449fab
Updating CopyFromURL
siminsavani-msft 703f8bf
minor change
siminsavani-msft 1eb380f
minor fixes
siminsavani-msft b83f0d7
undo some minor fixes
siminsavani-msft a1b9a27
Updating Go code generator
siminsavani-msft 7faac50
Fixing calls to pipeline
siminsavani-msft 948b091
Adding custom UnmarshalXML for BlobItem and BlobPrefix
siminsavani-msft c61c73e
Updating constructor method for AppendBlobClient
siminsavani-msft 9b5966c
Updating Client constructors
siminsavani-msft b1b7920
Merge branch 'main' into regenerate-85/86
siminsavani-msft 4127627
Undoing minor fixes to blob examples
siminsavani-msft 6f94001
Merge branch 'regenerate-85/86' of https://github.com/siminsavani-msf…
siminsavani-msft 35d01b9
Fixing authpolicy
siminsavani-msft 1f78a6f
Updating azcore version
siminsavani-msft d1b507f
Fixing client strings
siminsavani-msft b1538dd
Const for service client
siminsavani-msft b6969f5
Merge branch 'main' into regenerate-85/86
siminsavani-msft 059f99a
Minor fix
siminsavani-msft 2338566
fixing go mod files
siminsavani-msft 20775e9
Shared constants client name
siminsavani-msft 0042d66
Adding Cold Tier + tests
siminsavani-msft 0fcdf9f
Merge branch 'feature/azblob-stg85/86' into cold-tier
siminsavani-msft 8fbd3b5
Recorded tests
siminsavani-msft e603d26
Merge branch 'cold-tier' of https://github.com/siminsavani-msft/azure…
siminsavani-msft 267be2f
Updated CHANGELOG.md
siminsavani-msft 6c7558b
Added recording
siminsavani-msft ab7f832
Fixing linting issues
siminsavani-msft c1526fb
Fixing CI issues with test
siminsavani-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
## 1.1.0-beta.2 (Unreleased) | ||
|
||
### Features Added | ||
* Added `AccessTierCold`. | ||
|
||
### Breaking Changes | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3274,95 +3274,64 @@ func (s *BlobRecordedTestsSuite) TestPermanentDeleteWithoutPermission() { | |
return nil | ||
}*/ | ||
|
||
// | ||
////func (s *BlobRecordedTestsSuite) TestBlobTierInferred() { | ||
//// svcClient, err := getPremiumserviceClient() | ||
//// if err != nil { | ||
//// c.Skip(err.Error()) | ||
//// } | ||
//// | ||
//// containerClient, _ := testcommon.CreateNewContainer(c, svcClient) | ||
//// defer testcommon.DeleteContainer(context.Background(), _require, containerClient) | ||
//// bbClient, _ := createNewPageBlob(c, containerClient) | ||
//// | ||
//// resp, err := bbClient.GetProperties(context.Background(), nil) | ||
//// _require.Nil(err) | ||
//// _assert(resp.AccessTierInferred(), chk.Equals, "true") | ||
//// | ||
//// resp2, err := containerClient.NewListBlobsFlatPager(ctx, Marker{}, ListBlobsSegmentOptions{}) | ||
//// _require.Nil(err) | ||
//// _assert(resp2.Segment.BlobItems[0].Properties.AccessTierInferred, chk.NotNil) | ||
//// _assert(resp2.Segment.BlobItems[0].Properties.AccessTier, chk.Not(chk.Equals), "") | ||
//// | ||
//// _, err = bbClient.SetTier(ctx, AccessTierP4, LeaseAccessConditions{}) | ||
//// _require.Nil(err) | ||
//// | ||
//// resp, err = bbClient.GetProperties(context.Background(), nil) | ||
//// _require.Nil(err) | ||
//// _assert(resp.AccessTierInferred(), chk.Equals, "") | ||
//// | ||
//// resp2, err = containerClient.NewListBlobsFlatPager(ctx, Marker{}, ListBlobsSegmentOptions{}) | ||
//// _require.Nil(err) | ||
//// _assert(resp2.Segment.BlobItems[0].Properties.AccessTierInferred, chk.IsNil) // AccessTierInferred never returned if false | ||
////} | ||
//// | ||
////func (s *BlobRecordedTestsSuite) TestBlobArchiveStatus() { | ||
//// svcClient, err := getBlobStorageserviceClient() | ||
//// if err != nil { | ||
//// c.Skip(err.Error()) | ||
//// } | ||
//// | ||
//// containerClient, _ := testcommon.CreateNewContainer(c, svcClient) | ||
//// defer testcommon.DeleteContainer(context.Background(), _require, containerClient) | ||
//// bbClient, _ := createNewBlockBlob(c, containerClient) | ||
//// | ||
//// _, err = bbClient.SetTier(ctx, AccessTierArchive, LeaseAccessConditions{}) | ||
//// _require.Nil(err) | ||
//// _, err = bbClient.SetTier(ctx, AccessTierCool, LeaseAccessConditions{}) | ||
//// _require.Nil(err) | ||
//// | ||
//// resp, err := bbClient.GetProperties(context.Background(), nil) | ||
//// _require.Nil(err) | ||
//// _assert(resp.ArchiveStatus(), chk.Equals, string(ArchiveStatusRehydratePendingToCool)) | ||
//// | ||
//// resp2, err := containerClient.NewListBlobsFlatPager(ctx, Marker{}, ListBlobsSegmentOptions{}) | ||
//// _require.Nil(err) | ||
//// _assert(resp2.Segment.BlobItems[0].Properties.ArchiveStatus, chk.Equals, ArchiveStatusRehydratePendingToCool) | ||
//// | ||
//// // delete first blob | ||
//// _, err = bbClient.Delete(context.Background(), DeleteSnapshotsOptionNone, nil) | ||
//// _require.Nil(err) | ||
//// | ||
//// bbClient, _ = createNewBlockBlob(c, containerClient) | ||
//// | ||
//// _, err = bbClient.SetTier(ctx, AccessTierArchive, LeaseAccessConditions{}) | ||
//// _require.Nil(err) | ||
//// _, err = bbClient.SetTier(ctx, AccessTierHot, LeaseAccessConditions{}) | ||
//// _require.Nil(err) | ||
//// | ||
//// resp, err = bbClient.GetProperties(context.Background(), nil) | ||
//// _require.Nil(err) | ||
//// _assert(resp.ArchiveStatus(), chk.Equals, string(ArchiveStatusRehydratePendingToHot)) | ||
//// | ||
//// resp2, err = containerClient.NewListBlobsFlatPager(ctx, Marker{}, ListBlobsSegmentOptions{}) | ||
//// _require.Nil(err) | ||
//// _assert(resp2.Segment.BlobItems[0].Properties.ArchiveStatus, chk.Equals, ArchiveStatusRehydratePendingToHot) | ||
////} | ||
//// | ||
////func (s *BlobRecordedTestsSuite) TestBlobTierInvalidValue() { | ||
//// svcClient, err := getBlobStorageserviceClient() | ||
//// if err != nil { | ||
//// c.Skip(err.Error()) | ||
//// } | ||
//// | ||
//// containerClient, _ := testcommon.CreateNewContainer(c, svcClient) | ||
//// defer testcommon.DeleteContainer(context.Background(), _require, containerClient) | ||
//// bbClient, _ := createNewBlockBlob(c, containerClient) | ||
//// | ||
//// _, err = bbClient.SetTier(ctx, AccessTierType("garbage"), LeaseAccessConditions{}) | ||
//// testcommon.ValidateBlobErrorCode(c, err, bloberror.InvalidHeaderValue) | ||
////} | ||
//// | ||
// //func (s *BlobRecordedTestsSuite) TestBlobTierInferred() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this test commented out? |
||
// // svcClient, err := getPremiumserviceClient() | ||
// // if err != nil { | ||
// // c.Skip(err.Error()) | ||
// // } | ||
// // | ||
// // containerClient, _ := testcommon.CreateNewContainer(c, svcClient) | ||
// // defer testcommon.DeleteContainer(context.Background(), _require, containerClient) | ||
// // bbClient, _ := createNewPageBlob(c, containerClient) | ||
// // | ||
// // resp, err := bbClient.GetProperties(context.Background(), nil) | ||
// // _require.Nil(err) | ||
// // _assert(resp.AccessTierInferred(), chk.Equals, "true") | ||
// // | ||
// // resp2, err := containerClient.NewListBlobsFlatPager(ctx, Marker{}, ListBlobsSegmentOptions{}) | ||
// // _require.Nil(err) | ||
// // _assert(resp2.Segment.BlobItems[0].Properties.AccessTierInferred, chk.NotNil) | ||
// // _assert(resp2.Segment.BlobItems[0].Properties.AccessTier, chk.Not(chk.Equals), "") | ||
// // | ||
// // _, err = bbClient.SetTier(ctx, AccessTierP4, LeaseAccessConditions{}) | ||
// // _require.Nil(err) | ||
// // | ||
// // resp, err = bbClient.GetProperties(context.Background(), nil) | ||
// // _require.Nil(err) | ||
// // _assert(resp.AccessTierInferred(), chk.Equals, "") | ||
// // | ||
// // resp2, err = containerClient.NewListBlobsFlatPager(ctx, Marker{}, ListBlobsSegmentOptions{}) | ||
// // _require.Nil(err) | ||
// // _assert(resp2.Segment.BlobItems[0].Properties.AccessTierInferred, chk.IsNil) // AccessTierInferred never returned if false | ||
// //} | ||
// // | ||
|
||
func (s *BlobRecordedTestsSuite) TestBlobSetTierInvalidAndValid() { | ||
_require := require.New(s.T()) | ||
testName := s.T().Name() | ||
svcClient, err := testcommon.GetServiceClient(s.T(), testcommon.TestAccountDefault, nil) | ||
_require.NoError(err) | ||
|
||
containerName := testcommon.GenerateContainerName(testName) | ||
containerClient := testcommon.CreateNewContainer(context.Background(), _require, containerName, svcClient) | ||
defer testcommon.DeleteContainer(context.Background(), _require, containerClient) | ||
|
||
blockBlobName := testcommon.GenerateBlobName(testName) | ||
bbClient := testcommon.CreateNewBlockBlob(context.Background(), _require, blockBlobName, containerClient) | ||
|
||
_, err = bbClient.SetTier(context.Background(), blob.AccessTier("nothing"), nil) | ||
_require.Error(err) | ||
testcommon.ValidateBlobErrorCode(_require, err, bloberror.InvalidHeaderValue) | ||
|
||
for _, tier := range []blob.AccessTier{blob.AccessTierCool, blob.AccessTierHot, blob.AccessTierCold, blob.AccessTierArchive} { | ||
_, err = bbClient.SetTier(context.Background(), tier, nil) | ||
_require.NoError(err) | ||
|
||
getResp, err := bbClient.GetProperties(context.Background(), nil) | ||
_require.NoError(err) | ||
_require.Equal(*getResp.AccessTier, string(tier)) | ||
} | ||
} | ||
|
||
func (s *BlobRecordedTestsSuite) TestBlobClientPartsSASQueryTimes() { | ||
_require := require.New(s.T()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added support for Cold tier.