diff --git a/src/Storage/Storage.Management/ChangeLog.md b/src/Storage/Storage.Management/ChangeLog.md index aec98485c310..728edea4ab00 100644 --- a/src/Storage/Storage.Management/ChangeLog.md +++ b/src/Storage/Storage.Management/ChangeLog.md @@ -18,6 +18,9 @@ - Additional information about change #1 --> ## Upcoming Release +* Support StandardBlobTier on Upload and Copy Block Blob + - Set-AzureStorageBlobContent + - Start-AzureStorageBlobCopy ## Version 1.5.0 * Change 2 parameters "-IndexDocument" and "-ErrorDocument404Path" from required to optional in cmdlet: diff --git a/src/Storage/Storage.Management/Storage.Management.csproj b/src/Storage/Storage.Management/Storage.Management.csproj index 23d153cbddab..51e07de64458 100644 --- a/src/Storage/Storage.Management/Storage.Management.csproj +++ b/src/Storage/Storage.Management/Storage.Management.csproj @@ -15,9 +15,9 @@ - - - + + + diff --git a/src/Storage/Storage.Management/help/Set-AzStorageBlobContent.md b/src/Storage/Storage.Management/help/Set-AzStorageBlobContent.md index 6e8c0b5f8c57..72a1cea91e90 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageBlobContent.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageBlobContent.md @@ -16,8 +16,9 @@ Uploads a local file to an Azure Storage blob. ### SendManual (Default) ``` Set-AzStorageBlobContent [-File] [-Container] [-Blob ] [-BlobType ] - [-Properties ] [-Metadata ] [-PremiumPageBlobTier ] [-Force] - [-AsJob] [-Context ] [-ServerTimeoutPerRequest ] [-ClientTimeoutPerRequest ] + [-Properties ] [-Metadata ] [-PremiumPageBlobTier ] + [-StandardBlobTier ] [-Force] [-AsJob] [-Context ] + [-ServerTimeoutPerRequest ] [-ClientTimeoutPerRequest ] [-DefaultProfile ] [-ConcurrentTaskCount ] [-WhatIf] [-Confirm] [] ``` @@ -26,8 +27,8 @@ Set-AzStorageBlobContent [-File] [-Container] [-Blob ] ``` Set-AzStorageBlobContent [-File] [-Blob ] -CloudBlobContainer [-BlobType ] [-Properties ] [-Metadata ] - [-PremiumPageBlobTier ] [-Force] [-AsJob] [-Context ] - [-ServerTimeoutPerRequest ] [-ClientTimeoutPerRequest ] + [-PremiumPageBlobTier ] [-StandardBlobTier ] [-Force] [-AsJob] + [-Context ] [-ServerTimeoutPerRequest ] [-ClientTimeoutPerRequest ] [-DefaultProfile ] [-ConcurrentTaskCount ] [-WhatIf] [-Confirm] [] ``` @@ -35,8 +36,8 @@ Set-AzStorageBlobContent [-File] [-Blob ] -CloudBlobContainer < ### BlobPipeline ``` Set-AzStorageBlobContent [-File] -CloudBlob [-BlobType ] [-Properties ] - [-Metadata ] [-PremiumPageBlobTier ] [-Force] [-AsJob] - [-Context ] [-ServerTimeoutPerRequest ] [-ClientTimeoutPerRequest ] + [-Metadata ] [-PremiumPageBlobTier ] [-StandardBlobTier ] + [-Force] [-AsJob] [-Context ] [-ServerTimeoutPerRequest ] [-ClientTimeoutPerRequest ] [-DefaultProfile ] [-ConcurrentTaskCount ] [-WhatIf] [-Confirm] [] ``` @@ -90,12 +91,12 @@ The first command creates a hash table that contains metadata for a blob, and st The second command uploads the file that is named ContosoPlanning to the container named ContosoUploads. The blob includes the metadata stored in $Metadata, and has PremiumPageBlobTier as P10. -### Example 6: Upload a file to blob with specified blob properties +### Example 6: Upload a file to blob with specified blob properties, and set StandardBlobTier as Cool ``` -PS C:\> Set-AzStorageBlobContent -File "ContosoPlanning" -Container "ContosoUploads" -Properties @{"ContentType" = "image/jpeg"; "ContentMD5" = "i727sP7HigloQDsqadNLHw=="} +PS C:\> Set-AzStorageBlobContent -File "ContosoPlanning" -Container "ContosoUploads" -Properties @{"ContentType" = "image/jpeg"; "ContentMD5" = "i727sP7HigloQDsqadNLHw=="} -StandardBlobTier Cool ``` -This command uploads the file that is named ContosoPlanning to the container named ContosoUploads with specified blob properties. +This command uploads the file that is named ContosoPlanning to the container named ContosoUploads with specified blob properties, and sets StandardBlobTier as Cool ## PARAMETERS @@ -372,6 +373,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -StandardBlobTier +Block Blob Tier + +```yaml +Type: Microsoft.WindowsAzure.Storage.Blob.StandardBlobTier +Parameter Sets: (All) +Aliases: +Accepted values: Unknown, Hot, Cool, Archive + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. diff --git a/src/Storage/Storage.Management/help/Start-AzStorageBlobCopy.md b/src/Storage/Storage.Management/help/Start-AzStorageBlobCopy.md index d5561cb8b165..2fee8a7de98f 100644 --- a/src/Storage/Storage.Management/help/Start-AzStorageBlobCopy.md +++ b/src/Storage/Storage.Management/help/Start-AzStorageBlobCopy.md @@ -16,35 +16,35 @@ Starts to copy a blob. ### ContainerName (Default) ``` Start-AzStorageBlobCopy [-SrcBlob] -SrcContainer -DestContainer [-DestBlob ] - [-PremiumPageBlobTier ] [-Context ] [-DestContext ] - [-Force] [-ServerTimeoutPerRequest ] [-ClientTimeoutPerRequest ] - [-DefaultProfile ] [-ConcurrentTaskCount ] [-WhatIf] [-Confirm] - [] + [-PremiumPageBlobTier ] [-StandardBlobTier ] + [-Context ] [-DestContext ] [-Force] [-ServerTimeoutPerRequest ] + [-ClientTimeoutPerRequest ] [-DefaultProfile ] [-ConcurrentTaskCount ] + [-WhatIf] [-Confirm] [] ``` ### BlobInstance ``` Start-AzStorageBlobCopy -CloudBlob -DestContainer [-DestBlob ] - [-PremiumPageBlobTier ] [-Context ] [-DestContext ] - [-Force] [-ServerTimeoutPerRequest ] [-ClientTimeoutPerRequest ] - [-DefaultProfile ] [-ConcurrentTaskCount ] [-WhatIf] [-Confirm] - [] + [-PremiumPageBlobTier ] [-StandardBlobTier ] + [-Context ] [-DestContext ] [-Force] [-ServerTimeoutPerRequest ] + [-ClientTimeoutPerRequest ] [-DefaultProfile ] [-ConcurrentTaskCount ] + [-WhatIf] [-Confirm] [] ``` ### BlobInstanceToBlobInstance ``` Start-AzStorageBlobCopy -CloudBlob -DestCloudBlob - [-PremiumPageBlobTier ] [-Context ] [-DestContext ] - [-Force] [-ServerTimeoutPerRequest ] [-ClientTimeoutPerRequest ] - [-DefaultProfile ] [-ConcurrentTaskCount ] [-WhatIf] [-Confirm] - [] + [-PremiumPageBlobTier ] [-StandardBlobTier ] + [-Context ] [-DestContext ] [-Force] [-ServerTimeoutPerRequest ] + [-ClientTimeoutPerRequest ] [-DefaultProfile ] [-ConcurrentTaskCount ] + [-WhatIf] [-Confirm] [] ``` ### ContainerInstance ``` Start-AzStorageBlobCopy -CloudBlobContainer [-SrcBlob] -DestContainer - [-DestBlob ] [-PremiumPageBlobTier ] [-Context ] - [-DestContext ] [-Force] [-ServerTimeoutPerRequest ] + [-DestBlob ] [-PremiumPageBlobTier ] [-StandardBlobTier ] + [-Context ] [-DestContext ] [-Force] [-ServerTimeoutPerRequest ] [-ClientTimeoutPerRequest ] [-DefaultProfile ] [-ConcurrentTaskCount ] [-WhatIf] [-Confirm] [] ``` @@ -154,6 +154,13 @@ This command creates a context for the account named ContosoGeneral that uses th The second command copies the file from the specified URI to the blob named ContosoPlanning in the container named ContosoArchive. The command starts the copy operation in the context stored in $Context. +### Example 6: Copy a source block blob, to a destination block blob with StandardBlobTier as Archive +``` +C:\PS>Start-AzStorageBlobCopy -SrcContainer "ContosoUploads" -SrcBlob "ContosoPlanning2015" -DestContainer "ContosoArchives" -DestBlob "ContosoPlanning2015Backup" -StandardBlobTier Archive +``` + +This command starts the copy operation of the block blob, to a destination block blob with StandardBlobTier as Archive. + ## PARAMETERS ### -AbsoluteUri @@ -510,6 +517,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -StandardBlobTier +Block Blob Tier + +```yaml +Type: Microsoft.WindowsAzure.Storage.Blob.StandardBlobTier +Parameter Sets: ContainerName, BlobInstance, BlobInstanceToBlobInstance, ContainerInstance +Aliases: +Accepted values: Hot, Cool + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. diff --git a/src/Storage/Storage.Test/Service/MockStorageBlobManagement.cs b/src/Storage/Storage.Test/Service/MockStorageBlobManagement.cs index 00828b7c43dc..dea692e9bc8a 100644 --- a/src/Storage/Storage.Test/Service/MockStorageBlobManagement.cs +++ b/src/Storage/Storage.Test/Service/MockStorageBlobManagement.cs @@ -716,6 +716,16 @@ public AccountProperties GetAccountProperties() throw new NotImplementedException(); } + public Task SetStandardBlobTierAsync(CloudBlockBlob blob, AccessCondition accessCondition, StandardBlobTier tier, BlobRequestOptions options, OperationContext operationContext, CancellationToken cmdletCancellationToken) + { + throw new NotImplementedException(); + } + + public Task StartCopyAsync(CloudBlockBlob blob, Uri source, StandardBlobTier standardBlobTier, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } + /// /// The storage context /// diff --git a/src/Storage/Storage.Test/Storage.Test.csproj b/src/Storage/Storage.Test/Storage.Test.csproj index a25c758ec319..0bb947218502 100644 --- a/src/Storage/Storage.Test/Storage.Test.csproj +++ b/src/Storage/Storage.Test/Storage.Test.csproj @@ -14,9 +14,9 @@ - - - + + + diff --git a/src/Storage/Storage/Blob/Cmdlet/SetAzureStorageBlobContent.cs b/src/Storage/Storage/Blob/Cmdlet/SetAzureStorageBlobContent.cs index b309ea0c21cd..82ff3e03ee07 100644 --- a/src/Storage/Storage/Blob/Cmdlet/SetAzureStorageBlobContent.cs +++ b/src/Storage/Storage/Blob/Cmdlet/SetAzureStorageBlobContent.cs @@ -154,7 +154,7 @@ public Hashtable Metadata private Hashtable BlobMetadata = null; - [Parameter(HelpMessage = "Page Blob Tier", Mandatory = false)] + [Parameter(HelpMessage = "Premium Page Blob Tier", Mandatory = false)] public PremiumPageBlobTier PremiumPageBlobTier { get @@ -170,6 +170,22 @@ public PremiumPageBlobTier PremiumPageBlobTier private PremiumPageBlobTier? pageBlobTier = null; + [Parameter(HelpMessage = "Block Blob Tier", Mandatory = false)] + [ValidateSet("Hot", "Cool", "Archive", IgnoreCase = true)] + public StandardBlobTier StandardBlobTier + { + get + { + return standardBlobTier.Value; + } + + set + { + standardBlobTier = value; + } + } + private StandardBlobTier? standardBlobTier = null; + private BlobUploadRequestQueue UploadRequests = new BlobUploadRequestQueue(); /// @@ -223,12 +239,12 @@ await DataMovementTransferHelper.DoTransfer(() => data.Record, this.OutputStream).ConfigureAwait(false); - if (this.BlobProperties != null || this.BlobMetadata != null || this.pageBlobTier != null) + if (this.BlobProperties != null || this.BlobMetadata != null || this.pageBlobTier != null || this.standardBlobTier != null) { await Task.WhenAll( this.SetBlobProperties(localChannel, blob, this.BlobProperties), this.SetBlobMeta(localChannel, blob, this.BlobMetadata), - this.SetBlobTier(localChannel, blob, pageBlobTier)).ConfigureAwait(false); + this.SetBlobTier(localChannel, blob, pageBlobTier, standardBlobTier)).ConfigureAwait(false); } try @@ -437,9 +453,9 @@ private async Task SetBlobMeta(IStorageBlobManagement localChannel, StorageBlob. /// CloudBlob object /// Block Blob Tier /// Page Blob Tier - private async Task SetBlobTier(IStorageBlobManagement localChannel, StorageBlob.CloudBlob blob, PremiumPageBlobTier? pageBlobTier) + private async Task SetBlobTier(IStorageBlobManagement localChannel, StorageBlob.CloudBlob blob, PremiumPageBlobTier? pageBlobTier = null, StandardBlobTier? standardBlobTier = null) { - if (pageBlobTier == null) + if (pageBlobTier == null && standardBlobTier == null) { return; } @@ -451,6 +467,11 @@ private async Task SetBlobTier(IStorageBlobManagement localChannel, StorageBlob. { await Channel.SetPageBlobTierAsync((CloudPageBlob)blob, pageBlobTier.Value, requestOptions, OperationContext, CmdletCancellationToken).ConfigureAwait(false); } + if (standardBlobTier != null) + { + AccessCondition accessCondition = null; + await Channel.SetStandardBlobTierAsync((CloudBlockBlob)blob, accessCondition, standardBlobTier.Value, requestOptions, OperationContext, CmdletCancellationToken).ConfigureAwait(false); + } } /// @@ -467,12 +488,12 @@ protected override void OnTaskSuccessful(DataMovementUserData data) AccessCondition accessCondition = null; StorageBlob.BlobRequestOptions requestOptions = RequestOptions; - if (BlobProperties != null || BlobMetadata != null || this.pageBlobTier != null) + if (BlobProperties != null || BlobMetadata != null || this.pageBlobTier != null || this.standardBlobTier != null) { Task[] tasks = new Task[3]; tasks[0] = SetBlobProperties(localChannel, blob, BlobProperties); tasks[1] = SetBlobMeta(localChannel, blob, BlobMetadata); - tasks[2] = SetBlobTier(localChannel, blob, pageBlobTier); + tasks[2] = SetBlobTier(localChannel, blob, pageBlobTier, standardBlobTier); Task.WaitAll(tasks); } @@ -527,8 +548,22 @@ public override void ExecuteCmdlet() DoBeginProcessing(); } - ValidateBlobTier(string.Equals(blobType, PageBlobType, StringComparison.InvariantCultureIgnoreCase)? StorageBlob.BlobType.PageBlob : StorageBlob.BlobType.Unspecified, - pageBlobTier); + + // Validate the Blob Tier matches with blob Type + StorageBlob.BlobType type = StorageBlob.BlobType.BlockBlob; + if (string.Equals(blobType, BlockBlobType, StringComparison.InvariantCultureIgnoreCase)) + { + type = StorageBlob.BlobType.BlockBlob; + } + else if (string.Equals(blobType, PageBlobType, StringComparison.InvariantCultureIgnoreCase)) + { + type = StorageBlob.BlobType.PageBlob; + } + else + { + type = StorageBlob.BlobType.Unspecified; + } + ValidateBlobTier(type, pageBlobTier, standardBlobTier); if (BlobProperties != null) { diff --git a/src/Storage/Storage/Blob/Cmdlet/StartAzureStorageBlobCopy.cs b/src/Storage/Storage/Blob/Cmdlet/StartAzureStorageBlobCopy.cs index 43a8c4aa93d7..6f3f5c41cc54 100644 --- a/src/Storage/Storage/Blob/Cmdlet/StartAzureStorageBlobCopy.cs +++ b/src/Storage/Storage/Blob/Cmdlet/StartAzureStorageBlobCopy.cs @@ -195,9 +195,27 @@ public PremiumPageBlobTier PremiumPageBlobTier pageBlobTier = value; } } - private PremiumPageBlobTier? pageBlobTier = null; + [Parameter(HelpMessage = "Block Blob Tier", Mandatory = false, ParameterSetName = ContainerNameParameterSet)] + [Parameter(HelpMessage = "Block Blob Tier", Mandatory = false, ParameterSetName = BlobParameterSet)] + [Parameter(HelpMessage = "Block Blob Tier", Mandatory = false, ParameterSetName = BlobToBlobParameterSet)] + [Parameter(HelpMessage = "Block Blob Tier", Mandatory = false, ParameterSetName = ContainerParameterSet)] + [ValidateSet("Hot", "Cool", "Archive", IgnoreCase = true)] + public StandardBlobTier StandardBlobTier + { + get + { + return standardBlobTier.Value; + } + + set + { + standardBlobTier = value; + } + } + private StandardBlobTier? standardBlobTier = null; + [Alias("SrcContext", "SourceContext")] [Parameter(HelpMessage = "Source Azure Storage Context Object", ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ContainerNameParameterSet)] [Parameter(HelpMessage = "Source Azure Storage Context Object", ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, ParameterSetName = BlobParameterSet)] @@ -385,7 +403,7 @@ public override void ExecuteCmdlet() private void StartCopyBlob(IStorageBlobManagement destChannel, CloudBlob srcCloudBlob, CloudBlob destCloudBlob) { ValidateBlobType(srcCloudBlob); - ValidateBlobTier(srcCloudBlob.BlobType, pageBlobTier); + ValidateBlobTier(srcCloudBlob.BlobType, pageBlobTier, standardBlobTier); Func taskGenerator = (taskId) => StartCopyAsync(taskId, destChannel, srcCloudBlob, destCloudBlob); RunTask(taskGenerator); @@ -574,14 +592,20 @@ private async Task StartCopyFromUri(long taskId, IStorageBlobManagement destChan //Clean the Metadata of the destination Blob object, or the source metadata won't overwirte the dest blob metadata. See https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob destBlob.Metadata.Clear(); - if (pageBlobTier == null) + // The Blob Type and Blob Tier must match, since already checked they are match at the begin of ExecuteCmdlet(). + if (pageBlobTier != null) { - copyId = await destChannel.StartCopyAsync(destBlob, srcUri, null, null, this.RequestOptions, this.OperationContext, this.CmdletCancellationToken).ConfigureAwait(false); + copyId = await destChannel.StartCopyAsync((CloudPageBlob)destBlob, srcUri, pageBlobTier.Value, null, null, this.RequestOptions, this.OperationContext, this.CmdletCancellationToken).ConfigureAwait(false); } - else + else if (standardBlobTier != null) { - copyId = await destChannel.StartCopyAsync((CloudPageBlob)destBlob, srcUri, pageBlobTier.Value, null, null, this.RequestOptions, this.OperationContext, this.CmdletCancellationToken).ConfigureAwait(false); + copyId = await destChannel.StartCopyAsync((CloudBlockBlob)destBlob, srcUri, standardBlobTier.Value, null, null, this.RequestOptions, this.OperationContext, this.CmdletCancellationToken).ConfigureAwait(false); } + else + { + copyId = await destChannel.StartCopyAsync(destBlob, srcUri, null, null, this.RequestOptions, this.OperationContext, this.CmdletCancellationToken).ConfigureAwait(false); + } + this.OutputStream.WriteVerbose(taskId, String.Format(Resources.CopyDestinationBlobPending, destBlob.Name, destBlob.Container.Name, copyId)); this.WriteCloudBlobObject(taskId, destChannel, destBlob); } diff --git a/src/Storage/Storage/Blob/StorageCloudBlobCmdletBase.cs b/src/Storage/Storage/Blob/StorageCloudBlobCmdletBase.cs index 202780760cf2..92a9965f59fd 100644 --- a/src/Storage/Storage/Blob/StorageCloudBlobCmdletBase.cs +++ b/src/Storage/Storage/Blob/StorageCloudBlobCmdletBase.cs @@ -243,13 +243,18 @@ protected void ValidateBlobType(CloudBlob blob) } } - protected void ValidateBlobTier(BlobType type, PremiumPageBlobTier? pageBlobTier) + protected void ValidateBlobTier(BlobType type, PremiumPageBlobTier? pageBlobTier = null, StandardBlobTier? standardBlobTier = null) { if ((pageBlobTier != null) && (type != BlobType.PageBlob)) { throw new ArgumentOutOfRangeException("BlobType, PageBlobTier", String.Format("PremiumPageBlobTier can only be set to Page Blob. The Current BlobType is: {0}", type)); } + if ((standardBlobTier != null) + && (type != BlobType.BlockBlob)) + { + throw new ArgumentOutOfRangeException("BlobType, StandardBlobTier", String.Format("StandardBlobTier can only be set to Block Blob. The Current BlobType is: {0}", type)); + } } protected bool ContainerIsEmpty(CloudBlobContainer container) diff --git a/src/Storage/Storage/Model/Contract/IStorageBlobManagement.cs b/src/Storage/Storage/Model/Contract/IStorageBlobManagement.cs index cf6062dc3347..49227f43f3ea 100644 --- a/src/Storage/Storage/Model/Contract/IStorageBlobManagement.cs +++ b/src/Storage/Storage/Model/Contract/IStorageBlobManagement.cs @@ -331,7 +331,21 @@ Task GetContainerPermissionsAsync(CloudBlobContainer c /// Cancellation token /// Return copy id if succeeded. Task StartCopyAsync(CloudPageBlob blob, Uri source, PremiumPageBlobTier premiumPageBlobTier, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken); - + + /// + /// Return a task that asynchronously start copy operation to a CloudBlockBlob with StandardBlobTier. + /// + /// CloudBlockBlob object + /// Uri to copying source + /// The StandardBlobTier of Destination blob + /// Access condition to source if it's file/blob in azure. + /// Access condition to Destination blob. + /// Blob request options + /// Operation context + /// Cancellation token + /// Return copy id if succeeded. + Task StartCopyAsync(CloudBlockBlob blob, Uri source, StandardBlobTier standardBlobTier, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken); + /// /// Return a task that asynchronously start Incremental copy operation to a page blob. /// @@ -405,6 +419,16 @@ Task GetContainerPermissionsAsync(CloudBlobContainer c /// An object that represents the context for the current operation. Task SetPageBlobTierAsync(CloudPageBlob blob, PremiumPageBlobTier tier, BlobRequestOptions options, OperationContext operationContext, CancellationToken cmdletCancellationToken); + /// + /// Return a task that asynchronously set block blob Tier + /// + /// CloudBlockBlob object + /// block blob Tier + /// Access condition + /// Blob request options + /// An object that represents the context for the current operation. + Task SetStandardBlobTierAsync(CloudBlockBlob blob, AccessCondition accessCondition, StandardBlobTier tier, BlobRequestOptions options, OperationContext operationContext, CancellationToken cmdletCancellationToken); + /// /// List the blobs segmented in specified containers /// diff --git a/src/Storage/Storage/Model/Contract/StorageBlobManagement.cs b/src/Storage/Storage/Model/Contract/StorageBlobManagement.cs index 190ba2e81a39..c1d022673593 100644 --- a/src/Storage/Storage/Model/Contract/StorageBlobManagement.cs +++ b/src/Storage/Storage/Model/Contract/StorageBlobManagement.cs @@ -717,7 +717,18 @@ public Task SetBlobMetadataAsync(CloudBlob blob, AccessCondition accessCondition { return blob.SetMetadataAsync(accessCondition, options, operationContext, cmdletCancellationToken); } - + + /// Return a task that asynchronously set Premium page blob Tier + /// + /// CloudPageBlob object + /// Premium pageblob Tier + /// Blob request options + /// An object that represents the context for the current operation. + public Task SetPageBlobTierAsync(CloudPageBlob blob, PremiumPageBlobTier tier, BlobRequestOptions options, XSCL.OperationContext operationContext, CancellationToken cmdletCancellationToken) + { + return blob.SetPremiumBlobTierAsync(tier, options, operationContext, cmdletCancellationToken); + } + /// /// Return a task that asynchronously set block blob Tier /// @@ -726,9 +737,9 @@ public Task SetBlobMetadataAsync(CloudBlob blob, AccessCondition accessCondition /// Access condition /// Blob request options /// An object that represents the context for the current operation. - public Task SetPageBlobTierAsync(CloudPageBlob blob, PremiumPageBlobTier tier, BlobRequestOptions options, XSCL.OperationContext operationContext, CancellationToken cmdletCancellationToken) + public Task SetStandardBlobTierAsync(CloudBlockBlob blob, AccessCondition accessCondition, StandardBlobTier tier, BlobRequestOptions options, XSCL.OperationContext operationContext, CancellationToken cmdletCancellationToken) { - return blob.SetPremiumBlobTierAsync(tier, options, operationContext, cmdletCancellationToken); + return blob.SetStandardBlobTierAsync(tier, accessCondition, options, operationContext, cmdletCancellationToken); } /// @@ -821,6 +832,23 @@ public Task StartCopyAsync(CloudPageBlob blob, Uri source, PremiumPageBl return blob.StartCopyAsync(new CloudPageBlob(source), premiumPageBlobTier, sourceAccessCondition, destAccessCondition, options, operationContext, cancellationToken); } + /// + /// Return a task that asynchronously start copy operation to a CloudBlockBlob with StandardBlobTier. + /// + /// CloudBlockBlob object + /// Uri to copying source + /// The StandardBlobTier of Destination blob + /// Access condition to source if it's file/blob in azure. + /// Access condition to Destination blob. + /// Blob request options + /// Operation context + /// Cancellation token + /// Return copy id if succeeded. + public Task StartCopyAsync(CloudBlockBlob blob, Uri source, StandardBlobTier standardBlobTier, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, BlobRequestOptions options, XSCL.OperationContext operationContext, CancellationToken cancellationToken) + { + return blob.StartCopyAsync(new CloudBlockBlob(source), standardBlobTier, sourceAccessCondition, destAccessCondition, options, operationContext, cancellationToken); + } + /// /// Return a task that asynchronously start Incremental copy operation to a page blob. /// diff --git a/src/Storage/Storage/Storage.csproj b/src/Storage/Storage/Storage.csproj index 9ac399c78cb0..1d5388df71cd 100644 --- a/src/Storage/Storage/Storage.csproj +++ b/src/Storage/Storage/Storage.csproj @@ -14,9 +14,9 @@ - - - + + + diff --git a/src/lib/Microsoft.Azure.Storage.DataMovement.dll b/src/lib/Microsoft.Azure.Storage.DataMovement.dll index c66e0be8fac2..8d3722e58fa3 100644 Binary files a/src/lib/Microsoft.Azure.Storage.DataMovement.dll and b/src/lib/Microsoft.Azure.Storage.DataMovement.dll differ