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// Activates the gateway you previously deployed on your host. In the activation 15// process, you specify information such as the AWS Region that you want to use for 16// storing snapshots or tapes, the time zone for scheduled snapshots the gateway 17// snapshot schedule window, an activation key, and a name for your gateway. The 18// activation process also associates your gateway with your account. For more 19// information, see UpdateGatewayInformation. You must turn on the gateway VM 20// before you can activate your gateway. 21func (c *Client) ActivateGateway(ctx context.Context, params *ActivateGatewayInput, optFns ...func(*Options)) (*ActivateGatewayOutput, error) { 22 if params == nil { 23 params = &ActivateGatewayInput{} 24 } 25 26 result, metadata, err := c.invokeOperation(ctx, "ActivateGateway", params, optFns, addOperationActivateGatewayMiddlewares) 27 if err != nil { 28 return nil, err 29 } 30 31 out := result.(*ActivateGatewayOutput) 32 out.ResultMetadata = metadata 33 return out, nil 34} 35 36// A JSON object containing one or more of the following fields: 37// 38// * 39// ActivateGatewayInput$ActivationKey 40// 41// * ActivateGatewayInput$GatewayName 42// 43// * 44// ActivateGatewayInput$GatewayRegion 45// 46// * ActivateGatewayInput$GatewayTimezone 47// 48// * 49// ActivateGatewayInput$GatewayType 50// 51// * ActivateGatewayInput$MediumChangerType 52// 53// * 54// ActivateGatewayInput$TapeDriveType 55type ActivateGatewayInput struct { 56 57 // Your gateway activation key. You can obtain the activation key by sending an 58 // HTTP GET request with redirects enabled to the gateway IP address (port 80). The 59 // redirect URL returned in the response provides you the activation key for your 60 // gateway in the query string parameter activationKey. It may also include other 61 // activation-related parameters, however, these are merely defaults -- the 62 // arguments you pass to the ActivateGateway API call determine the actual 63 // configuration of your gateway. For more information, see Getting activation key 64 // (https://docs.aws.amazon.com/storagegateway/latest/userguide/get-activation-key.html) 65 // in the AWS Storage Gateway User Guide. 66 // 67 // This member is required. 68 ActivationKey *string 69 70 // The name you configured for your gateway. 71 // 72 // This member is required. 73 GatewayName *string 74 75 // A value that indicates the AWS Region where you want to store your data. The 76 // gateway AWS Region specified must be the same AWS Region as the AWS Region in 77 // your Host header in the request. For more information about available AWS 78 // Regions and endpoints for AWS Storage Gateway, see AWS Storage Gateway endpoints 79 // and quotas (https://docs.aws.amazon.com/general/latest/gr/sg.html) in the AWS 80 // General Reference. Valid Values: See AWS Storage Gateway endpoints and quotas 81 // (https://docs.aws.amazon.com/general/latest/gr/sg.html) in the AWS General 82 // Reference. 83 // 84 // This member is required. 85 GatewayRegion *string 86 87 // A value that indicates the time zone you want to set for the gateway. The time 88 // zone is of the format "GMT-hr:mm" or "GMT+hr:mm". For example, GMT-4:00 89 // indicates the time is 4 hours behind GMT. GMT+2:00 indicates the time is 2 hours 90 // ahead of GMT. The time zone is used, for example, for scheduling snapshots and 91 // your gateway's maintenance schedule. 92 // 93 // This member is required. 94 GatewayTimezone *string 95 96 // A value that defines the type of gateway to activate. The type specified is 97 // critical to all later functions of the gateway and cannot be changed after 98 // activation. The default value is CACHED. Valid Values: STORED | CACHED | VTL | 99 // FILE_S3 100 GatewayType *string 101 102 // The value that indicates the type of medium changer to use for tape gateway. 103 // This field is optional. Valid Values: STK-L700 | AWS-Gateway-VTL | 104 // IBM-03584L32-0402 105 MediumChangerType *string 106 107 // A list of up to 50 tags that you can assign to the gateway. Each tag is a 108 // key-value pair. Valid characters for key and value are letters, spaces, and 109 // numbers that can be represented in UTF-8 format, and the following special 110 // characters: + - = . _ : / @. The maximum length of a tag's key is 128 111 // characters, and the maximum length for a tag's value is 256 characters. 112 Tags []types.Tag 113 114 // The value that indicates the type of tape drive to use for tape gateway. This 115 // field is optional. Valid Values: IBM-ULT3580-TD5 116 TapeDriveType *string 117} 118 119// AWS Storage Gateway returns the Amazon Resource Name (ARN) of the activated 120// gateway. It is a string made of information such as your account, gateway name, 121// and AWS Region. This ARN is used to reference the gateway in other API 122// operations as well as resource-based authorization. For gateways activated prior 123// to September 02, 2015, the gateway ARN contains the gateway name rather than the 124// gateway ID. Changing the name of the gateway has no effect on the gateway ARN. 125type ActivateGatewayOutput struct { 126 127 // The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to 128 // return a list of gateways for your account and AWS Region. 129 GatewayARN *string 130 131 // Metadata pertaining to the operation's result. 132 ResultMetadata middleware.Metadata 133} 134 135func addOperationActivateGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { 136 err = stack.Serialize.Add(&awsAwsjson11_serializeOpActivateGateway{}, middleware.After) 137 if err != nil { 138 return err 139 } 140 err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpActivateGateway{}, middleware.After) 141 if err != nil { 142 return err 143 } 144 if err = addSetLoggerMiddleware(stack, options); err != nil { 145 return err 146 } 147 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 148 return err 149 } 150 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 151 return err 152 } 153 if err = addResolveEndpointMiddleware(stack, options); err != nil { 154 return err 155 } 156 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 157 return err 158 } 159 if err = addRetryMiddlewares(stack, options); err != nil { 160 return err 161 } 162 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 163 return err 164 } 165 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 166 return err 167 } 168 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 169 return err 170 } 171 if err = addClientUserAgent(stack); err != nil { 172 return err 173 } 174 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 175 return err 176 } 177 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 178 return err 179 } 180 if err = addOpActivateGatewayValidationMiddleware(stack); err != nil { 181 return err 182 } 183 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opActivateGateway(options.Region), middleware.Before); err != nil { 184 return err 185 } 186 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 187 return err 188 } 189 if err = addResponseErrorMiddleware(stack); err != nil { 190 return err 191 } 192 if err = addRequestResponseLogging(stack, options); err != nil { 193 return err 194 } 195 return nil 196} 197 198func newServiceMetadataMiddleware_opActivateGateway(region string) *awsmiddleware.RegisterServiceMetadata { 199 return &awsmiddleware.RegisterServiceMetadata{ 200 Region: region, 201 ServiceID: ServiceID, 202 SigningName: "storagegateway", 203 OperationName: "ActivateGateway", 204 } 205} 206