/// <summary>
 /// Gets the backend health for given combination of backend pool and http
 /// setting of the specified application gateway in a resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='applicationGatewayName'>
 /// The name of the application gateway.
 /// </param>
 /// <param name='probeRequest'>
 /// Request body for on-demand test probe operation.
 /// </param>
 /// <param name='expand'>
 /// Expands BackendAddressPool and BackendHttpSettings referenced in backend
 /// health.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ApplicationGatewayBackendHealthOnDemandInner> BeginBackendHealthOnDemandAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginBackendHealthOnDemandWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, probeRequest, expand, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
        public virtual ApplicationGatewaysBackendHealthOnDemandOperation StartBackendHealthOnDemand(string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = null, CancellationToken cancellationToken = default)
        {
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (applicationGatewayName == null)
            {
                throw new ArgumentNullException(nameof(applicationGatewayName));
            }
            if (probeRequest == null)
            {
                throw new ArgumentNullException(nameof(probeRequest));
            }

            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysClient.StartBackendHealthOnDemand");
            scope.Start();
            try
            {
                var originalResponse = RestClient.BackendHealthOnDemand(resourceGroupName, applicationGatewayName, probeRequest, expand, cancellationToken);
                return(new ApplicationGatewaysBackendHealthOnDemandOperation(_clientDiagnostics, _pipeline, RestClient.CreateBackendHealthOnDemandRequest(resourceGroupName, applicationGatewayName, probeRequest, expand).Request, originalResponse));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #3
0
        public virtual ApplicationGatewayBackendHealthOnDemandOperation BackendHealthOnDemand(ApplicationGatewayOnDemandProbe probeRequest, string expand = null, bool waitForCompletion = true, CancellationToken cancellationToken = default)
        {
            if (probeRequest == null)
            {
                throw new ArgumentNullException(nameof(probeRequest));
            }

            using var scope = _clientDiagnostics.CreateScope("ApplicationGateway.BackendHealthOnDemand");
            scope.Start();
            try
            {
                var response  = _restClient.BackendHealthOnDemand(Id.ResourceGroupName, Id.Name, probeRequest, expand, cancellationToken);
                var operation = new ApplicationGatewayBackendHealthOnDemandOperation(_clientDiagnostics, Pipeline, _restClient.CreateBackendHealthOnDemandRequest(Id.ResourceGroupName, Id.Name, probeRequest, expand).Request, response);
                if (waitForCompletion)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #4
0
        public virtual ArmOperation <ApplicationGatewayBackendHealthOnDemand> BackendHealthOnDemand(WaitUntil waitUntil, ApplicationGatewayOnDemandProbe probeRequest, string expand = null, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(probeRequest, nameof(probeRequest));

            using var scope = _applicationGatewayClientDiagnostics.CreateScope("ApplicationGateway.BackendHealthOnDemand");
            scope.Start();
            try
            {
                var response  = _applicationGatewayRestClient.BackendHealthOnDemand(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, probeRequest, expand, cancellationToken);
                var operation = new NetworkArmOperation <ApplicationGatewayBackendHealthOnDemand>(new ApplicationGatewayBackendHealthOnDemandOperationSource(), _applicationGatewayClientDiagnostics, Pipeline, _applicationGatewayRestClient.CreateBackendHealthOnDemandRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, probeRequest, expand).Request, response, OperationFinalStateVia.Location);
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #5
0
 /// <summary>
 /// Gets the backend health for given combination of backend pool and http
 /// setting of the specified application gateway in a resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='applicationGatewayName'>
 /// The name of the application gateway.
 /// </param>
 /// <param name='probeRequest'>
 /// Request body for on-demand test probe operation.
 /// </param>
 /// <param name='expand'>
 /// Expands BackendAddressPool and BackendHttpSettings referenced in backend
 /// health.
 /// </param>
 public static ApplicationGatewayBackendHealthOnDemand BeginBackendHealthOnDemand(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = default(string))
 {
     return(operations.BeginBackendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand).GetAwaiter().GetResult());
 }
        public async virtual Task <ApplicationGatewayBackendHealthOnDemandOperation> BackendHealthOnDemandAsync(bool waitForCompletion, ApplicationGatewayOnDemandProbe probeRequest, string expand = null, CancellationToken cancellationToken = default)
        {
            if (probeRequest == null)
            {
                throw new ArgumentNullException(nameof(probeRequest));
            }

            using var scope = _applicationGatewayClientDiagnostics.CreateScope("ApplicationGateway.BackendHealthOnDemand");
            scope.Start();
            try
            {
                var response = await _applicationGatewayRestClient.BackendHealthOnDemandAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, probeRequest, expand, cancellationToken).ConfigureAwait(false);

                var operation = new ApplicationGatewayBackendHealthOnDemandOperation(_applicationGatewayClientDiagnostics, Pipeline, _applicationGatewayRestClient.CreateBackendHealthOnDemandRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, probeRequest, expand).Request, response);
                if (waitForCompletion)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }