From f0e01445aa645478988478a4032007df10e4f2a0 Mon Sep 17 00:00:00 2001 From: jovancevic123 <62032416+jovancevic123@users.noreply.github.com> Date: Fri, 26 Jul 2024 08:00:33 +0200 Subject: [PATCH] Announcing breaking change for DistributedAvailabilityGroups (#25628) * Announcing deprecation of parameters. * Style fixes * Making changes visible in ChangeLog.md --------- Co-authored-by: jovancevic123 --- src/Sql/Sql/ChangeLog.md | 1 + .../Cmdlet/GetAzureSqlManagedInstanceLink.cs | 6 ++++++ .../Cmdlet/NewAzureSqlManagedInstanceLink.cs | 11 +++++++++++ .../Cmdlet/RemoveAzureSqlManagedInstanceLink.cs | 6 ++++++ .../Cmdlet/UpdateAzureSqlManagedInstanceLink.cs | 6 ++++++ 5 files changed, 30 insertions(+) diff --git a/src/Sql/Sql/ChangeLog.md b/src/Sql/Sql/ChangeLog.md index a9979d767494..a54b1b2ec504 100644 --- a/src/Sql/Sql/ChangeLog.md +++ b/src/Sql/Sql/ChangeLog.md @@ -18,6 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release +* Added breaking change announcement for cmdlets: `New-AzSqlInstanceLink`, `Get-AzSqlInstanceLink`, `Remove-AzSqlInstanceLink`, `Update-AzSqlInstanceLink`. * Added `IsGeneralPurposeV2` and `StorageIOps` parameters to `New-AzSqlInstance`, `Set-AzSqlInstance` to enable the creation of GPv2 instances * Added IsGeneralPurposeV2 and StorageIOps fields to the model of the managed instance so that it displays information about GPv2 instances that are returned by `Get-AzSqlInstance`. * Added new cmdlet `Set-AzSqlDatabaseReplicationLink` for updating replication link type diff --git a/src/Sql/Sql/DistributedAvailabilityGroup/Cmdlet/GetAzureSqlManagedInstanceLink.cs b/src/Sql/Sql/DistributedAvailabilityGroup/Cmdlet/GetAzureSqlManagedInstanceLink.cs index 8f5778c7b97d..fbd00ff11607 100644 --- a/src/Sql/Sql/DistributedAvailabilityGroup/Cmdlet/GetAzureSqlManagedInstanceLink.cs +++ b/src/Sql/Sql/DistributedAvailabilityGroup/Cmdlet/GetAzureSqlManagedInstanceLink.cs @@ -16,6 +16,7 @@ using Microsoft.Azure.Commands.Sql.ManagedInstance.Model; using Microsoft.Azure.Commands.Sql.ManagedInstanceHybridLink.Model; using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; +using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; using System; using System.Collections.Generic; using System.Linq; @@ -26,6 +27,11 @@ namespace Microsoft.Azure.Commands.Sql.ManagedInstanceHybridLink.Cmdlet /// /// Cmdlet to get a Manged Instance Link /// + [CmdletOutputBreakingChangeWithVersion(typeof(AzureSqlManagedInstanceLinkModel), "13.0.0", "6.0.0", + DeprecatedOutputProperties = new String[] { "TargetDatabase", "PrimaryAvailabilityGroupName", "SecondaryAvailabilityGroupName", + "SourceEndpoint", "SourceReplicaId", "TargetReplicaId", "LinkState", "LastHardenedLsn" }, + NewOutputProperties = new String[] { "Databases", "DistributedAvailabilityGroupName ", "InstanceAvailabilityGroupName", "PartnerAvailabilityGroupName", + "InstanceLinkRole", "PartnerLinkRole", "FailoverMode", "SeedingMode", "PartnerEndpoint" })] [Cmdlet(VerbsCommon.Get, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SqlInstanceLink", DefaultParameterSetName = GetByNameParameterSet), OutputType(typeof(AzureSqlManagedInstanceLinkModel))] diff --git a/src/Sql/Sql/DistributedAvailabilityGroup/Cmdlet/NewAzureSqlManagedInstanceLink.cs b/src/Sql/Sql/DistributedAvailabilityGroup/Cmdlet/NewAzureSqlManagedInstanceLink.cs index 62ad11da8385..5a8eeb3b4407 100644 --- a/src/Sql/Sql/DistributedAvailabilityGroup/Cmdlet/NewAzureSqlManagedInstanceLink.cs +++ b/src/Sql/Sql/DistributedAvailabilityGroup/Cmdlet/NewAzureSqlManagedInstanceLink.cs @@ -16,6 +16,8 @@ using Microsoft.Azure.Commands.Sql.ManagedInstance.Model; using Microsoft.Azure.Commands.Sql.ManagedInstanceHybridLink.Model; using Microsoft.Rest.Azure; +using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -26,6 +28,11 @@ namespace Microsoft.Azure.Commands.Sql.ManagedInstanceHybridLink.Cmdlet /// /// Cmdlet to create a new Managed Instance Link /// + [CmdletOutputBreakingChangeWithVersion(typeof(AzureSqlManagedInstanceLinkModel), "13.0.0", "6.0.0", + DeprecatedOutputProperties = new String[] { "TargetDatabase", "PrimaryAvailabilityGroupName", "SecondaryAvailabilityGroupName", + "SourceEndpoint", "SourceReplicaId", "TargetReplicaId", "LinkState", "LastHardenedLsn" }, + NewOutputProperties = new String[] { "Databases", "DistributedAvailabilityGroupName ", "InstanceAvailabilityGroupName", "PartnerAvailabilityGroupName", + "InstanceLinkRole", "PartnerLinkRole", "FailoverMode", "SeedingMode", "PartnerEndpoint" })] [Cmdlet(VerbsCommon.New, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SqlInstanceLink", DefaultParameterSetName = CreateByNameParameterSet, SupportsShouldProcess = true), @@ -63,6 +70,7 @@ public class NewAzureSqlManagedInstanceLink : AzureSqlManagedInstanceLinkCmdletB /// /// Gets or sets the primary availability group name /// + [CmdletParameterBreakingChangeWithVersion("PrimaryAvailabilityGroupName", "13.0.0", "6.0.0", ReplaceMentCmdletParameterName = "PartnerAvailabilityGroupName")] [Parameter(Mandatory = true, ParameterSetName = CreateByNameParameterSet, HelpMessage = "Name of the primary availability group.")] [Parameter(Mandatory = true, ParameterSetName = CreateByParentObjectParameterSet, HelpMessage = "Name of the primary availability group.")] [ValidateNotNullOrEmpty] @@ -71,6 +79,7 @@ public class NewAzureSqlManagedInstanceLink : AzureSqlManagedInstanceLinkCmdletB /// /// Gets or sets the secondary availability group name /// + [CmdletParameterBreakingChangeWithVersion("SecondaryAvailabilityGroupName", "13.0.0", "6.0.0", ReplaceMentCmdletParameterName = "InstanceAvailabilityGroupName")] [Parameter(Mandatory = true, ParameterSetName = CreateByNameParameterSet, HelpMessage = "Name of the secondary availability group.")] [Parameter(Mandatory = true, ParameterSetName = CreateByParentObjectParameterSet, HelpMessage = "Name of the secondary availability group.")] [ValidateNotNullOrEmpty] @@ -79,6 +88,7 @@ public class NewAzureSqlManagedInstanceLink : AzureSqlManagedInstanceLinkCmdletB /// /// Gets or sets the target database /// + [CmdletParameterBreakingChangeWithVersion("TargetDatabase", "13.0.0", "6.0.0", ChangeDescription = "The parameter 'TargetDatabase' is being replaced by parameter 'Databases'. The type of new parameter is changing from 'String' to 'List'")] [Parameter(Mandatory = true, ParameterSetName = CreateByNameParameterSet, HelpMessage = "Name of the target database.")] [Parameter(Mandatory = true, ParameterSetName = CreateByParentObjectParameterSet, HelpMessage = "Name of the target database.")] [ValidateNotNullOrEmpty] @@ -87,6 +97,7 @@ public class NewAzureSqlManagedInstanceLink : AzureSqlManagedInstanceLinkCmdletB /// /// Gets or sets the source endpoint /// + [CmdletParameterBreakingChangeWithVersion("SourceEndpoint", "13.0.0", "6.0.0", ReplaceMentCmdletParameterName = "PartnerEndpoint")] [Parameter(Mandatory = true, ParameterSetName = CreateByNameParameterSet, HelpMessage = "IP adress of the source endpoint.")] [Parameter(Mandatory = true, ParameterSetName = CreateByParentObjectParameterSet, HelpMessage = "IP adress of the source endpoint.")] [ValidateNotNullOrEmpty] diff --git a/src/Sql/Sql/DistributedAvailabilityGroup/Cmdlet/RemoveAzureSqlManagedInstanceLink.cs b/src/Sql/Sql/DistributedAvailabilityGroup/Cmdlet/RemoveAzureSqlManagedInstanceLink.cs index 484deb80f968..b0c5db406ad3 100644 --- a/src/Sql/Sql/DistributedAvailabilityGroup/Cmdlet/RemoveAzureSqlManagedInstanceLink.cs +++ b/src/Sql/Sql/DistributedAvailabilityGroup/Cmdlet/RemoveAzureSqlManagedInstanceLink.cs @@ -16,6 +16,7 @@ using Microsoft.Azure.Commands.Sql.ManagedInstance.Model; using Microsoft.Azure.Commands.Sql.ManagedInstanceHybridLink.Model; using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; +using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; using System; using System.Collections.Generic; using System.Globalization; @@ -27,6 +28,11 @@ namespace Microsoft.Azure.Commands.Sql.ManagedInstanceHybridLink.Cmdlet /// /// Cmdlet to remove a Managed Instance Link /// + [CmdletOutputBreakingChangeWithVersion(typeof(AzureSqlManagedInstanceLinkModel), "13.0.0", "6.0.0", + DeprecatedOutputProperties = new String[] { "TargetDatabase", "PrimaryAvailabilityGroupName", "SecondaryAvailabilityGroupName", + "SourceEndpoint", "SourceReplicaId", "TargetReplicaId", "LinkState", "LastHardenedLsn" }, + NewOutputProperties = new String[] { "Databases", "DistributedAvailabilityGroupName ", "InstanceAvailabilityGroupName", "PartnerAvailabilityGroupName", + "InstanceLinkRole", "PartnerLinkRole", "FailoverMode", "SeedingMode", "PartnerEndpoint" })] [Cmdlet(VerbsCommon.Remove, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SqlInstanceLink", DefaultParameterSetName = DeleteByNameParameterSet, SupportsShouldProcess = true), diff --git a/src/Sql/Sql/DistributedAvailabilityGroup/Cmdlet/UpdateAzureSqlManagedInstanceLink.cs b/src/Sql/Sql/DistributedAvailabilityGroup/Cmdlet/UpdateAzureSqlManagedInstanceLink.cs index a097c0ea8e98..e48b088629ef 100644 --- a/src/Sql/Sql/DistributedAvailabilityGroup/Cmdlet/UpdateAzureSqlManagedInstanceLink.cs +++ b/src/Sql/Sql/DistributedAvailabilityGroup/Cmdlet/UpdateAzureSqlManagedInstanceLink.cs @@ -16,6 +16,7 @@ using Microsoft.Azure.Commands.Sql.ManagedInstance.Model; using Microsoft.Azure.Commands.Sql.ManagedInstanceHybridLink.Model; using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; +using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; using Microsoft.WindowsAzure.Commands.Utilities.Common; using System; using System.Collections.Generic; @@ -28,6 +29,11 @@ namespace Microsoft.Azure.Commands.Sql.ManagedInstanceHybridLink.Cmdlet /// /// Cmdlet to update Managed Instance Link /// + [CmdletOutputBreakingChangeWithVersion(typeof(AzureSqlManagedInstanceLinkModel), "13.0.0", "6.0.0", + DeprecatedOutputProperties = new String[] { "TargetDatabase", "PrimaryAvailabilityGroupName", "SecondaryAvailabilityGroupName", + "SourceEndpoint", "SourceReplicaId", "TargetReplicaId", "LinkState", "LastHardenedLsn" }, + NewOutputProperties = new String[] { "Databases", "DistributedAvailabilityGroupName ", "InstanceAvailabilityGroupName", "PartnerAvailabilityGroupName", + "InstanceLinkRole", "PartnerLinkRole", "FailoverMode", "SeedingMode", "PartnerEndpoint" })] [Cmdlet("Update", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SqlInstanceLink", DefaultParameterSetName = UpdateByNameParameterSet, SupportsShouldProcess = true), OutputType(typeof(AzureSqlManagedInstanceLinkModel))]