-
Notifications
You must be signed in to change notification settings - Fork 594
/
api_op_UpdateServer.go
235 lines (204 loc) · 8.17 KB
/
api_op_UpdateServer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package transfer
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type UpdateServerInput struct {
_ struct{} `type:"structure"`
// The Amazon Resource Name (ARN) of the AWS Certificate Manager (ACM) certificate.
// Required when Protocols is set to FTPS.
//
// To request a new public certificate, see Request a public certificate (https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html)
// in the AWS Certificate Manager User Guide.
//
// To import an existing certificate into ACM, see Importing certificates into
// ACM (https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html)
// in the AWS Certificate Manager User Guide.
//
// To request a private certificate to use FTPS through private IP addresses,
// see Request a private certificate (https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-private.html)
// in the AWS Certificate Manager User Guide.
//
// Certificates with the following cryptographic algorithms and key sizes are
// supported:
//
// * 2048-bit RSA (RSA_2048)
//
// * 4096-bit RSA (RSA_4096)
//
// * Elliptic Prime Curve 256 bit (EC_prime256v1)
//
// * Elliptic Prime Curve 384 bit (EC_secp384r1)
//
// * Elliptic Prime Curve 521 bit (EC_secp521r1)
//
// The certificate must be a valid SSL/TLS X.509 version 3 certificate with
// FQDN or IP address specified and information about the issuer.
Certificate *string `type:"string"`
// The virtual private cloud (VPC) endpoint settings that are configured for
// your file transfer protocol-enabled server. With a VPC endpoint, you can
// restrict access to your server to resources only within your VPC. To control
// incoming internet traffic, you will need to associate one or more Elastic
// IP addresses with your server's endpoint.
EndpointDetails *EndpointDetails `type:"structure"`
// The type of endpoint that you want your file transfer protocol-enabled server
// to connect to. You can choose to connect to the public internet or a VPC
// endpoint. With a VPC endpoint, you can restrict access to your server and
// resources only within your VPC.
//
// It is recommended that you use VPC as the EndpointType. With this endpoint
// type, you have the option to directly associate up to three Elastic IPv4
// addresses (BYO IP included) with your server's endpoint and use VPC security
// groups to restrict traffic by the client's public IP address. This is not
// possible with EndpointType set to VPC_ENDPOINT.
EndpointType EndpointType `type:"string" enum:"true"`
// The RSA private key as generated by ssh-keygen -N "" -m PEM -f my-new-server-key.
//
// If you aren't planning to migrate existing users from an existing file transfer
// protocol-enabled server to a new server, don't update the host key. Accidentally
// changing a server's host key can be disruptive.
//
// For more information, see Change the host key for your SFTP-enabled server
// (https://docs.aws.amazon.com/transfer/latest/userguide/edit-server-config.html#configuring-servers-change-host-key)
// in the AWS Transfer Family User Guide.
HostKey *string `type:"string" sensitive:"true"`
// An array containing all of the information required to call a customer's
// authentication API method.
IdentityProviderDetails *IdentityProviderDetails `type:"structure"`
// Changes the AWS Identity and Access Management (IAM) role that allows Amazon
// S3 events to be logged in Amazon CloudWatch, turning logging on or off.
LoggingRole *string `type:"string"`
// Specifies the file transfer protocol or protocols over which your file transfer
// protocol client can connect to your server's endpoint. The available protocols
// are:
//
// * Secure Shell (SSH) File Transfer Protocol (SFTP): File transfer over
// SSH
//
// * File Transfer Protocol Secure (FTPS): File transfer with TLS encryption
//
// * File Transfer Protocol (FTP): Unencrypted file transfer
//
// If you select FTPS, you must choose a certificate stored in AWS Certificate
// Manager (ACM) which will be used to identify your server when clients connect
// to it over FTPS.
//
// If Protocol includes either FTP or FTPS, then the EndpointType must be VPC
// and the IdentityProviderType must be API_GATEWAY.
//
// If Protocol includes FTP, then AddressAllocationIds cannot be associated.
//
// If Protocol is set only to SFTP, the EndpointType can be set to PUBLIC and
// the IdentityProviderType can be set to SERVICE_MANAGED.
Protocols []Protocol `min:"1" type:"list"`
// A system-assigned unique identifier for a file transfer protocol-enabled
// server instance that the user account is assigned to.
//
// ServerId is a required field
ServerId *string `min:"19" type:"string" required:"true"`
}
// String returns the string representation
func (s UpdateServerInput) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateServerInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "UpdateServerInput"}
if s.Protocols != nil && len(s.Protocols) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("Protocols", 1))
}
if s.ServerId == nil {
invalidParams.Add(aws.NewErrParamRequired("ServerId"))
}
if s.ServerId != nil && len(*s.ServerId) < 19 {
invalidParams.Add(aws.NewErrParamMinLen("ServerId", 19))
}
if s.EndpointDetails != nil {
if err := s.EndpointDetails.Validate(); err != nil {
invalidParams.AddNested("EndpointDetails", err.(aws.ErrInvalidParams))
}
}
if s.IdentityProviderDetails != nil {
if err := s.IdentityProviderDetails.Validate(); err != nil {
invalidParams.AddNested("IdentityProviderDetails", err.(aws.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type UpdateServerOutput struct {
_ struct{} `type:"structure"`
// A system-assigned unique identifier for a file transfer protocol-enabled
// server that the user account is assigned to.
//
// ServerId is a required field
ServerId *string `min:"19" type:"string" required:"true"`
}
// String returns the string representation
func (s UpdateServerOutput) String() string {
return awsutil.Prettify(s)
}
const opUpdateServer = "UpdateServer"
// UpdateServerRequest returns a request value for making API operation for
// AWS Transfer Family.
//
// Updates the file transfer protocol-enabled server's properties after that
// server has been created.
//
// The UpdateServer call returns the ServerId of the server you updated.
//
// // Example sending a request using UpdateServerRequest.
// req := client.UpdateServerRequest(params)
// resp, err := req.Send(context.TODO())
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/UpdateServer
func (c *Client) UpdateServerRequest(input *UpdateServerInput) UpdateServerRequest {
op := &aws.Operation{
Name: opUpdateServer,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &UpdateServerInput{}
}
req := c.newRequest(op, input, &UpdateServerOutput{})
return UpdateServerRequest{Request: req, Input: input, Copy: c.UpdateServerRequest}
}
// UpdateServerRequest is the request type for the
// UpdateServer API operation.
type UpdateServerRequest struct {
*aws.Request
Input *UpdateServerInput
Copy func(*UpdateServerInput) UpdateServerRequest
}
// Send marshals and sends the UpdateServer API request.
func (r UpdateServerRequest) Send(ctx context.Context) (*UpdateServerResponse, error) {
r.Request.SetContext(ctx)
err := r.Request.Send()
if err != nil {
return nil, err
}
resp := &UpdateServerResponse{
UpdateServerOutput: r.Request.Data.(*UpdateServerOutput),
response: &aws.Response{Request: r.Request},
}
return resp, nil
}
// UpdateServerResponse is the response type for the
// UpdateServer API operation.
type UpdateServerResponse struct {
*UpdateServerOutput
response *aws.Response
}
// SDKResponseMetdata returns the response metadata for the
// UpdateServer request.
func (r *UpdateServerResponse) SDKResponseMetdata() *aws.Response {
return r.response
}