1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package storagegateway 4 5import ( 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/storagegateway/types" 10 "github.com/aws/smithy-go/middleware" 11 smithyhttp "github.com/aws/smithy-go/transport/http" 12) 13 14// Describes the snapshot schedule for the specified gateway volume. The snapshot 15// schedule information includes intervals at which snapshots are automatically 16// initiated on the volume. This operation is only supported in the cached volume 17// and stored volume types. 18func (c *Client) DescribeSnapshotSchedule(ctx context.Context, params *DescribeSnapshotScheduleInput, optFns ...func(*Options)) (*DescribeSnapshotScheduleOutput, error) { 19 if params == nil { 20 params = &DescribeSnapshotScheduleInput{} 21 } 22 23 result, metadata, err := c.invokeOperation(ctx, "DescribeSnapshotSchedule", params, optFns, c.addOperationDescribeSnapshotScheduleMiddlewares) 24 if err != nil { 25 return nil, err 26 } 27 28 out := result.(*DescribeSnapshotScheduleOutput) 29 out.ResultMetadata = metadata 30 return out, nil 31} 32 33// A JSON object containing the DescribeSnapshotScheduleInput$VolumeARN of the 34// volume. 35type DescribeSnapshotScheduleInput struct { 36 37 // The Amazon Resource Name (ARN) of the volume. Use the ListVolumes operation to 38 // return a list of gateway volumes. 39 // 40 // This member is required. 41 VolumeARN *string 42 43 noSmithyDocumentSerde 44} 45 46type DescribeSnapshotScheduleOutput struct { 47 48 // The snapshot description. 49 Description *string 50 51 // The number of hours between snapshots. 52 RecurrenceInHours *int32 53 54 // The hour of the day at which the snapshot schedule begins represented as hh, 55 // where hh is the hour (0 to 23). The hour of the day is in the time zone of the 56 // gateway. 57 StartAt *int32 58 59 // A list of up to 50 tags assigned to the snapshot schedule, sorted alphabetically 60 // by key name. Each tag is a key-value pair. For a gateway with more than 10 tags 61 // assigned, you can view all tags using the ListTagsForResource API operation. 62 Tags []types.Tag 63 64 // A value that indicates the time zone of the gateway. 65 Timezone *string 66 67 // The Amazon Resource Name (ARN) of the volume that was specified in the request. 68 VolumeARN *string 69 70 // Metadata pertaining to the operation's result. 71 ResultMetadata middleware.Metadata 72 73 noSmithyDocumentSerde 74} 75 76func (c *Client) addOperationDescribeSnapshotScheduleMiddlewares(stack *middleware.Stack, options Options) (err error) { 77 err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeSnapshotSchedule{}, middleware.After) 78 if err != nil { 79 return err 80 } 81 err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeSnapshotSchedule{}, middleware.After) 82 if err != nil { 83 return err 84 } 85 if err = addSetLoggerMiddleware(stack, options); err != nil { 86 return err 87 } 88 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 89 return err 90 } 91 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 92 return err 93 } 94 if err = addResolveEndpointMiddleware(stack, options); err != nil { 95 return err 96 } 97 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 98 return err 99 } 100 if err = addRetryMiddlewares(stack, options); err != nil { 101 return err 102 } 103 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 104 return err 105 } 106 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 107 return err 108 } 109 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 110 return err 111 } 112 if err = addClientUserAgent(stack); err != nil { 113 return err 114 } 115 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 116 return err 117 } 118 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 119 return err 120 } 121 if err = addOpDescribeSnapshotScheduleValidationMiddleware(stack); err != nil { 122 return err 123 } 124 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSnapshotSchedule(options.Region), middleware.Before); err != nil { 125 return err 126 } 127 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 128 return err 129 } 130 if err = addResponseErrorMiddleware(stack); err != nil { 131 return err 132 } 133 if err = addRequestResponseLogging(stack, options); err != nil { 134 return err 135 } 136 return nil 137} 138 139func newServiceMetadataMiddleware_opDescribeSnapshotSchedule(region string) *awsmiddleware.RegisterServiceMetadata { 140 return &awsmiddleware.RegisterServiceMetadata{ 141 Region: region, 142 ServiceID: ServiceID, 143 SigningName: "storagegateway", 144 OperationName: "DescribeSnapshotSchedule", 145 } 146} 147