Skip to content

Commit

Permalink
[SQL] Distributed Availability Groups cmdlet update to version 2023-0…
Browse files Browse the repository at this point in the history
…8-01 API (#26224)

* Adding autorest generated classes.

* Output of commands changed. Create command updated.

* Handling errors the proper way to see the error message instead of generic one.

* Adding failover functionality.

* Adding help files.

* Removing replication mode parameter, it was added by mistake

* Bug fix in failover cmdlet

* Calling GET cmdlet after failover, because REST doesn't get the link after the operation is succeeded.

* Testing done.

* Adding LiveOnly to tests.

* Altering box first test.

* Changing output to list of strings. Adding handling error for planned failover type.

* Removing breaking change announce.

* Updating help files.

* Style fix

* Handling type errors for fixed strings

* Comment fixes.

* Authoring help files.

* Updating help files, changelog.md and parameter descriptions.

* Build fix.

* Changing param Databases to Database because of PS rules, adding ChangeLog.

* Breaking change issue csv added.

---------

Co-authored-by: jovancevic123 <[email protected]>
  • Loading branch information
jovancevic123 and jovancevic123 authored Nov 1, 2024
1 parent 02eeee0 commit dbc077f
Show file tree
Hide file tree
Showing 47 changed files with 8,691 additions and 9,303 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,100 @@ public static DistributedAvailabilityGroup Update(this IDistributedAvailabilityG
}
}
/// <summary>
/// Performs requested failover type in this distributed availability group.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the resource. You can obtain
/// this value from the Azure Resource Manager API or the portal.
/// </param>
/// <param name='managedInstanceName'>
/// The name of the managed instance.
/// </param>
/// <param name='distributedAvailabilityGroupName'>
/// The distributed availability group name.
/// </param>
public static DistributedAvailabilityGroup Failover(this IDistributedAvailabilityGroupsOperations operations, string resourceGroupName, string managedInstanceName, string distributedAvailabilityGroupName, DistributedAvailabilityGroupsFailoverRequest parameters)
{
return ((IDistributedAvailabilityGroupsOperations)operations).FailoverAsync(resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters).GetAwaiter().GetResult();
}

/// <summary>
/// Performs requested failover type in this distributed availability group.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the resource. You can obtain
/// this value from the Azure Resource Manager API or the portal.
/// </param>
/// <param name='managedInstanceName'>
/// The name of the managed instance.
/// </param>
/// <param name='distributedAvailabilityGroupName'>
/// The distributed availability group name.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async System.Threading.Tasks.Task<DistributedAvailabilityGroup> FailoverAsync(this IDistributedAvailabilityGroupsOperations operations, string resourceGroupName, string managedInstanceName, string distributedAvailabilityGroupName, DistributedAvailabilityGroupsFailoverRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
using (var _result = await operations.FailoverWithHttpMessagesAsync(resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Sets the role for managed instance in a distributed availability group.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the resource. You can obtain
/// this value from the Azure Resource Manager API or the portal.
/// </param>
/// <param name='managedInstanceName'>
/// The name of the managed instance.
/// </param>
/// <param name='distributedAvailabilityGroupName'>
/// The distributed availability group name.
/// </param>
public static DistributedAvailabilityGroup SetRole(this IDistributedAvailabilityGroupsOperations operations, string resourceGroupName, string managedInstanceName, string distributedAvailabilityGroupName, DistributedAvailabilityGroupSetRole parameters)
{
return ((IDistributedAvailabilityGroupsOperations)operations).SetRoleAsync(resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters).GetAwaiter().GetResult();
}

/// <summary>
/// Sets the role for managed instance in a distributed availability group.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the resource. You can obtain
/// this value from the Azure Resource Manager API or the portal.
/// </param>
/// <param name='managedInstanceName'>
/// The name of the managed instance.
/// </param>
/// <param name='distributedAvailabilityGroupName'>
/// The distributed availability group name.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async System.Threading.Tasks.Task<DistributedAvailabilityGroup> SetRoleAsync(this IDistributedAvailabilityGroupsOperations operations, string resourceGroupName, string managedInstanceName, string distributedAvailabilityGroupName, DistributedAvailabilityGroupSetRole parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
using (var _result = await operations.SetRoleWithHttpMessagesAsync(resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Creates a distributed availability group between Sql On-Prem and Sql
/// Managed Instance.
/// </summary>
Expand Down Expand Up @@ -385,6 +479,100 @@ public static DistributedAvailabilityGroup BeginUpdate(this IDistributedAvailabi
}
}
/// <summary>
/// Performs requested failover type in this distributed availability group.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the resource. You can obtain
/// this value from the Azure Resource Manager API or the portal.
/// </param>
/// <param name='managedInstanceName'>
/// The name of the managed instance.
/// </param>
/// <param name='distributedAvailabilityGroupName'>
/// The distributed availability group name.
/// </param>
public static DistributedAvailabilityGroup BeginFailover(this IDistributedAvailabilityGroupsOperations operations, string resourceGroupName, string managedInstanceName, string distributedAvailabilityGroupName, DistributedAvailabilityGroupsFailoverRequest parameters)
{
return ((IDistributedAvailabilityGroupsOperations)operations).BeginFailoverAsync(resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters).GetAwaiter().GetResult();
}

/// <summary>
/// Performs requested failover type in this distributed availability group.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the resource. You can obtain
/// this value from the Azure Resource Manager API or the portal.
/// </param>
/// <param name='managedInstanceName'>
/// The name of the managed instance.
/// </param>
/// <param name='distributedAvailabilityGroupName'>
/// The distributed availability group name.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async System.Threading.Tasks.Task<DistributedAvailabilityGroup> BeginFailoverAsync(this IDistributedAvailabilityGroupsOperations operations, string resourceGroupName, string managedInstanceName, string distributedAvailabilityGroupName, DistributedAvailabilityGroupsFailoverRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
using (var _result = await operations.BeginFailoverWithHttpMessagesAsync(resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Sets the role for managed instance in a distributed availability group.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the resource. You can obtain
/// this value from the Azure Resource Manager API or the portal.
/// </param>
/// <param name='managedInstanceName'>
/// The name of the managed instance.
/// </param>
/// <param name='distributedAvailabilityGroupName'>
/// The distributed availability group name.
/// </param>
public static DistributedAvailabilityGroup BeginSetRole(this IDistributedAvailabilityGroupsOperations operations, string resourceGroupName, string managedInstanceName, string distributedAvailabilityGroupName, DistributedAvailabilityGroupSetRole parameters)
{
return ((IDistributedAvailabilityGroupsOperations)operations).BeginSetRoleAsync(resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters).GetAwaiter().GetResult();
}

/// <summary>
/// Sets the role for managed instance in a distributed availability group.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the resource. You can obtain
/// this value from the Azure Resource Manager API or the portal.
/// </param>
/// <param name='managedInstanceName'>
/// The name of the managed instance.
/// </param>
/// <param name='distributedAvailabilityGroupName'>
/// The distributed availability group name.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async System.Threading.Tasks.Task<DistributedAvailabilityGroup> BeginSetRoleAsync(this IDistributedAvailabilityGroupsOperations operations, string resourceGroupName, string managedInstanceName, string distributedAvailabilityGroupName, DistributedAvailabilityGroupSetRole parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
using (var _result = await operations.BeginSetRoleWithHttpMessagesAsync(resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Gets a list of a distributed availability groups in instance.
/// </summary>
/// <param name='operations'>
Expand Down
Loading

0 comments on commit dbc077f

Please sign in to comment.