Container for the parameters to the ConfigureHealthCheck operation.

Specifies the health check settings to use for evaluating the health state of your back-end instances.

For more information, see Health Check in the Elastic Load Balancing Developer Guide .

Inheritance: AmazonElasticLoadBalancingRequest
 protected override void ProcessRecord()
 {
     AmazonElasticLoadBalancing client = base.GetClient();
     Amazon.ElasticLoadBalancing.Model.ConfigureHealthCheckRequest request = new Amazon.ElasticLoadBalancing.Model.ConfigureHealthCheckRequest();
     request.LoadBalancerName = this._LoadBalancerName;
     Amazon.ElasticLoadBalancing.Model.ConfigureHealthCheckResponse response = client.ConfigureHealthCheck(request);
     base.WriteObject(response.ConfigureHealthCheckResult, true);
 }
        /// <summary>
        /// Initiates the asynchronous execution of the ConfigureHealthCheck operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ConfigureHealthCheck operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task<ConfigureHealthCheckResponse> ConfigureHealthCheckAsync(ConfigureHealthCheckRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new ConfigureHealthCheckRequestMarshaller();
            var unmarshaller = ConfigureHealthCheckResponseUnmarshaller.Instance;

            return InvokeAsync<ConfigureHealthCheckRequest,ConfigureHealthCheckResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        internal ConfigureHealthCheckResponse ConfigureHealthCheck(ConfigureHealthCheckRequest request)
        {
            var marshaller = new ConfigureHealthCheckRequestMarshaller();
            var unmarshaller = ConfigureHealthCheckResponseUnmarshaller.Instance;

            return Invoke<ConfigureHealthCheckRequest,ConfigureHealthCheckResponse>(request, marshaller, unmarshaller);
        }
 /// <summary>
 /// <para> Enables the client to define an application healthcheck for the instances. </para>
 /// </summary>
 /// 
 /// <param name="configureHealthCheckRequest">Container for the necessary parameters to execute the ConfigureHealthCheck service method on
 ///          AmazonElasticLoadBalancing.</param>
 /// 
 /// <returns>The response from the ConfigureHealthCheck service method, as returned by AmazonElasticLoadBalancing.</returns>
 /// 
 /// <exception cref="LoadBalancerNotFoundException"/>
 public ConfigureHealthCheckResponse ConfigureHealthCheck(ConfigureHealthCheckRequest configureHealthCheckRequest)
 {
     IAsyncResult asyncResult = invokeConfigureHealthCheck(configureHealthCheckRequest, null, null, true);
     return EndConfigureHealthCheck(asyncResult);
 }
 /// <summary>
 /// Initiates the asynchronous execution of the ConfigureHealthCheck operation.
 /// <seealso cref="Amazon.ElasticLoadBalancing.AmazonElasticLoadBalancing.ConfigureHealthCheck"/>
 /// </summary>
 /// 
 /// <param name="configureHealthCheckRequest">Container for the necessary parameters to execute the ConfigureHealthCheck operation on
 ///          AmazonElasticLoadBalancing.</param>
 /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
 /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
 ///          procedure using the AsyncState property.</param>
 /// 
 /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking
 ///         EndConfigureHealthCheck operation.</returns>
 public IAsyncResult BeginConfigureHealthCheck(ConfigureHealthCheckRequest configureHealthCheckRequest, AsyncCallback callback, object state)
 {
     return invokeConfigureHealthCheck(configureHealthCheckRequest, callback, state, false);
 }
 IAsyncResult invokeConfigureHealthCheck(ConfigureHealthCheckRequest configureHealthCheckRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new ConfigureHealthCheckRequestMarshaller().Marshall(configureHealthCheckRequest);
     var unmarshaller = ConfigureHealthCheckResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
Exemplo n.º 7
0
 private Amazon.ElasticLoadBalancing.Model.ConfigureHealthCheckResponse CallAWSServiceOperation(IAmazonElasticLoadBalancing client, Amazon.ElasticLoadBalancing.Model.ConfigureHealthCheckRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Elastic Load Balancing", "ConfigureHealthCheck");
     try
     {
         #if DESKTOP
         return(client.ConfigureHealthCheck(request));
         #elif CORECLR
         return(client.ConfigureHealthCheckAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
Exemplo n.º 8
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.ElasticLoadBalancing.Model.ConfigureHealthCheckRequest();


            // populate HealthCheck
            var requestHealthCheckIsNull = true;

            request.HealthCheck = new Amazon.ElasticLoadBalancing.Model.HealthCheck();
            System.Int32?requestHealthCheck_healthCheck_HealthyThreshold = null;
            if (cmdletContext.HealthCheck_HealthyThreshold != null)
            {
                requestHealthCheck_healthCheck_HealthyThreshold = cmdletContext.HealthCheck_HealthyThreshold.Value;
            }
            if (requestHealthCheck_healthCheck_HealthyThreshold != null)
            {
                request.HealthCheck.HealthyThreshold = requestHealthCheck_healthCheck_HealthyThreshold.Value;
                requestHealthCheckIsNull             = false;
            }
            System.Int32?requestHealthCheck_healthCheck_Interval = null;
            if (cmdletContext.HealthCheck_Interval != null)
            {
                requestHealthCheck_healthCheck_Interval = cmdletContext.HealthCheck_Interval.Value;
            }
            if (requestHealthCheck_healthCheck_Interval != null)
            {
                request.HealthCheck.Interval = requestHealthCheck_healthCheck_Interval.Value;
                requestHealthCheckIsNull     = false;
            }
            System.String requestHealthCheck_healthCheck_Target = null;
            if (cmdletContext.HealthCheck_Target != null)
            {
                requestHealthCheck_healthCheck_Target = cmdletContext.HealthCheck_Target;
            }
            if (requestHealthCheck_healthCheck_Target != null)
            {
                request.HealthCheck.Target = requestHealthCheck_healthCheck_Target;
                requestHealthCheckIsNull   = false;
            }
            System.Int32?requestHealthCheck_healthCheck_Timeout = null;
            if (cmdletContext.HealthCheck_Timeout != null)
            {
                requestHealthCheck_healthCheck_Timeout = cmdletContext.HealthCheck_Timeout.Value;
            }
            if (requestHealthCheck_healthCheck_Timeout != null)
            {
                request.HealthCheck.Timeout = requestHealthCheck_healthCheck_Timeout.Value;
                requestHealthCheckIsNull    = false;
            }
            System.Int32?requestHealthCheck_healthCheck_UnhealthyThreshold = null;
            if (cmdletContext.HealthCheck_UnhealthyThreshold != null)
            {
                requestHealthCheck_healthCheck_UnhealthyThreshold = cmdletContext.HealthCheck_UnhealthyThreshold.Value;
            }
            if (requestHealthCheck_healthCheck_UnhealthyThreshold != null)
            {
                request.HealthCheck.UnhealthyThreshold = requestHealthCheck_healthCheck_UnhealthyThreshold.Value;
                requestHealthCheckIsNull = false;
            }
            // determine if request.HealthCheck should be set to null
            if (requestHealthCheckIsNull)
            {
                request.HealthCheck = null;
            }
            if (cmdletContext.LoadBalancerName != null)
            {
                request.LoadBalancerName = cmdletContext.LoadBalancerName;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }
        /// <summary>
        /// <para> Specifies the health check settings to use for evaluating the health state of your back-end instances. </para> <para>For more
        /// information, see <a href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/TerminologyandKeyConcepts.html#healthcheck">Health Check</a> in the <i>Elastic Load Balancing Developer Guide</i> .</para>
        /// </summary>
        /// 
        /// <param name="configureHealthCheckRequest">Container for the necessary parameters to execute the ConfigureHealthCheck service method on
        /// AmazonElasticLoadBalancing.</param>
        /// 
        /// <returns>The response from the ConfigureHealthCheck service method, as returned by AmazonElasticLoadBalancing.</returns>
        /// 
        /// <exception cref="T:Amazon.ElasticLoadBalancing.Model.LoadBalancerNotFoundException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public async Task<ConfigureHealthCheckResponse> ConfigureHealthCheckAsync(ConfigureHealthCheckRequest configureHealthCheckRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new ConfigureHealthCheckRequestMarshaller();
            var unmarshaller = ConfigureHealthCheckResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, ConfigureHealthCheckRequest, ConfigureHealthCheckResponse>(configureHealthCheckRequest, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
		internal ConfigureHealthCheckResponse ConfigureHealthCheck(ConfigureHealthCheckRequest request)
        {
            var task = ConfigureHealthCheckAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
 /// <summary>
 /// <para> Enables the client to define an application healthcheck for the
 /// instances. </para>
 /// </summary>
 /// 
 /// <param name="configureHealthCheckRequest">Container for the necessary
 ///           parameters to execute the ConfigureHealthCheck service method on
 ///           AmazonElasticLoadBalancing.</param>
 /// 
 /// <returns>The response from the ConfigureHealthCheck service method, as
 ///         returned by AmazonElasticLoadBalancing.</returns>
 /// 
 /// <exception cref="LoadBalancerNotFoundException"/>
 public ConfigureHealthCheckResponse ConfigureHealthCheck(ConfigureHealthCheckRequest configureHealthCheckRequest)
 {
     IRequest<ConfigureHealthCheckRequest> request = new ConfigureHealthCheckRequestMarshaller().Marshall(configureHealthCheckRequest);
     ConfigureHealthCheckResponse response = Invoke<ConfigureHealthCheckRequest, ConfigureHealthCheckResponse> (request, this.signer, ConfigureHealthCheckResponseUnmarshaller.GetInstance());
     return response;
 }
        /// <summary>
        /// Initiates the asynchronous execution of the ConfigureHealthCheck operation.
        /// <seealso cref="Amazon.ElasticLoadBalancing.IAmazonElasticLoadBalancing.ConfigureHealthCheck"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ConfigureHealthCheck operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
		public Task<ConfigureHealthCheckResponse> ConfigureHealthCheckAsync(ConfigureHealthCheckRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new ConfigureHealthCheckRequestMarshaller();
            var unmarshaller = ConfigureHealthCheckResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, ConfigureHealthCheckRequest, ConfigureHealthCheckResponse>(request, marshaller, unmarshaller, signer, cancellationToken);
        }
        /// <summary>
        /// <para> Specifies the health check settings to use for evaluating the health state of your back-end instances. </para> <para>For more
        /// information, see <a href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/TerminologyandKeyConcepts.html#healthcheck">Health Check</a> in the <i>Elastic Load Balancing Developer Guide</i> .</para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ConfigureHealthCheck service method on
        /// AmazonElasticLoadBalancing.</param>
        /// 
        /// <returns>The response from the ConfigureHealthCheck service method, as returned by AmazonElasticLoadBalancing.</returns>
        /// 
        /// <exception cref="T:Amazon.ElasticLoadBalancing.Model.LoadBalancerNotFoundException" />
		public ConfigureHealthCheckResponse ConfigureHealthCheck(ConfigureHealthCheckRequest request)
        {
            var task = ConfigureHealthCheckAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
        IAsyncResult invokeConfigureHealthCheck(ConfigureHealthCheckRequest request, AsyncCallback callback, object state, bool synchronized)
        {
            var marshaller = new ConfigureHealthCheckRequestMarshaller();
            var unmarshaller = ConfigureHealthCheckResponseUnmarshaller.Instance;

            return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the ConfigureHealthCheck operation.
        /// <seealso cref="Amazon.ElasticLoadBalancing.IAmazonElasticLoadBalancing"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ConfigureHealthCheck operation on AmazonElasticLoadBalancingClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        /// 
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndConfigureHealthCheck
        ///         operation.</returns>
        public IAsyncResult BeginConfigureHealthCheck(ConfigureHealthCheckRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new ConfigureHealthCheckRequestMarshaller();
            var unmarshaller = ConfigureHealthCheckResponseUnmarshaller.Instance;

            return BeginInvoke<ConfigureHealthCheckRequest>(request, marshaller, unmarshaller,
                callback, state);
        }