api_op_GetHealthCheckStatus.go (4311B)
1 // Code generated by smithy-go-codegen DO NOT EDIT. 2 3 package route53 4 5 import ( 6 "context" 7 awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" 8 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" 9 "github.com/aws/aws-sdk-go-v2/service/route53/types" 10 "github.com/aws/smithy-go/middleware" 11 smithyhttp "github.com/aws/smithy-go/transport/http" 12 ) 13 14 // Gets status of a specified health check. This API is intended for use during 15 // development to diagnose behavior. It doesn’t support production use-cases with 16 // high query rates that require immediate and actionable responses. 17 func (c *Client) GetHealthCheckStatus(ctx context.Context, params *GetHealthCheckStatusInput, optFns ...func(*Options)) (*GetHealthCheckStatusOutput, error) { 18 if params == nil { 19 params = &GetHealthCheckStatusInput{} 20 } 21 22 result, metadata, err := c.invokeOperation(ctx, "GetHealthCheckStatus", params, optFns, c.addOperationGetHealthCheckStatusMiddlewares) 23 if err != nil { 24 return nil, err 25 } 26 27 out := result.(*GetHealthCheckStatusOutput) 28 out.ResultMetadata = metadata 29 return out, nil 30 } 31 32 // A request to get the status for a health check. 33 type GetHealthCheckStatusInput struct { 34 35 // The ID for the health check that you want the current status for. When you 36 // created the health check, CreateHealthCheck returned the ID in the response, in 37 // the HealthCheckId element. If you want to check the status of a calculated 38 // health check, you must use the Amazon Route 53 console or the CloudWatch 39 // console. You can't use GetHealthCheckStatus to get the status of a calculated 40 // health check. 41 // 42 // This member is required. 43 HealthCheckId *string 44 45 noSmithyDocumentSerde 46 } 47 48 // A complex type that contains the response to a GetHealthCheck request. 49 type GetHealthCheckStatusOutput struct { 50 51 // A list that contains one HealthCheckObservation element for each Amazon Route 53 52 // health checker that is reporting a status about the health check endpoint. 53 // 54 // This member is required. 55 HealthCheckObservations []types.HealthCheckObservation 56 57 // Metadata pertaining to the operation's result. 58 ResultMetadata middleware.Metadata 59 60 noSmithyDocumentSerde 61 } 62 63 func (c *Client) addOperationGetHealthCheckStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { 64 err = stack.Serialize.Add(&awsRestxml_serializeOpGetHealthCheckStatus{}, middleware.After) 65 if err != nil { 66 return err 67 } 68 err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetHealthCheckStatus{}, middleware.After) 69 if err != nil { 70 return err 71 } 72 if err = addSetLoggerMiddleware(stack, options); err != nil { 73 return err 74 } 75 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 76 return err 77 } 78 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 79 return err 80 } 81 if err = addResolveEndpointMiddleware(stack, options); err != nil { 82 return err 83 } 84 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 85 return err 86 } 87 if err = addRetryMiddlewares(stack, options); err != nil { 88 return err 89 } 90 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 91 return err 92 } 93 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 94 return err 95 } 96 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 97 return err 98 } 99 if err = addClientUserAgent(stack); err != nil { 100 return err 101 } 102 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 103 return err 104 } 105 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 106 return err 107 } 108 if err = addOpGetHealthCheckStatusValidationMiddleware(stack); err != nil { 109 return err 110 } 111 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetHealthCheckStatus(options.Region), middleware.Before); err != nil { 112 return err 113 } 114 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 115 return err 116 } 117 if err = addResponseErrorMiddleware(stack); err != nil { 118 return err 119 } 120 if err = addRequestResponseLogging(stack, options); err != nil { 121 return err 122 } 123 return nil 124 } 125 126 func newServiceMetadataMiddleware_opGetHealthCheckStatus(region string) *awsmiddleware.RegisterServiceMetadata { 127 return &awsmiddleware.RegisterServiceMetadata{ 128 Region: region, 129 ServiceID: ServiceID, 130 SigningName: "route53", 131 OperationName: "GetHealthCheckStatus", 132 } 133 }