api_op_GetHealthCheckLastFailureReason.go (3249B)
1 // Code generated by smithy-go-codegen DO NOT EDIT. 2 3 package route53 4 5 import ( 6 "context" 7 8 "github.com/aws/aws-sdk-go-v2/service/route53/types" 9 "github.com/aws/smithy-go/middleware" 10 ) 11 12 // Gets the reason that a specified health check failed most recently. 13 func (c *Client) GetHealthCheckLastFailureReason(ctx context.Context, params *GetHealthCheckLastFailureReasonInput, optFns ...func(*Options)) (*GetHealthCheckLastFailureReasonOutput, error) { 14 if params == nil { 15 params = &GetHealthCheckLastFailureReasonInput{} 16 } 17 18 result, metadata, err := c.invokeOperation(ctx, "GetHealthCheckLastFailureReason", params, optFns, c.addOperationGetHealthCheckLastFailureReasonMiddlewares) 19 if err != nil { 20 return nil, err 21 } 22 23 out := result.(*GetHealthCheckLastFailureReasonOutput) 24 out.ResultMetadata = metadata 25 return out, nil 26 } 27 28 // A request for the reason that a health check failed most recently. 29 type GetHealthCheckLastFailureReasonInput struct { 30 31 // The ID for the health check for which you want the last failure reason. When 32 // you created the health check, CreateHealthCheck returned the ID in the 33 // response, in the HealthCheckId element. 34 // 35 // If you want to get the last failure reason for a calculated health check, you 36 // must use the Amazon Route 53 console or the CloudWatch console. You can't use 37 // GetHealthCheckLastFailureReason for a calculated health check. 38 // 39 // This member is required. 40 HealthCheckId *string 41 42 noSmithyDocumentSerde 43 } 44 45 // A complex type that contains the response to a GetHealthCheckLastFailureReason 46 // request. 47 type GetHealthCheckLastFailureReasonOutput struct { 48 49 // A list that contains one Observation element for each Amazon Route 53 health 50 // checker that is reporting a last failure reason. 51 // 52 // This member is required. 53 HealthCheckObservations []types.HealthCheckObservation 54 55 // Metadata pertaining to the operation's result. 56 ResultMetadata middleware.Metadata 57 58 noSmithyDocumentSerde 59 } 60 61 func (c *Client) addOperationGetHealthCheckLastFailureReasonMiddlewares(stack *middleware.Stack, options Options) (err error) { 62 err = stack.Serialize.Add(&awsRestxml_serializeOpGetHealthCheckLastFailureReason{}, middleware.After) 63 if err != nil { 64 return err 65 } 66 err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetHealthCheckLastFailureReason{}, middleware.After) 67 if err != nil { 68 return err 69 } 70 71 if err = addComputeContentLength(stack); err != nil { 72 return err 73 } 74 if err = addResolveEndpointMiddleware(stack, options); err != nil { 75 return err 76 } 77 if err = addComputePayloadSHA256(stack); err != nil { 78 return err 79 } 80 if err = addRecordResponseTiming(stack, options); err != nil { 81 return err 82 } 83 if err = addCredentialSource(stack, options); err != nil { 84 return err 85 } 86 if err = addOpGetHealthCheckLastFailureReasonValidationMiddleware(stack); err != nil { 87 return err 88 } 89 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 90 return err 91 } 92 if err = addResponseErrorMiddleware(stack); err != nil { 93 return err 94 } 95 if err = addRequestResponseLogging(stack, options); err != nil { 96 return err 97 } 98 if err = addDisableHTTPSMiddleware(stack, options); err != nil { 99 return err 100 } 101 if err = addInterceptors(stack, options); err != nil { 102 return err 103 } 104 return nil 105 }