Skip to content

Commit 0e71c85

Browse files
Append Blob Tests (Azure#20399)
* Adding tests for appendblob * Updating unrecorded tests and fixing tests * Adding deprecated message on unsupported apis * Update tests * update * Updating docs references on deprecated apis * Fix flaky test * Update sdk/storage/azblob/appendblob/client.go Co-authored-by: Sourav Gupta <[email protected]> * Update sdk/storage/azblob/appendblob/client.go Co-authored-by: Sourav Gupta <[email protected]> * Fixing flaky tests, again... --------- Co-authored-by: Sourav Gupta <[email protected]>
1 parent 38d786c commit 0e71c85

File tree

3 files changed

+581
-11
lines changed

3 files changed

+581
-11
lines changed

sdk/storage/azblob/appendblob/client.go

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package appendblob
88

99
import (
1010
"context"
11+
"errors"
1112
"io"
1213
"os"
1314
"time"
@@ -255,14 +256,10 @@ func (ab *Client) SetLegalHold(ctx context.Context, legalHold bool, options *blo
255256
return ab.BlobClient().SetLegalHold(ctx, legalHold, options)
256257
}
257258

258-
// SetTier operation sets the tier on a blob. The operation is allowed on a page
259-
// blob in a premium storage account and on a block blob in a blob storage account (locally
260-
// redundant storage only). A premium page blob's tier determines the allowed size, IOPS, and
261-
// bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive storage type. This operation
262-
// does not update the blob's ETag.
263-
// For detailed information about block blob level tiering see https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-storage-tiers.
259+
// SetTier
260+
// Deprecated: SetTier only works for page blob in premium storage account and block blob in blob storage account.
264261
func (ab *Client) SetTier(ctx context.Context, tier blob.AccessTier, o *blob.SetTierOptions) (blob.SetTierResponse, error) {
265-
return ab.BlobClient().SetTier(ctx, tier, o)
262+
return blob.SetTierResponse{}, errors.New("Operation will not work on this blob type. SetTier only works for page blob in premium storage account and block blob in blob storage account.")
266263
}
267264

268265
// SetExpiry operation sets an expiry time on an existing blob. This operation is only allowed on Hierarchical Namespace enabled accounts.
@@ -326,10 +323,10 @@ func (ab *Client) GetTags(ctx context.Context, o *blob.GetTagsOptions) (blob.Get
326323
return ab.BlobClient().GetTags(ctx, o)
327324
}
328325

329-
// CopyFromURL synchronously copies the data at the source URL to a block blob, with sizes up to 256 MB.
330-
// For more information, see https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url.
326+
// CopyFromURL
327+
// Deprecated: CopyFromURL works only with block blob
331328
func (ab *Client) CopyFromURL(ctx context.Context, copySource string, o *blob.CopyFromURLOptions) (blob.CopyFromURLResponse, error) {
332-
return ab.BlobClient().CopyFromURL(ctx, copySource, o)
329+
return blob.CopyFromURLResponse{}, errors.New("Operation will not work on this blob type. CopyFromURL works only with block blob.")
333330
}
334331

335332
// Concurrent Download Functions -----------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)