예제 #1
0
 /// <summary>
 /// Gets an availability group listener.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// 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='sqlVirtualMachineGroupName'>
 /// Name of the SQL virtual machine group.
 /// </param>
 /// <param name='availabilityGroupListenerName'>
 /// Name of the availability group listener.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <AvailabilityGroupListener> GetAsync(this IAvailabilityGroupListenersOperations operations, string resourceGroupName, string sqlVirtualMachineGroupName, string availabilityGroupListenerName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #2
0
        public void TestCreateListDeleteAvailabilityGroupListeners()
        {
            using (SqlVirtualMachineTestContext context = new SqlVirtualMachineTestContext(this))
            {
                string groupName      = "test-group";
                string agListenerName = "AGListener";
                IAvailabilityGroupListenersOperations sqlOperations = context.getSqlClient().AvailabilityGroupListeners;

                // Create AG listener
                AvailabilityGroupListener agListener = SqlVirtualMachineTestBase.CreateAGListener(context, agListenerName, groupName);

                // Recover
                AvailabilityGroupListener agListener2 = sqlOperations.Get(context.resourceGroup.Name, groupName, agListener.Name);
                SqlVirtualMachineTestBase.ValidateAGListener(agListener, agListener2);

                // List
                IPage <AvailabilityGroupListener> list = sqlOperations.ListByGroup(context.resourceGroup.Name, groupName);
                foreach (AvailabilityGroupListener ag in list)
                {
                    if (ag.Id.Equals(agListener.Id))
                    {
                        SqlVirtualMachineTestBase.ValidateAGListener(agListener, ag);
                    }
                }

                // Delete AG listener
                sqlOperations.Delete(context.resourceGroup.Name, groupName, agListenerName);
                list = sqlOperations.ListByGroup(context.resourceGroup.Name, groupName);
                Assert.False(list.GetEnumerator().MoveNext());
            }
        }
예제 #3
0
 /// <summary>
 /// Creates or updates an availability group listener.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// 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='sqlVirtualMachineGroupName'>
 /// Name of the SQL virtual machine group.
 /// </param>
 /// <param name='availabilityGroupListenerName'>
 /// Name of the availability group listener.
 /// </param>
 /// <param name='parameters'>
 /// The availability group listener.
 /// </param>
 public static AvailabilityGroupListener CreateOrUpdate(this IAvailabilityGroupListenersOperations operations, string resourceGroupName, string sqlVirtualMachineGroupName, string availabilityGroupListenerName, AvailabilityGroupListener parameters)
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName, parameters).GetAwaiter().GetResult());
 }
예제 #4
0
 /// <summary>
 /// Gets an availability group listener.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// 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='sqlVirtualMachineGroupName'>
 /// Name of the SQL virtual machine group.
 /// </param>
 /// <param name='availabilityGroupListenerName'>
 /// Name of the availability group listener.
 /// </param>
 public static AvailabilityGroupListener Get(this IAvailabilityGroupListenersOperations operations, string resourceGroupName, string sqlVirtualMachineGroupName, string availabilityGroupListenerName)
 {
     return(operations.GetAsync(resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName).GetAwaiter().GetResult());
 }
예제 #5
0
 /// <summary>
 /// Lists all availability group listeners in a SQL virtual machine group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <AvailabilityGroupListener> > ListByGroupNextAsync(this IAvailabilityGroupListenersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListByGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #6
0
 /// <summary>
 /// Lists all availability group listeners in a SQL virtual machine group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 public static IPage <AvailabilityGroupListener> ListByGroupNext(this IAvailabilityGroupListenersOperations operations, string nextPageLink)
 {
     return(operations.ListByGroupNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
예제 #7
0
 /// <summary>
 /// Deletes an availability group listener.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// 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='sqlVirtualMachineGroupName'>
 /// Name of the SQL virtual machine group.
 /// </param>
 /// <param name='availabilityGroupListenerName'>
 /// Name of the availability group listener.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginDeleteAsync(this IAvailabilityGroupListenersOperations operations, string resourceGroupName, string sqlVirtualMachineGroupName, string availabilityGroupListenerName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
예제 #8
0
 /// <summary>
 /// Deletes an availability group listener.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// 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='sqlVirtualMachineGroupName'>
 /// Name of the SQL virtual machine group.
 /// </param>
 /// <param name='availabilityGroupListenerName'>
 /// Name of the availability group listener.
 /// </param>
 public static void BeginDelete(this IAvailabilityGroupListenersOperations operations, string resourceGroupName, string sqlVirtualMachineGroupName, string availabilityGroupListenerName)
 {
     operations.BeginDeleteAsync(resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName).GetAwaiter().GetResult();
 }
예제 #9
0
 /// <summary>
 /// Lists all availability group listeners in a SQL virtual machine group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// 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='sqlVirtualMachineGroupName'>
 /// Name of the SQL virtual machine group.
 /// </param>
 public static IPage <AvailabilityGroupListener> ListByGroup(this IAvailabilityGroupListenersOperations operations, string resourceGroupName, string sqlVirtualMachineGroupName)
 {
     return(operations.ListByGroupAsync(resourceGroupName, sqlVirtualMachineGroupName).GetAwaiter().GetResult());
 }