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 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, c.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 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 Region where you want to store your data. The gateway
76	// Region specified must be the same Region as the Region in your Host header in
77	// the request. For more information about available Regions and endpoints for
78	// Storage Gateway, see  Storage Gateway endpoints and quotas
79	// (https://docs.aws.amazon.com/general/latest/gr/sg.html) in the Amazon Web
80	// Services General Reference. Valid Values: See  Storage Gateway endpoints and
81	// quotas (https://docs.aws.amazon.com/general/latest/gr/sg.html) in the Amazon Web
82	// Services General 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 | FILE_FSX_SMB|
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	noSmithyDocumentSerde
119}
120
121// Storage Gateway returns the Amazon Resource Name (ARN) of the activated gateway.
122// It is a string made of information such as your account, gateway name, and
123// Region. This ARN is used to reference the gateway in other API operations as
124// well as resource-based authorization. For gateways activated prior to September
125// 02, 2015, the gateway ARN contains the gateway name rather than the gateway ID.
126// Changing the name of the gateway has no effect on the gateway ARN.
127type ActivateGatewayOutput struct {
128
129	// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to
130	// return a list of gateways for your account and Region.
131	GatewayARN *string
132
133	// Metadata pertaining to the operation's result.
134	ResultMetadata middleware.Metadata
135
136	noSmithyDocumentSerde
137}
138
139func (c *Client) addOperationActivateGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) {
140	err = stack.Serialize.Add(&awsAwsjson11_serializeOpActivateGateway{}, middleware.After)
141	if err != nil {
142		return err
143	}
144	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpActivateGateway{}, middleware.After)
145	if err != nil {
146		return err
147	}
148	if err = addSetLoggerMiddleware(stack, options); err != nil {
149		return err
150	}
151	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
152		return err
153	}
154	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
155		return err
156	}
157	if err = addResolveEndpointMiddleware(stack, options); err != nil {
158		return err
159	}
160	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
161		return err
162	}
163	if err = addRetryMiddlewares(stack, options); err != nil {
164		return err
165	}
166	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
167		return err
168	}
169	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
170		return err
171	}
172	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
173		return err
174	}
175	if err = addClientUserAgent(stack); err != nil {
176		return err
177	}
178	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
179		return err
180	}
181	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
182		return err
183	}
184	if err = addOpActivateGatewayValidationMiddleware(stack); err != nil {
185		return err
186	}
187	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opActivateGateway(options.Region), middleware.Before); err != nil {
188		return err
189	}
190	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
191		return err
192	}
193	if err = addResponseErrorMiddleware(stack); err != nil {
194		return err
195	}
196	if err = addRequestResponseLogging(stack, options); err != nil {
197		return err
198	}
199	return nil
200}
201
202func newServiceMetadataMiddleware_opActivateGateway(region string) *awsmiddleware.RegisterServiceMetadata {
203	return &awsmiddleware.RegisterServiceMetadata{
204		Region:        region,
205		ServiceID:     ServiceID,
206		SigningName:   "storagegateway",
207		OperationName: "ActivateGateway",
208	}
209}
210