From a6adc8ea0b264e72d356f005014fd5a6a5d043ab Mon Sep 17 00:00:00 2001 From: yifanz7 <131133995+yifanz7@users.noreply.github.com> Date: Tue, 20 Aug 2024 10:50:49 +0800 Subject: [PATCH] Add breaking chang warnings for file track2 sdk migration (#25879) --- src/Storage/Storage.Management/ChangeLog.md | 18 ++++++++++++++++++ .../File/Cmdlet/CloseAzureStorageFileHandle.cs | 4 ++++ .../Storage/File/Cmdlet/GetAzureStorageFile.cs | 5 +++++ .../File/Cmdlet/GetAzureStorageFileContent.cs | 5 +++++ .../Cmdlet/GetAzureStorageFileCopyState.cs | 1 + .../File/Cmdlet/GetAzureStorageFileHandle.cs | 4 ++++ .../File/Cmdlet/GetAzureStorageShare.cs | 6 ++++-- .../File/Cmdlet/NewAzureStorageDirectory.cs | 4 ++++ .../File/Cmdlet/NewAzureStorageFileSasToken.cs | 2 ++ .../File/Cmdlet/NewAzureStorageShare.cs | 1 + .../Cmdlet/NewAzureStorageShareSasToken.cs | 1 + .../File/Cmdlet/RemoveAzureStorageDirectory.cs | 4 ++++ .../File/Cmdlet/RemoveAzureStorageFile.cs | 4 ++++ .../File/Cmdlet/RemoveAzureStorageShare.cs | 2 ++ .../File/Cmdlet/SetAzureStorageFileContent.cs | 3 +++ .../File/Cmdlet/SetAzureStorageShareQuota.cs | 2 ++ .../File/Cmdlet/StartAzureStorageFileCopy.cs | 6 ++++++ .../File/Cmdlet/StopAzureStorageFileCopy.cs | 2 ++ 18 files changed, 72 insertions(+), 2 deletions(-) diff --git a/src/Storage/Storage.Management/ChangeLog.md b/src/Storage/Storage.Management/ChangeLog.md index c1fa93ef0c71..d11c00237f50 100644 --- a/src/Storage/Storage.Management/ChangeLog.md +++ b/src/Storage/Storage.Management/ChangeLog.md @@ -23,6 +23,24 @@ - `Set-AzStorageAccount` * Updated list share output display format - `Get-AzStorageShare` +* Added warnings for upcoming breaking changes in File cmdlets for removing references to "Microsoft.Azure.Storage.File" + - `Close-AzStorageFileHandle` + - `Get-AzStorageFile` + - `Get-AzStorageFileContent` + - `Get-AzStorageFileCopyState` + - `Get-AzStorageFileHandle` + - `Get-AzStorageShare` + - `New-AzStorageDirectory` + - `New-AzStorageFileSASToken` + - `New-AzStorageShare` + - `New-AzStorageShareSASToken` + - `Remove-AzStorageDirectory` + - `Remove-AzStorageFile` + - `Remove-AzStorageShare` + - `Set-AzStorageFileContent` + - `Set-AzStorageShareQuota` + - `Start-AzStorageFileCopy` + - `Stop-AzStorageFileCopy` ## Version 7.2.0 * Upgraded Microsoft.Azure.Storage.DataMovement to 2.0.5 diff --git a/src/Storage/Storage/File/Cmdlet/CloseAzureStorageFileHandle.cs b/src/Storage/Storage/File/Cmdlet/CloseAzureStorageFileHandle.cs index a7518363a2ef..9618e6050011 100644 --- a/src/Storage/Storage/File/Cmdlet/CloseAzureStorageFileHandle.cs +++ b/src/Storage/Storage/File/Cmdlet/CloseAzureStorageFileHandle.cs @@ -18,6 +18,7 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet using global::Azure.Storage.Files.Shares.Models; using Microsoft.Azure.Commands.Common.Authentication.Abstractions; using Microsoft.Azure.Storage.File; + using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; using Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel; using Microsoft.WindowsAzure.Commands.Storage.Common; using Microsoft.WindowsAzure.Commands.Storage.Model.ResourceModel; @@ -83,6 +84,7 @@ public class CloseAzureStorageFileHandle : AzureStorageFileCmdletBase [ValidateNotNullOrEmpty] public string ShareName { get; set; } + [CmdletParameterBreakingChangeWithVersion("Share", "13.0.0", "8.0.0", ChangeDescription = "The parameter Share will be deprecated, and ShareClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, @@ -116,6 +118,7 @@ public class CloseAzureStorageFileHandle : AzureStorageFileCmdletBase [ValidateNotNull] public ShareClient ShareClient { get; set; } + [CmdletParameterBreakingChangeWithVersion("Directory", "13.0.0", "8.0.0", ChangeDescription = "The parameter Directory will be deprecated, and ShareDirectoryClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, @@ -136,6 +139,7 @@ public class CloseAzureStorageFileHandle : AzureStorageFileCmdletBase [ValidateNotNull] public ShareDirectoryClient ShareDirectoryClient { get; set; } + [CmdletParameterBreakingChangeWithVersion("File", "13.0.0", "8.0.0", ChangeDescription = "The parameter File will be deprecated, and ShareFileClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, diff --git a/src/Storage/Storage/File/Cmdlet/GetAzureStorageFile.cs b/src/Storage/Storage/File/Cmdlet/GetAzureStorageFile.cs index 457429a18b24..c98be657a1ae 100644 --- a/src/Storage/Storage/File/Cmdlet/GetAzureStorageFile.cs +++ b/src/Storage/Storage/File/Cmdlet/GetAzureStorageFile.cs @@ -18,12 +18,15 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet using global::Azure.Storage.Files.Shares; using global::Azure.Storage.Files.Shares.Models; using Microsoft.Azure.Storage.File; + using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; using Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel; using Microsoft.WindowsAzure.Commands.Storage.Common; using System.Collections.Generic; using System.Globalization; using System.Management.Automation; + [CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFile), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFile from deprecated v11 SDK will be removed. Use child property ShareFileClient instead.")] + [CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFileDirectory), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFileDirectory from deprecated v11 SDK will be removed. Use child property ShareDirectoryClient instead.")] [Cmdlet("Get", Azure.Commands.ResourceManager.Common.AzureRMConstants.AzurePrefix + "StorageFile", DefaultParameterSetName = Constants.ShareNameParameterSetName)] [OutputType(typeof(AzureStorageFile))] public class GetAzureStorageFile : AzureStorageFileCmdletBase @@ -36,6 +39,7 @@ public class GetAzureStorageFile : AzureStorageFileCmdletBase [ValidateNotNullOrEmpty] public string ShareName { get; set; } + [CmdletParameterBreakingChangeWithVersion("Share", "13.0.0", "8.0.0", ChangeDescription = "The parameter Share will be deprecated, and ShareClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, @@ -56,6 +60,7 @@ public class GetAzureStorageFile : AzureStorageFileCmdletBase [ValidateNotNull] public ShareClient ShareClient { get; set; } + [CmdletParameterBreakingChangeWithVersion("Directory", "13.0.0", "8.0.0", ChangeDescription = "The parameter Directory will be deprecated, and ShareDirectoryClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, diff --git a/src/Storage/Storage/File/Cmdlet/GetAzureStorageFileContent.cs b/src/Storage/Storage/File/Cmdlet/GetAzureStorageFileContent.cs index f6bb08110be8..d434e6a7f640 100644 --- a/src/Storage/Storage/File/Cmdlet/GetAzureStorageFileContent.cs +++ b/src/Storage/Storage/File/Cmdlet/GetAzureStorageFileContent.cs @@ -25,6 +25,7 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet using Microsoft.Azure.Documents.Partitioning; using Microsoft.Azure.Storage.DataMovement; using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; using Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel; using Microsoft.WindowsAzure.Commands.Storage.Common; using Microsoft.WindowsAzure.Commands.Utilities.Common; @@ -34,6 +35,7 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet using LocalDirectory = System.IO.Directory; using LocalPath = System.IO.Path; + [CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFile), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFile from deprecated v11 SDK will be removed when -PassThru is specified. Use child property ShareFileClient instead.")] [Cmdlet("Get", Azure.Commands.ResourceManager.Common.AzureRMConstants.AzurePrefix + "StorageFileContent", SupportsShouldProcess = true, DefaultParameterSetName = LocalConstants.ShareNameParameterSetName)] [OutputType(typeof(AzureStorageFile))] public class GetAzureStorageFileContent : StorageFileDataManagementCmdletBase, IDynamicParameters @@ -46,6 +48,7 @@ public class GetAzureStorageFileContent : StorageFileDataManagementCmdletBase, I [ValidateNotNullOrEmpty] public string ShareName { get; set; } + [CmdletParameterBreakingChangeWithVersion("Share", "13.0.0", "8.0.0", ChangeDescription = "The parameter Share will be deprecated, and ShareClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, @@ -65,6 +68,7 @@ public class GetAzureStorageFileContent : StorageFileDataManagementCmdletBase, I [ValidateNotNull] public ShareClient ShareClient { get; set; } + [CmdletParameterBreakingChangeWithVersion("Directory", "13.0.0", "8.0.0", ChangeDescription = "The parameter Directory will be deprecated, and ShareDirectoryClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, @@ -85,6 +89,7 @@ public class GetAzureStorageFileContent : StorageFileDataManagementCmdletBase, I [ValidateNotNull] public ShareDirectoryClient ShareDirectoryClient { get; set; } + [CmdletParameterBreakingChangeWithVersion("File", "13.0.0", "8.0.0", ChangeDescription = "The parameter File will be deprecated, and ShareFileClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, diff --git a/src/Storage/Storage/File/Cmdlet/GetAzureStorageFileCopyState.cs b/src/Storage/Storage/File/Cmdlet/GetAzureStorageFileCopyState.cs index 2721d4031ff7..4bc34a9e9115 100644 --- a/src/Storage/Storage/File/Cmdlet/GetAzureStorageFileCopyState.cs +++ b/src/Storage/Storage/File/Cmdlet/GetAzureStorageFileCopyState.cs @@ -49,6 +49,7 @@ public class GetAzureStorageFileCopyStateCommand : AzureStorageFileCmdletBase [ValidateNotNullOrEmpty] public string FilePath { get; set; } + [CmdletParameterBreakingChangeWithVersion("File", "13.0.0", "8.0.0", ChangeDescription = "The parameter File will be deprecated, and ShareFileClient will be mandatory.")] [Parameter( Position = 0, HelpMessage = "Target file instance", Mandatory = true, diff --git a/src/Storage/Storage/File/Cmdlet/GetAzureStorageFileHandle.cs b/src/Storage/Storage/File/Cmdlet/GetAzureStorageFileHandle.cs index cfa1b72a439c..f5605d502246 100644 --- a/src/Storage/Storage/File/Cmdlet/GetAzureStorageFileHandle.cs +++ b/src/Storage/Storage/File/Cmdlet/GetAzureStorageFileHandle.cs @@ -18,6 +18,7 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet using global::Azure.Storage.Files.Shares; using global::Azure.Storage.Files.Shares.Models; using Microsoft.Azure.Storage.File; + using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; using Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel; using Microsoft.WindowsAzure.Commands.Storage.Common; using Microsoft.WindowsAzure.Commands.Storage.Model.ResourceModel; @@ -37,6 +38,7 @@ public class GetAzureStorageFileHandle : AzureStorageFileCmdletBase [ValidateNotNullOrEmpty] public string ShareName { get; set; } + [CmdletParameterBreakingChangeWithVersion("Share", "13.0.0", "8.0.0", ChangeDescription = "The parameter Share will be deprecated, and ShareClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, @@ -57,6 +59,7 @@ public class GetAzureStorageFileHandle : AzureStorageFileCmdletBase [ValidateNotNull] public ShareClient ShareClient { get; set; } + [CmdletParameterBreakingChangeWithVersion("Directory", "13.0.0", "8.0.0", ChangeDescription = "The parameter Directory will be deprecated, and ShareDirectoryClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, @@ -77,6 +80,7 @@ public class GetAzureStorageFileHandle : AzureStorageFileCmdletBase [ValidateNotNull] public ShareDirectoryClient ShareDirectoryClient { get; set; } + [CmdletParameterBreakingChangeWithVersion("File", "13.0.0", "8.0.0", ChangeDescription = "The parameter File will be deprecated, and ShareFileClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, diff --git a/src/Storage/Storage/File/Cmdlet/GetAzureStorageShare.cs b/src/Storage/Storage/File/Cmdlet/GetAzureStorageShare.cs index 55caedc572bb..1ac08868eadd 100644 --- a/src/Storage/Storage/File/Cmdlet/GetAzureStorageShare.cs +++ b/src/Storage/Storage/File/Cmdlet/GetAzureStorageShare.cs @@ -27,6 +27,8 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet using global::Azure.Storage.Files.Shares.Models; using global::Azure.Storage.Files.Shares; using global::Azure; + + [CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFileShare), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFileShare from deprecated v11 SDK will be removed. Use child property ShareClient instead.")] [Cmdlet("Get", Azure.Commands.ResourceManager.Common.AzureRMConstants.AzurePrefix + "StorageShare", DefaultParameterSetName = Constants.MatchingPrefixParameterSetName)] [OutputType(typeof(AzureStorageFileShare))] public class GetAzureStorageShare : AzureStorageFileCmdletBase @@ -50,8 +52,8 @@ public class GetAzureStorageShare : AzureStorageFileCmdletBase Mandatory = false, ParameterSetName = Constants.SpecificParameterSetName, HelpMessage = "SnapshotTime of the file share snapshot to be received.")] - [ValidateNotNullOrEmpty] - public DateTimeOffset? SnapshotTime { get; set; } + [ValidateNotNullOrEmpty] + public DateTimeOffset? SnapshotTime { get; set; } [Parameter(Mandatory = false, HelpMessage = "Include deleted shares, by default get share won't include deleted shares", diff --git a/src/Storage/Storage/File/Cmdlet/NewAzureStorageDirectory.cs b/src/Storage/Storage/File/Cmdlet/NewAzureStorageDirectory.cs index 127d308ec2fe..4fae5925e32c 100644 --- a/src/Storage/Storage/File/Cmdlet/NewAzureStorageDirectory.cs +++ b/src/Storage/Storage/File/Cmdlet/NewAzureStorageDirectory.cs @@ -16,11 +16,13 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet { using global::Azure.Storage.Files.Shares; using Microsoft.Azure.Storage.File; + using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; using Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel; using Microsoft.WindowsAzure.Commands.Storage.Common; using System.Globalization; using System.Management.Automation; + [CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFile), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFileDirectory from deprecated v11 SDK will be removed. Use child property ShareDirectoryClient instead.")] [Cmdlet("New", Azure.Commands.ResourceManager.Common.AzureRMConstants.AzurePrefix + "StorageDirectory", DefaultParameterSetName = Constants.ShareNameParameterSetName), OutputType(typeof(AzureStorageFileDirectory))] public class NewAzureStorageDirectory : AzureStorageFileCmdletBase { @@ -32,6 +34,7 @@ public class NewAzureStorageDirectory : AzureStorageFileCmdletBase [ValidateNotNullOrEmpty] public string ShareName { get; set; } + [CmdletParameterBreakingChangeWithVersion("Share", "13.0.0", "8.0.0", ChangeDescription = "The parameter Share will be deprecated, and ShareClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, @@ -52,6 +55,7 @@ public class NewAzureStorageDirectory : AzureStorageFileCmdletBase [ValidateNotNull] public ShareClient ShareClient { get; set; } + [CmdletParameterBreakingChangeWithVersion("Directory", "13.0.0", "8.0.0", ChangeDescription = "The parameter Directory will be deprecated, and ShareDirectoryClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, diff --git a/src/Storage/Storage/File/Cmdlet/NewAzureStorageFileSasToken.cs b/src/Storage/Storage/File/Cmdlet/NewAzureStorageFileSasToken.cs index bb2a7b397e2f..f8678317cfc3 100644 --- a/src/Storage/Storage/File/Cmdlet/NewAzureStorageFileSasToken.cs +++ b/src/Storage/Storage/File/Cmdlet/NewAzureStorageFileSasToken.cs @@ -78,6 +78,7 @@ public class NewAzureStorageFileSasToken : AzureStorageFileCmdletBase [ValidateNotNullOrEmpty] public string Path { get; set; } + [CmdletParameterBreakingChangeWithVersion("File", "13.0.0", "8.0.0", ChangeDescription = "The parameter File will be deprecated, and a new mandatory parameter ShareFileClient will be added.")] [Parameter(Mandatory = true, HelpMessage = "CloudFile instance to represent the file to get SAS token against.", ValueFromPipeline = true, @@ -113,6 +114,7 @@ public string Policy [ValidateNotNullOrEmpty] public string Permission { get; set; } + [CmdletParameterBreakingChangeWithVersion("Protocol", "13.0.0", "8.0.0", ChangeDescription = "The type of parameter Protocol will be changed from SharedAccessProtocol to string.")] [Parameter(Mandatory = false, HelpMessage = "Protocol can be used in the request with this SAS token.")] [ValidateNotNull] public SharedAccessProtocol? Protocol { get; set; } diff --git a/src/Storage/Storage/File/Cmdlet/NewAzureStorageShare.cs b/src/Storage/Storage/File/Cmdlet/NewAzureStorageShare.cs index 275b0ce03212..a22c64c139ba 100644 --- a/src/Storage/Storage/File/Cmdlet/NewAzureStorageShare.cs +++ b/src/Storage/Storage/File/Cmdlet/NewAzureStorageShare.cs @@ -22,6 +22,7 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet using Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel; using Microsoft.WindowsAzure.Commands.Storage.Common; + [CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFileShare), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFileShare from deprecated v11 SDK will be removed. Use child property ShareClient instead.")] [Cmdlet("New", Azure.Commands.ResourceManager.Common.AzureRMConstants.AzurePrefix + "StorageShare", DefaultParameterSetName = Constants.ShareNameParameterSetName), OutputType(typeof(AzureStorageFileShare))] public class NewAzureStorageShare : AzureStorageFileCmdletBase { diff --git a/src/Storage/Storage/File/Cmdlet/NewAzureStorageShareSasToken.cs b/src/Storage/Storage/File/Cmdlet/NewAzureStorageShareSasToken.cs index abbdff10b4d2..b837ab74f05f 100644 --- a/src/Storage/Storage/File/Cmdlet/NewAzureStorageShareSasToken.cs +++ b/src/Storage/Storage/File/Cmdlet/NewAzureStorageShareSasToken.cs @@ -64,6 +64,7 @@ public string Policy [ValidateNotNullOrEmpty] public string Permission { get; set; } + [CmdletParameterBreakingChangeWithVersion("Protocol", "13.0.0", "8.0.0", ChangeDescription = "The type of parameter Protocol will be changed from SharedAccessProtocol to string.")] [Parameter(Mandatory = false, HelpMessage = "Protocol can be used in the request with this SAS token.")] [ValidateNotNull] public SharedAccessProtocol? Protocol { get; set; } diff --git a/src/Storage/Storage/File/Cmdlet/RemoveAzureStorageDirectory.cs b/src/Storage/Storage/File/Cmdlet/RemoveAzureStorageDirectory.cs index 02778ad4c9a6..228388d08424 100644 --- a/src/Storage/Storage/File/Cmdlet/RemoveAzureStorageDirectory.cs +++ b/src/Storage/Storage/File/Cmdlet/RemoveAzureStorageDirectory.cs @@ -16,11 +16,13 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet { using global::Azure.Storage.Files.Shares; using Microsoft.Azure.Storage.File; + using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; using Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel; using Microsoft.WindowsAzure.Commands.Storage.Common; using System.Globalization; using System.Management.Automation; + [CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFile), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFileDirectory from deprecated v11 SDK will be removed when -PassThru is specified. Use child property ShareDirectoryClient instead.")] [Cmdlet("Remove", Azure.Commands.ResourceManager.Common.AzureRMConstants.AzurePrefix + "StorageDirectory",SupportsShouldProcess = true,DefaultParameterSetName = Constants.ShareNameParameterSetName), OutputType(typeof(AzureStorageFileDirectory))] public class RemoveAzureStorageDirectory : AzureStorageFileCmdletBase { @@ -32,6 +34,7 @@ public class RemoveAzureStorageDirectory : AzureStorageFileCmdletBase [ValidateNotNullOrEmpty] public string ShareName { get; set; } + [CmdletParameterBreakingChangeWithVersion("Share", "13.0.0", "8.0.0", ChangeDescription = "The parameter Share will be deprecated, and ShareClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, @@ -52,6 +55,7 @@ public class RemoveAzureStorageDirectory : AzureStorageFileCmdletBase [ValidateNotNull] public ShareClient ShareClient { get; set; } + [CmdletParameterBreakingChangeWithVersion("Directory", "13.0.0", "8.0.0", ChangeDescription = "The parameter Directory will be deprecated, and ShareDirectoryClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, diff --git a/src/Storage/Storage/File/Cmdlet/RemoveAzureStorageFile.cs b/src/Storage/Storage/File/Cmdlet/RemoveAzureStorageFile.cs index 7bee9811c2a5..69d455e17e54 100644 --- a/src/Storage/Storage/File/Cmdlet/RemoveAzureStorageFile.cs +++ b/src/Storage/Storage/File/Cmdlet/RemoveAzureStorageFile.cs @@ -22,6 +22,7 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet using System.Globalization; using System.Management.Automation; + [CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFile), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFile from deprecated v11 SDK will be removed when -PassThru is specified. Use child property ShareFileClient instead.")] [Cmdlet("Remove", Azure.Commands.ResourceManager.Common.AzureRMConstants.AzurePrefix + "StorageFile",SupportsShouldProcess = true,DefaultParameterSetName = Constants.ShareNameParameterSetName), OutputType(typeof(AzureStorageFile))] public class RemoveAzureStorageFile : AzureStorageFileCmdletBase { @@ -33,6 +34,7 @@ public class RemoveAzureStorageFile : AzureStorageFileCmdletBase [ValidateNotNullOrEmpty] public string ShareName { get; set; } + [CmdletParameterBreakingChangeWithVersion("Share", "13.0.0", "8.0.0", ChangeDescription = "The parameter Share will be deprecated, and ShareClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, @@ -53,6 +55,7 @@ public class RemoveAzureStorageFile : AzureStorageFileCmdletBase [ValidateNotNull] public ShareClient ShareClient { get; set; } + [CmdletParameterBreakingChangeWithVersion("Directory", "13.0.0", "8.0.0", ChangeDescription = "The parameter Directory will be deprecated, and ShareDirectoryClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, @@ -73,6 +76,7 @@ public class RemoveAzureStorageFile : AzureStorageFileCmdletBase [ValidateNotNull] public ShareDirectoryClient ShareDirectoryClient { get; set; } + [CmdletParameterBreakingChangeWithVersion("File", "13.0.0", "8.0.0", ChangeDescription = "The parameter File will be deprecated, and ShareFileClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, diff --git a/src/Storage/Storage/File/Cmdlet/RemoveAzureStorageShare.cs b/src/Storage/Storage/File/Cmdlet/RemoveAzureStorageShare.cs index 9da92d470200..21c6ea77637f 100644 --- a/src/Storage/Storage/File/Cmdlet/RemoveAzureStorageShare.cs +++ b/src/Storage/Storage/File/Cmdlet/RemoveAzureStorageShare.cs @@ -25,6 +25,7 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet using global::Azure.Storage.Files.Shares.Models; using System; + [CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFileShare), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFileShare from deprecated v11 SDK will be removed when -PassThru is specified. Use child property ShareClient instead.")] [Cmdlet("Remove", Azure.Commands.ResourceManager.Common.AzureRMConstants.AzurePrefix + "StorageShare",DefaultParameterSetName = Constants.ShareNameParameterSetName,SupportsShouldProcess = true), OutputType(typeof(AzureStorageFileShare))] public class RemoveAzureStorageShare : AzureStorageFileCmdletBase { @@ -38,6 +39,7 @@ public class RemoveAzureStorageShare : AzureStorageFileCmdletBase [ValidateNotNullOrEmpty] public string Name { get; set; } + [CmdletParameterBreakingChangeWithVersion("Share", "13.0.0", "8.0.0", ChangeDescription = "The parameter Share will be deprecated, and ShareClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, diff --git a/src/Storage/Storage/File/Cmdlet/SetAzureStorageFileContent.cs b/src/Storage/Storage/File/Cmdlet/SetAzureStorageFileContent.cs index aec87440bf72..4e2043875a20 100644 --- a/src/Storage/Storage/File/Cmdlet/SetAzureStorageFileContent.cs +++ b/src/Storage/Storage/File/Cmdlet/SetAzureStorageFileContent.cs @@ -36,6 +36,7 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet using System.Threading.Tasks; using LocalConstants = Microsoft.WindowsAzure.Commands.Storage.File.Constants; + [CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFile), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFile from deprecated v11 SDK will be removed. Use child property ShareFileClient instead.")] [Cmdlet("Set", Azure.Commands.ResourceManager.Common.AzureRMConstants.AzurePrefix + "StorageFileContent", SupportsShouldProcess = true, DefaultParameterSetName = LocalConstants.ShareNameParameterSetName), OutputType(typeof(AzureStorageFile))] public class SetAzureStorageFileContent : StorageFileDataManagementCmdletBase, IDynamicParameters { @@ -47,6 +48,7 @@ public class SetAzureStorageFileContent : StorageFileDataManagementCmdletBase, I [ValidateNotNullOrEmpty] public string ShareName { get; set; } + [CmdletParameterBreakingChangeWithVersion("Share", "13.0.0", "8.0.0", ChangeDescription = "The parameter Share will be deprecated, and ShareClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, @@ -67,6 +69,7 @@ public class SetAzureStorageFileContent : StorageFileDataManagementCmdletBase, I [ValidateNotNull] public ShareClient ShareClient { get; set; } + [CmdletParameterBreakingChangeWithVersion("Directory", "13.0.0", "8.0.0", ChangeDescription = "The parameter Directory will be deprecated, and ShareDirectoryClient will be mandatory.")] [Parameter( Position = 0, Mandatory = true, diff --git a/src/Storage/Storage/File/Cmdlet/SetAzureStorageShareQuota.cs b/src/Storage/Storage/File/Cmdlet/SetAzureStorageShareQuota.cs index fd7033e35794..6ab8562edac4 100644 --- a/src/Storage/Storage/File/Cmdlet/SetAzureStorageShareQuota.cs +++ b/src/Storage/Storage/File/Cmdlet/SetAzureStorageShareQuota.cs @@ -24,6 +24,7 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet { + [CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFileShare), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFileShare from deprecated v11 SDK will be removed. Use child property ShareClient instead.")] [Cmdlet("Set", Azure.Commands.ResourceManager.Common.AzureRMConstants.AzurePrefix + "StorageShareQuota", DefaultParameterSetName = Constants.ShareNameParameterSetName), OutputType(typeof(AzureStorageFileShare))] public class SetAzureStorageShareQuota : AzureStorageFileCmdletBase { @@ -36,6 +37,7 @@ public class SetAzureStorageShareQuota : AzureStorageFileCmdletBase [ValidateNotNullOrEmpty] public string ShareName { get; set; } + [CmdletParameterBreakingChangeWithVersion("Share", "13.0.0", "8.0.0", ChangeDescription = "The parameter Share will be deprecated, and a new mandatory parameter ShareClient will be added.")] [Parameter( Position = 0, Mandatory = true, diff --git a/src/Storage/Storage/File/Cmdlet/StartAzureStorageFileCopy.cs b/src/Storage/Storage/File/Cmdlet/StartAzureStorageFileCopy.cs index 2618683347d8..5426286bc450 100644 --- a/src/Storage/Storage/File/Cmdlet/StartAzureStorageFileCopy.cs +++ b/src/Storage/Storage/File/Cmdlet/StartAzureStorageFileCopy.cs @@ -32,6 +32,7 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet { + [CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFile), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFile from deprecated v11 SDK will be removed. Use child property ShareFileClient instead.")] [Cmdlet("Start", Azure.Commands.ResourceManager.Common.AzureRMConstants.AzurePrefix + "StorageFileCopy", SupportsShouldProcess = true), OutputType(typeof(AzureStorageFile))] public class StartAzureStorageFileCopyCommand : StorageFileDataManagementCmdletBase { @@ -55,10 +56,12 @@ public class StartAzureStorageFileCopyCommand : StorageFileDataManagementCmdletB [ValidateNotNullOrEmpty] public string SrcContainerName { get; set; } + [CmdletParameterBreakingChangeWithVersion("SrcContainer", "13.0.0", "8.0.0", ChangeDescription = "The type of parameter SrcContainer will be changed from CloudBlobContainer to BlobContainerClient.")] [Parameter(HelpMessage = "Source container instance", Mandatory = true, ParameterSetName = ContainerParameterSet)] [ValidateNotNull] public CloudBlobContainer SrcContainer { get; set; } + [CmdletParameterBreakingChangeWithVersion("SrcBlob", "13.0.0", "8.0.0", ChangeDescription = "The type of parameter SrcBlob will be changed from CloudBlob to BlobBaseClient. The alias ICloudBlob will be deprecated.")] [Alias("ICloudBlob")] [Parameter(HelpMessage = "Source blob instance", Mandatory = true, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, ParameterSetName = BlobFilePathParameterSet)] @@ -76,11 +79,13 @@ public class StartAzureStorageFileCopyCommand : StorageFileDataManagementCmdletB [ValidateNotNullOrEmpty] public string SrcShareName { get; set; } + [CmdletParameterBreakingChangeWithVersion("SrcShare", "13.0.0", "8.0.0", ChangeDescription = "The type of parameter SrcShare will be changed from CloudFileShare to ShareClient. The alias CloudFileShare will be deprecated.")] [Parameter(HelpMessage = "Source share instance", Mandatory = true, ParameterSetName = ShareParameterSet)] [ValidateNotNull] [Alias("CloudFileShare")] public CloudFileShare SrcShare { get; set; } + [CmdletParameterBreakingChangeWithVersion("SrcFile", "13.0.0", "8.0.0", ChangeDescription = "The type of parameter SrcFile will be changed from CloudFile to ShareFileClient. The alias CloudFile will be deprecated.")] [Parameter(HelpMessage = "Source file instance", Mandatory = true, ValueFromPipeline = true, @@ -120,6 +125,7 @@ public class StartAzureStorageFileCopyCommand : StorageFileDataManagementCmdletB [ValidateNotNullOrEmpty] public string DestFilePath { get; set; } + [CmdletParameterBreakingChangeWithVersion("DestFile", "13.0.0", "8.0.0", ChangeDescription = "The parameter DestFile will be deprecated. To input a dest file instance, use DestShareFileClient instead.")] [Parameter(HelpMessage = "Dest file instance", Mandatory = false, ParameterSetName = BlobFileParameterSet)] [Parameter(HelpMessage = "Dest file instance", Mandatory = false, ParameterSetName = FileFileParameterSet)] [Parameter(HelpMessage = "Dest file instance", Mandatory = false, ParameterSetName = UriFileParameterSet)] diff --git a/src/Storage/Storage/File/Cmdlet/StopAzureStorageFileCopy.cs b/src/Storage/Storage/File/Cmdlet/StopAzureStorageFileCopy.cs index c60c5c83676b..6856912df3ad 100644 --- a/src/Storage/Storage/File/Cmdlet/StopAzureStorageFileCopy.cs +++ b/src/Storage/Storage/File/Cmdlet/StopAzureStorageFileCopy.cs @@ -9,6 +9,7 @@ using Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel; using Microsoft.WindowsAzure.Commands.Storage.Common; using Azure.Storage.Files.Shares.Models; +using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet { @@ -31,6 +32,7 @@ public class StopAzureStorageFileCopyCommand : AzureStorageFileCmdletBase [ValidateNotNullOrEmpty] public string FilePath { get; set; } + [CmdletParameterBreakingChangeWithVersion("File", "13.0.0", "8.0.0", ChangeDescription = "The parameter File will be deprecated, and ShareFileClient will be mandatory.")] [Parameter( Position = 0, HelpMessage = "Target file instance", Mandatory = true,