Example #1
0
 /// <summary>
 /// Deletes a database replication link in forced or friendly way.
 /// </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='serverName'>
 /// The name of the server.
 /// </param>
 /// <param name='databaseName'>
 /// The name of the database that has the replication link to be failed over.
 /// </param>
 /// <param name='linkId'>
 /// The ID of the replication link to be failed over.
 /// </param>
 /// <param name='parameters'>
 /// The required parameters for unlinking replication link.
 /// </param>
 public static void BeginUnlink(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters)
 {
     operations.BeginUnlinkAsync(resourceGroupName, serverName, databaseName, linkId, parameters).GetAwaiter().GetResult();
 }
Example #2
0
 /// <summary>
 /// Deletes a database replication link in forced or friendly way.
 /// </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='serverName'>
 /// The name of the server.
 /// </param>
 /// <param name='databaseName'>
 /// The name of the database that has the replication link to be failed over.
 /// </param>
 /// <param name='linkId'>
 /// The ID of the replication link to be failed over.
 /// </param>
 /// <param name='parameters'>
 /// The required parameters for unlinking replication link.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginUnlinkAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.BeginUnlinkWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
        public virtual ReplicationLinksUnlinkOperation StartUnlink(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, CancellationToken cancellationToken = default)
        {
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (serverName == null)
            {
                throw new ArgumentNullException(nameof(serverName));
            }
            if (databaseName == null)
            {
                throw new ArgumentNullException(nameof(databaseName));
            }
            if (linkId == null)
            {
                throw new ArgumentNullException(nameof(linkId));
            }
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            using var scope = _clientDiagnostics.CreateScope("ReplicationLinksOperations.StartUnlink");
            scope.Start();
            try
            {
                var originalResponse = RestClient.Unlink(resourceGroupName, serverName, databaseName, linkId, parameters, cancellationToken);
                return(new ReplicationLinksUnlinkOperation(_clientDiagnostics, _pipeline, RestClient.CreateUnlinkRequest(resourceGroupName, serverName, databaseName, linkId, parameters).Request, originalResponse));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }