Container for the parameters to the GetHealthCheck operation.

To retrieve the health check, send a GET request to the 2012-12-12/healthcheck/health check ID resource.

Inheritance: Amazon.Runtime.AmazonWebServiceRequest
Ejemplo n.º 1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Route53.Model.GetHealthCheckRequest();

            if (cmdletContext.HealthCheckId != null)
            {
                request.HealthCheckId = cmdletContext.HealthCheckId;
            }

            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> To retrieve the health check, send a <c>GET</c> request to the <c>2013-04-01/healthcheck/health check ID </c> resource. </para>
        /// </summary>
        /// 
        /// <param name="getHealthCheckRequest">Container for the necessary parameters to execute the GetHealthCheck service method on
        /// AmazonRoute53.</param>
        /// 
        /// <returns>The response from the GetHealthCheck service method, as returned by AmazonRoute53.</returns>
        /// 
        /// <exception cref="T:Amazon.Route53.Model.NoSuchHealthCheckException" />
        /// <exception cref="T:Amazon.Route53.Model.IncompatibleVersionException" />
        /// <exception cref="T:Amazon.Route53.Model.InvalidInputException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<GetHealthCheckResponse> GetHealthCheckAsync(GetHealthCheckRequest getHealthCheckRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetHealthCheckRequestMarshaller();
            var unmarshaller = GetHealthCheckResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, GetHealthCheckRequest, GetHealthCheckResponse>(getHealthCheckRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
		internal GetHealthCheckResponse GetHealthCheck(GetHealthCheckRequest request)
        {
            var task = GetHealthCheckAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// <para> To retrieve the health check, send a <c>GET</c> request to the <c>2012-12-12/healthcheck/health check ID </c> resource. </para>
        /// </summary>
        /// 
        /// <param name="getHealthCheckRequest">Container for the necessary parameters to execute the GetHealthCheck service method on
        /// AmazonRoute53.</param>
        /// 
        /// <returns>The response from the GetHealthCheck service method, as returned by AmazonRoute53.</returns>
        /// 
        /// <exception cref="T:Amazon.Route53.Model.InvalidInputException" />
        /// <exception cref="T:Amazon.Route53.Model.NoSuchHealthCheckException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public async Task<GetHealthCheckResponse> GetHealthCheckAsync(GetHealthCheckRequest getHealthCheckRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetHealthCheckRequestMarshaller();
            var unmarshaller = GetHealthCheckResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, GetHealthCheckRequest, GetHealthCheckResponse>(getHealthCheckRequest, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
Ejemplo n.º 5
0
		internal GetHealthCheckResponse GetHealthCheck(GetHealthCheckRequest request)
        {
            var task = GetHealthCheckAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
        /// <summary>
        /// Initiates the asynchronous execution of the GetHealthCheck operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetHealthCheck 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<GetHealthCheckResponse> GetHealthCheckAsync(GetHealthCheckRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetHealthCheckRequestMarshaller();
            var unmarshaller = GetHealthCheckResponseUnmarshaller.Instance;

            return InvokeAsync<GetHealthCheckRequest,GetHealthCheckResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        /// <summary>
        /// To retrieve the health check, send a <code>GET</code> request to the <code>2013-04-01/healthcheck/<i>health
        /// check ID</i></code> resource.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the GetHealthCheck service method.</param>
        /// 
        /// <returns>The response from the GetHealthCheck service method, as returned by Route53.</returns>
        /// <exception cref="Amazon.Route53.Model.IncompatibleVersionException">
        /// The resource you are trying to access is unsupported on this Route 53 endpoint. Please
        /// consider using a newer endpoint or a tool that does so.
        /// </exception>
        /// <exception cref="Amazon.Route53.Model.InvalidInputException">
        /// Some value specified in the request is invalid or the XML document is malformed.
        /// </exception>
        /// <exception cref="Amazon.Route53.Model.NoSuchHealthCheckException">
        /// The health check you are trying to get or delete does not exist.
        /// </exception>
        public GetHealthCheckResponse GetHealthCheck(GetHealthCheckRequest request)
        {
            var marshaller = new GetHealthCheckRequestMarshaller();
            var unmarshaller = GetHealthCheckResponseUnmarshaller.Instance;

            return Invoke<GetHealthCheckRequest,GetHealthCheckResponse>(request, marshaller, unmarshaller);
        }
Ejemplo n.º 8
0
 private Amazon.Route53.Model.GetHealthCheckResponse CallAWSServiceOperation(IAmazonRoute53 client, Amazon.Route53.Model.GetHealthCheckRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Route 53", "GetHealthCheck");
     try
     {
         #if DESKTOP
         return(client.GetHealthCheck(request));
         #elif CORECLR
         return(client.GetHealthCheckAsync(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;
     }
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetHealthCheck operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetHealthCheck operation on AmazonRoute53Client.</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 EndGetHealthCheck
        ///         operation.</returns>
        public IAsyncResult BeginGetHealthCheck(GetHealthCheckRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new GetHealthCheckRequestMarshaller();
            var unmarshaller = GetHealthCheckResponseUnmarshaller.Instance;

            return BeginInvoke<GetHealthCheckRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
Ejemplo n.º 10
0
 IAsyncResult invokeGetHealthCheck(GetHealthCheckRequest getHealthCheckRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new GetHealthCheckRequestMarshaller().Marshall(getHealthCheckRequest);
     var unmarshaller = GetHealthCheckResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Initiates the asynchronous execution of the GetHealthCheck operation.
 /// <seealso cref="Amazon.Route53.IAmazonRoute53.GetHealthCheck"/>
 /// </summary>
 /// 
 /// <param name="getHealthCheckRequest">Container for the necessary parameters to execute the GetHealthCheck operation on AmazonRoute53.</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 EndGetHealthCheck
 ///         operation.</returns>
 public IAsyncResult BeginGetHealthCheck(GetHealthCheckRequest getHealthCheckRequest, AsyncCallback callback, object state)
 {
     return invokeGetHealthCheck(getHealthCheckRequest, callback, state, false);
 }
Ejemplo n.º 12
0
 /// <summary>
 /// <para> To retrieve the health check, send a <c>GET</c> request to the <c>2013-04-01/healthcheck/health check ID </c> resource. </para>
 /// </summary>
 /// 
 /// <param name="getHealthCheckRequest">Container for the necessary parameters to execute the GetHealthCheck service method on
 ///          AmazonRoute53.</param>
 /// 
 /// <returns>The response from the GetHealthCheck service method, as returned by AmazonRoute53.</returns>
 /// 
 /// <exception cref="NoSuchHealthCheckException"/>
 /// <exception cref="IncompatibleVersionException"/>
 /// <exception cref="InvalidInputException"/>
 public GetHealthCheckResponse GetHealthCheck(GetHealthCheckRequest getHealthCheckRequest)
 {
     IAsyncResult asyncResult = invokeGetHealthCheck(getHealthCheckRequest, null, null, true);
     return EndGetHealthCheck(asyncResult);
 }