github.com/aavshr/aws-sdk-go@v1.41.3/service/ec2instanceconnect/api.go (about) 1 // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3 package ec2instanceconnect 4 5 import ( 6 "fmt" 7 8 "github.com/aavshr/aws-sdk-go/aws" 9 "github.com/aavshr/aws-sdk-go/aws/awsutil" 10 "github.com/aavshr/aws-sdk-go/aws/request" 11 "github.com/aavshr/aws-sdk-go/private/protocol" 12 ) 13 14 const opSendSSHPublicKey = "SendSSHPublicKey" 15 16 // SendSSHPublicKeyRequest generates a "aws/request.Request" representing the 17 // client's request for the SendSSHPublicKey operation. The "output" return 18 // value will be populated with the request's response once the request completes 19 // successfully. 20 // 21 // Use "Send" method on the returned Request to send the API call to the service. 22 // the "output" return value is not valid until after Send returns without error. 23 // 24 // See SendSSHPublicKey for more information on using the SendSSHPublicKey 25 // API call, and error handling. 26 // 27 // This method is useful when you want to inject custom logic or configuration 28 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 29 // 30 // 31 // // Example sending a request using the SendSSHPublicKeyRequest method. 32 // req, resp := client.SendSSHPublicKeyRequest(params) 33 // 34 // err := req.Send() 35 // if err == nil { // resp is now filled 36 // fmt.Println(resp) 37 // } 38 // 39 // See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-instance-connect-2018-04-02/SendSSHPublicKey 40 func (c *EC2InstanceConnect) SendSSHPublicKeyRequest(input *SendSSHPublicKeyInput) (req *request.Request, output *SendSSHPublicKeyOutput) { 41 op := &request.Operation{ 42 Name: opSendSSHPublicKey, 43 HTTPMethod: "POST", 44 HTTPPath: "/", 45 } 46 47 if input == nil { 48 input = &SendSSHPublicKeyInput{} 49 } 50 51 output = &SendSSHPublicKeyOutput{} 52 req = c.newRequest(op, input, output) 53 return 54 } 55 56 // SendSSHPublicKey API operation for AWS EC2 Instance Connect. 57 // 58 // Pushes an SSH public key to the specified EC2 instance for use by the specified 59 // user. The key remains for 60 seconds. For more information, see Connect to 60 // your Linux instance using EC2 Instance Connect (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Connect-using-EC2-Instance-Connect.html) 61 // in the Amazon EC2 User Guide. 62 // 63 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 64 // with awserr.Error's Code and Message methods to get detailed information about 65 // the error. 66 // 67 // See the AWS API reference guide for AWS EC2 Instance Connect's 68 // API operation SendSSHPublicKey for usage and error information. 69 // 70 // Returned Error Types: 71 // * AuthException 72 // Either your AWS credentials are not valid or you do not have access to the 73 // EC2 instance. 74 // 75 // * InvalidArgsException 76 // One of the parameters is not valid. 77 // 78 // * ServiceException 79 // The service encountered an error. Follow the instructions in the error message 80 // and try again. 81 // 82 // * ThrottlingException 83 // The requests were made too frequently and have been throttled. Wait a while 84 // and try again. To increase the limit on your request frequency, contact AWS 85 // Support. 86 // 87 // * EC2InstanceNotFoundException 88 // The specified instance was not found. 89 // 90 // See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-instance-connect-2018-04-02/SendSSHPublicKey 91 func (c *EC2InstanceConnect) SendSSHPublicKey(input *SendSSHPublicKeyInput) (*SendSSHPublicKeyOutput, error) { 92 req, out := c.SendSSHPublicKeyRequest(input) 93 return out, req.Send() 94 } 95 96 // SendSSHPublicKeyWithContext is the same as SendSSHPublicKey with the addition of 97 // the ability to pass a context and additional request options. 98 // 99 // See SendSSHPublicKey for details on how to use this API operation. 100 // 101 // The context must be non-nil and will be used for request cancellation. If 102 // the context is nil a panic will occur. In the future the SDK may create 103 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 104 // for more information on using Contexts. 105 func (c *EC2InstanceConnect) SendSSHPublicKeyWithContext(ctx aws.Context, input *SendSSHPublicKeyInput, opts ...request.Option) (*SendSSHPublicKeyOutput, error) { 106 req, out := c.SendSSHPublicKeyRequest(input) 107 req.SetContext(ctx) 108 req.ApplyOptions(opts...) 109 return out, req.Send() 110 } 111 112 const opSendSerialConsoleSSHPublicKey = "SendSerialConsoleSSHPublicKey" 113 114 // SendSerialConsoleSSHPublicKeyRequest generates a "aws/request.Request" representing the 115 // client's request for the SendSerialConsoleSSHPublicKey operation. The "output" return 116 // value will be populated with the request's response once the request completes 117 // successfully. 118 // 119 // Use "Send" method on the returned Request to send the API call to the service. 120 // the "output" return value is not valid until after Send returns without error. 121 // 122 // See SendSerialConsoleSSHPublicKey for more information on using the SendSerialConsoleSSHPublicKey 123 // API call, and error handling. 124 // 125 // This method is useful when you want to inject custom logic or configuration 126 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 127 // 128 // 129 // // Example sending a request using the SendSerialConsoleSSHPublicKeyRequest method. 130 // req, resp := client.SendSerialConsoleSSHPublicKeyRequest(params) 131 // 132 // err := req.Send() 133 // if err == nil { // resp is now filled 134 // fmt.Println(resp) 135 // } 136 // 137 // See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-instance-connect-2018-04-02/SendSerialConsoleSSHPublicKey 138 func (c *EC2InstanceConnect) SendSerialConsoleSSHPublicKeyRequest(input *SendSerialConsoleSSHPublicKeyInput) (req *request.Request, output *SendSerialConsoleSSHPublicKeyOutput) { 139 op := &request.Operation{ 140 Name: opSendSerialConsoleSSHPublicKey, 141 HTTPMethod: "POST", 142 HTTPPath: "/", 143 } 144 145 if input == nil { 146 input = &SendSerialConsoleSSHPublicKeyInput{} 147 } 148 149 output = &SendSerialConsoleSSHPublicKeyOutput{} 150 req = c.newRequest(op, input, output) 151 return 152 } 153 154 // SendSerialConsoleSSHPublicKey API operation for AWS EC2 Instance Connect. 155 // 156 // Pushes an SSH public key to the specified EC2 instance. The key remains for 157 // 60 seconds, which gives you 60 seconds to establish a serial console connection 158 // to the instance using SSH. For more information, see EC2 Serial Console (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-serial-console.html) 159 // in the Amazon EC2 User Guide. 160 // 161 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 162 // with awserr.Error's Code and Message methods to get detailed information about 163 // the error. 164 // 165 // See the AWS API reference guide for AWS EC2 Instance Connect's 166 // API operation SendSerialConsoleSSHPublicKey for usage and error information. 167 // 168 // Returned Error Types: 169 // * AuthException 170 // Either your AWS credentials are not valid or you do not have access to the 171 // EC2 instance. 172 // 173 // * SerialConsoleAccessDisabledException 174 // Your account is not authorized to use the EC2 Serial Console. To authorize 175 // your account, run the EnableSerialConsoleAccess API. For more information, 176 // see EnableSerialConsoleAccess (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EnableSerialConsoleAccess.html) 177 // in the Amazon EC2 API Reference. 178 // 179 // * InvalidArgsException 180 // One of the parameters is not valid. 181 // 182 // * ServiceException 183 // The service encountered an error. Follow the instructions in the error message 184 // and try again. 185 // 186 // * ThrottlingException 187 // The requests were made too frequently and have been throttled. Wait a while 188 // and try again. To increase the limit on your request frequency, contact AWS 189 // Support. 190 // 191 // * EC2InstanceNotFoundException 192 // The specified instance was not found. 193 // 194 // * EC2InstanceTypeInvalidException 195 // The instance type is not supported for connecting via the serial console. 196 // Only Nitro instance types are currently supported. 197 // 198 // * SerialConsoleSessionLimitExceededException 199 // The instance currently has 1 active serial console session. Only 1 session 200 // is supported at a time. 201 // 202 // * SerialConsoleSessionUnavailableException 203 // Unable to start a serial console session. Please try again. 204 // 205 // See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-instance-connect-2018-04-02/SendSerialConsoleSSHPublicKey 206 func (c *EC2InstanceConnect) SendSerialConsoleSSHPublicKey(input *SendSerialConsoleSSHPublicKeyInput) (*SendSerialConsoleSSHPublicKeyOutput, error) { 207 req, out := c.SendSerialConsoleSSHPublicKeyRequest(input) 208 return out, req.Send() 209 } 210 211 // SendSerialConsoleSSHPublicKeyWithContext is the same as SendSerialConsoleSSHPublicKey with the addition of 212 // the ability to pass a context and additional request options. 213 // 214 // See SendSerialConsoleSSHPublicKey for details on how to use this API operation. 215 // 216 // The context must be non-nil and will be used for request cancellation. If 217 // the context is nil a panic will occur. In the future the SDK may create 218 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 219 // for more information on using Contexts. 220 func (c *EC2InstanceConnect) SendSerialConsoleSSHPublicKeyWithContext(ctx aws.Context, input *SendSerialConsoleSSHPublicKeyInput, opts ...request.Option) (*SendSerialConsoleSSHPublicKeyOutput, error) { 221 req, out := c.SendSerialConsoleSSHPublicKeyRequest(input) 222 req.SetContext(ctx) 223 req.ApplyOptions(opts...) 224 return out, req.Send() 225 } 226 227 // Either your AWS credentials are not valid or you do not have access to the 228 // EC2 instance. 229 type AuthException struct { 230 _ struct{} `type:"structure"` 231 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 232 233 Message_ *string `locationName:"Message" type:"string"` 234 } 235 236 // String returns the string representation. 237 // 238 // API parameter values that are decorated as "sensitive" in the API will not 239 // be included in the string output. The member name will be present, but the 240 // value will be replaced with "sensitive". 241 func (s AuthException) String() string { 242 return awsutil.Prettify(s) 243 } 244 245 // GoString returns the string representation. 246 // 247 // API parameter values that are decorated as "sensitive" in the API will not 248 // be included in the string output. The member name will be present, but the 249 // value will be replaced with "sensitive". 250 func (s AuthException) GoString() string { 251 return s.String() 252 } 253 254 func newErrorAuthException(v protocol.ResponseMetadata) error { 255 return &AuthException{ 256 RespMetadata: v, 257 } 258 } 259 260 // Code returns the exception type name. 261 func (s *AuthException) Code() string { 262 return "AuthException" 263 } 264 265 // Message returns the exception's message. 266 func (s *AuthException) Message() string { 267 if s.Message_ != nil { 268 return *s.Message_ 269 } 270 return "" 271 } 272 273 // OrigErr always returns nil, satisfies awserr.Error interface. 274 func (s *AuthException) OrigErr() error { 275 return nil 276 } 277 278 func (s *AuthException) Error() string { 279 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 280 } 281 282 // Status code returns the HTTP status code for the request's response error. 283 func (s *AuthException) StatusCode() int { 284 return s.RespMetadata.StatusCode 285 } 286 287 // RequestID returns the service's response RequestID for request. 288 func (s *AuthException) RequestID() string { 289 return s.RespMetadata.RequestID 290 } 291 292 // The specified instance was not found. 293 type EC2InstanceNotFoundException struct { 294 _ struct{} `type:"structure"` 295 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 296 297 Message_ *string `locationName:"Message" type:"string"` 298 } 299 300 // String returns the string representation. 301 // 302 // API parameter values that are decorated as "sensitive" in the API will not 303 // be included in the string output. The member name will be present, but the 304 // value will be replaced with "sensitive". 305 func (s EC2InstanceNotFoundException) String() string { 306 return awsutil.Prettify(s) 307 } 308 309 // GoString returns the string representation. 310 // 311 // API parameter values that are decorated as "sensitive" in the API will not 312 // be included in the string output. The member name will be present, but the 313 // value will be replaced with "sensitive". 314 func (s EC2InstanceNotFoundException) GoString() string { 315 return s.String() 316 } 317 318 func newErrorEC2InstanceNotFoundException(v protocol.ResponseMetadata) error { 319 return &EC2InstanceNotFoundException{ 320 RespMetadata: v, 321 } 322 } 323 324 // Code returns the exception type name. 325 func (s *EC2InstanceNotFoundException) Code() string { 326 return "EC2InstanceNotFoundException" 327 } 328 329 // Message returns the exception's message. 330 func (s *EC2InstanceNotFoundException) Message() string { 331 if s.Message_ != nil { 332 return *s.Message_ 333 } 334 return "" 335 } 336 337 // OrigErr always returns nil, satisfies awserr.Error interface. 338 func (s *EC2InstanceNotFoundException) OrigErr() error { 339 return nil 340 } 341 342 func (s *EC2InstanceNotFoundException) Error() string { 343 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 344 } 345 346 // Status code returns the HTTP status code for the request's response error. 347 func (s *EC2InstanceNotFoundException) StatusCode() int { 348 return s.RespMetadata.StatusCode 349 } 350 351 // RequestID returns the service's response RequestID for request. 352 func (s *EC2InstanceNotFoundException) RequestID() string { 353 return s.RespMetadata.RequestID 354 } 355 356 // The instance type is not supported for connecting via the serial console. 357 // Only Nitro instance types are currently supported. 358 type EC2InstanceTypeInvalidException struct { 359 _ struct{} `type:"structure"` 360 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 361 362 Message_ *string `locationName:"Message" type:"string"` 363 } 364 365 // String returns the string representation. 366 // 367 // API parameter values that are decorated as "sensitive" in the API will not 368 // be included in the string output. The member name will be present, but the 369 // value will be replaced with "sensitive". 370 func (s EC2InstanceTypeInvalidException) String() string { 371 return awsutil.Prettify(s) 372 } 373 374 // GoString returns the string representation. 375 // 376 // API parameter values that are decorated as "sensitive" in the API will not 377 // be included in the string output. The member name will be present, but the 378 // value will be replaced with "sensitive". 379 func (s EC2InstanceTypeInvalidException) GoString() string { 380 return s.String() 381 } 382 383 func newErrorEC2InstanceTypeInvalidException(v protocol.ResponseMetadata) error { 384 return &EC2InstanceTypeInvalidException{ 385 RespMetadata: v, 386 } 387 } 388 389 // Code returns the exception type name. 390 func (s *EC2InstanceTypeInvalidException) Code() string { 391 return "EC2InstanceTypeInvalidException" 392 } 393 394 // Message returns the exception's message. 395 func (s *EC2InstanceTypeInvalidException) Message() string { 396 if s.Message_ != nil { 397 return *s.Message_ 398 } 399 return "" 400 } 401 402 // OrigErr always returns nil, satisfies awserr.Error interface. 403 func (s *EC2InstanceTypeInvalidException) OrigErr() error { 404 return nil 405 } 406 407 func (s *EC2InstanceTypeInvalidException) Error() string { 408 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 409 } 410 411 // Status code returns the HTTP status code for the request's response error. 412 func (s *EC2InstanceTypeInvalidException) StatusCode() int { 413 return s.RespMetadata.StatusCode 414 } 415 416 // RequestID returns the service's response RequestID for request. 417 func (s *EC2InstanceTypeInvalidException) RequestID() string { 418 return s.RespMetadata.RequestID 419 } 420 421 // One of the parameters is not valid. 422 type InvalidArgsException struct { 423 _ struct{} `type:"structure"` 424 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 425 426 Message_ *string `locationName:"Message" type:"string"` 427 } 428 429 // String returns the string representation. 430 // 431 // API parameter values that are decorated as "sensitive" in the API will not 432 // be included in the string output. The member name will be present, but the 433 // value will be replaced with "sensitive". 434 func (s InvalidArgsException) String() string { 435 return awsutil.Prettify(s) 436 } 437 438 // GoString returns the string representation. 439 // 440 // API parameter values that are decorated as "sensitive" in the API will not 441 // be included in the string output. The member name will be present, but the 442 // value will be replaced with "sensitive". 443 func (s InvalidArgsException) GoString() string { 444 return s.String() 445 } 446 447 func newErrorInvalidArgsException(v protocol.ResponseMetadata) error { 448 return &InvalidArgsException{ 449 RespMetadata: v, 450 } 451 } 452 453 // Code returns the exception type name. 454 func (s *InvalidArgsException) Code() string { 455 return "InvalidArgsException" 456 } 457 458 // Message returns the exception's message. 459 func (s *InvalidArgsException) Message() string { 460 if s.Message_ != nil { 461 return *s.Message_ 462 } 463 return "" 464 } 465 466 // OrigErr always returns nil, satisfies awserr.Error interface. 467 func (s *InvalidArgsException) OrigErr() error { 468 return nil 469 } 470 471 func (s *InvalidArgsException) Error() string { 472 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 473 } 474 475 // Status code returns the HTTP status code for the request's response error. 476 func (s *InvalidArgsException) StatusCode() int { 477 return s.RespMetadata.StatusCode 478 } 479 480 // RequestID returns the service's response RequestID for request. 481 func (s *InvalidArgsException) RequestID() string { 482 return s.RespMetadata.RequestID 483 } 484 485 type SendSSHPublicKeyInput struct { 486 _ struct{} `type:"structure"` 487 488 // The Availability Zone in which the EC2 instance was launched. 489 // 490 // AvailabilityZone is a required field 491 AvailabilityZone *string `min:"6" type:"string" required:"true"` 492 493 // The ID of the EC2 instance. 494 // 495 // InstanceId is a required field 496 InstanceId *string `min:"10" type:"string" required:"true"` 497 498 // The OS user on the EC2 instance for whom the key can be used to authenticate. 499 // 500 // InstanceOSUser is a required field 501 InstanceOSUser *string `min:"1" type:"string" required:"true"` 502 503 // The public key material. To use the public key, you must have the matching 504 // private key. 505 // 506 // SSHPublicKey is a required field 507 SSHPublicKey *string `min:"256" type:"string" required:"true"` 508 } 509 510 // String returns the string representation. 511 // 512 // API parameter values that are decorated as "sensitive" in the API will not 513 // be included in the string output. The member name will be present, but the 514 // value will be replaced with "sensitive". 515 func (s SendSSHPublicKeyInput) String() string { 516 return awsutil.Prettify(s) 517 } 518 519 // GoString returns the string representation. 520 // 521 // API parameter values that are decorated as "sensitive" in the API will not 522 // be included in the string output. The member name will be present, but the 523 // value will be replaced with "sensitive". 524 func (s SendSSHPublicKeyInput) GoString() string { 525 return s.String() 526 } 527 528 // Validate inspects the fields of the type to determine if they are valid. 529 func (s *SendSSHPublicKeyInput) Validate() error { 530 invalidParams := request.ErrInvalidParams{Context: "SendSSHPublicKeyInput"} 531 if s.AvailabilityZone == nil { 532 invalidParams.Add(request.NewErrParamRequired("AvailabilityZone")) 533 } 534 if s.AvailabilityZone != nil && len(*s.AvailabilityZone) < 6 { 535 invalidParams.Add(request.NewErrParamMinLen("AvailabilityZone", 6)) 536 } 537 if s.InstanceId == nil { 538 invalidParams.Add(request.NewErrParamRequired("InstanceId")) 539 } 540 if s.InstanceId != nil && len(*s.InstanceId) < 10 { 541 invalidParams.Add(request.NewErrParamMinLen("InstanceId", 10)) 542 } 543 if s.InstanceOSUser == nil { 544 invalidParams.Add(request.NewErrParamRequired("InstanceOSUser")) 545 } 546 if s.InstanceOSUser != nil && len(*s.InstanceOSUser) < 1 { 547 invalidParams.Add(request.NewErrParamMinLen("InstanceOSUser", 1)) 548 } 549 if s.SSHPublicKey == nil { 550 invalidParams.Add(request.NewErrParamRequired("SSHPublicKey")) 551 } 552 if s.SSHPublicKey != nil && len(*s.SSHPublicKey) < 256 { 553 invalidParams.Add(request.NewErrParamMinLen("SSHPublicKey", 256)) 554 } 555 556 if invalidParams.Len() > 0 { 557 return invalidParams 558 } 559 return nil 560 } 561 562 // SetAvailabilityZone sets the AvailabilityZone field's value. 563 func (s *SendSSHPublicKeyInput) SetAvailabilityZone(v string) *SendSSHPublicKeyInput { 564 s.AvailabilityZone = &v 565 return s 566 } 567 568 // SetInstanceId sets the InstanceId field's value. 569 func (s *SendSSHPublicKeyInput) SetInstanceId(v string) *SendSSHPublicKeyInput { 570 s.InstanceId = &v 571 return s 572 } 573 574 // SetInstanceOSUser sets the InstanceOSUser field's value. 575 func (s *SendSSHPublicKeyInput) SetInstanceOSUser(v string) *SendSSHPublicKeyInput { 576 s.InstanceOSUser = &v 577 return s 578 } 579 580 // SetSSHPublicKey sets the SSHPublicKey field's value. 581 func (s *SendSSHPublicKeyInput) SetSSHPublicKey(v string) *SendSSHPublicKeyInput { 582 s.SSHPublicKey = &v 583 return s 584 } 585 586 type SendSSHPublicKeyOutput struct { 587 _ struct{} `type:"structure"` 588 589 // The ID of the request. Please provide this ID when contacting AWS Support 590 // for assistance. 591 RequestId *string `type:"string"` 592 593 // Is true if the request succeeds and an error otherwise. 594 Success *bool `type:"boolean"` 595 } 596 597 // String returns the string representation. 598 // 599 // API parameter values that are decorated as "sensitive" in the API will not 600 // be included in the string output. The member name will be present, but the 601 // value will be replaced with "sensitive". 602 func (s SendSSHPublicKeyOutput) String() string { 603 return awsutil.Prettify(s) 604 } 605 606 // GoString returns the string representation. 607 // 608 // API parameter values that are decorated as "sensitive" in the API will not 609 // be included in the string output. The member name will be present, but the 610 // value will be replaced with "sensitive". 611 func (s SendSSHPublicKeyOutput) GoString() string { 612 return s.String() 613 } 614 615 // SetRequestId sets the RequestId field's value. 616 func (s *SendSSHPublicKeyOutput) SetRequestId(v string) *SendSSHPublicKeyOutput { 617 s.RequestId = &v 618 return s 619 } 620 621 // SetSuccess sets the Success field's value. 622 func (s *SendSSHPublicKeyOutput) SetSuccess(v bool) *SendSSHPublicKeyOutput { 623 s.Success = &v 624 return s 625 } 626 627 type SendSerialConsoleSSHPublicKeyInput struct { 628 _ struct{} `type:"structure"` 629 630 // The ID of the EC2 instance. 631 // 632 // InstanceId is a required field 633 InstanceId *string `min:"10" type:"string" required:"true"` 634 635 // The public key material. To use the public key, you must have the matching 636 // private key. For information about the supported key formats and lengths, 637 // see Requirements for key pairs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#how-to-generate-your-own-key-and-import-it-to-aws) 638 // in the Amazon EC2 User Guide. 639 // 640 // SSHPublicKey is a required field 641 SSHPublicKey *string `min:"256" type:"string" required:"true"` 642 643 // The serial port of the EC2 instance. Currently only port 0 is supported. 644 // 645 // Default: 0 646 SerialPort *int64 `type:"integer"` 647 } 648 649 // String returns the string representation. 650 // 651 // API parameter values that are decorated as "sensitive" in the API will not 652 // be included in the string output. The member name will be present, but the 653 // value will be replaced with "sensitive". 654 func (s SendSerialConsoleSSHPublicKeyInput) String() string { 655 return awsutil.Prettify(s) 656 } 657 658 // GoString returns the string representation. 659 // 660 // API parameter values that are decorated as "sensitive" in the API will not 661 // be included in the string output. The member name will be present, but the 662 // value will be replaced with "sensitive". 663 func (s SendSerialConsoleSSHPublicKeyInput) GoString() string { 664 return s.String() 665 } 666 667 // Validate inspects the fields of the type to determine if they are valid. 668 func (s *SendSerialConsoleSSHPublicKeyInput) Validate() error { 669 invalidParams := request.ErrInvalidParams{Context: "SendSerialConsoleSSHPublicKeyInput"} 670 if s.InstanceId == nil { 671 invalidParams.Add(request.NewErrParamRequired("InstanceId")) 672 } 673 if s.InstanceId != nil && len(*s.InstanceId) < 10 { 674 invalidParams.Add(request.NewErrParamMinLen("InstanceId", 10)) 675 } 676 if s.SSHPublicKey == nil { 677 invalidParams.Add(request.NewErrParamRequired("SSHPublicKey")) 678 } 679 if s.SSHPublicKey != nil && len(*s.SSHPublicKey) < 256 { 680 invalidParams.Add(request.NewErrParamMinLen("SSHPublicKey", 256)) 681 } 682 683 if invalidParams.Len() > 0 { 684 return invalidParams 685 } 686 return nil 687 } 688 689 // SetInstanceId sets the InstanceId field's value. 690 func (s *SendSerialConsoleSSHPublicKeyInput) SetInstanceId(v string) *SendSerialConsoleSSHPublicKeyInput { 691 s.InstanceId = &v 692 return s 693 } 694 695 // SetSSHPublicKey sets the SSHPublicKey field's value. 696 func (s *SendSerialConsoleSSHPublicKeyInput) SetSSHPublicKey(v string) *SendSerialConsoleSSHPublicKeyInput { 697 s.SSHPublicKey = &v 698 return s 699 } 700 701 // SetSerialPort sets the SerialPort field's value. 702 func (s *SendSerialConsoleSSHPublicKeyInput) SetSerialPort(v int64) *SendSerialConsoleSSHPublicKeyInput { 703 s.SerialPort = &v 704 return s 705 } 706 707 type SendSerialConsoleSSHPublicKeyOutput struct { 708 _ struct{} `type:"structure"` 709 710 // The ID of the request. Please provide this ID when contacting AWS Support 711 // for assistance. 712 RequestId *string `type:"string"` 713 714 // Is true if the request succeeds and an error otherwise. 715 Success *bool `type:"boolean"` 716 } 717 718 // String returns the string representation. 719 // 720 // API parameter values that are decorated as "sensitive" in the API will not 721 // be included in the string output. The member name will be present, but the 722 // value will be replaced with "sensitive". 723 func (s SendSerialConsoleSSHPublicKeyOutput) String() string { 724 return awsutil.Prettify(s) 725 } 726 727 // GoString returns the string representation. 728 // 729 // API parameter values that are decorated as "sensitive" in the API will not 730 // be included in the string output. The member name will be present, but the 731 // value will be replaced with "sensitive". 732 func (s SendSerialConsoleSSHPublicKeyOutput) GoString() string { 733 return s.String() 734 } 735 736 // SetRequestId sets the RequestId field's value. 737 func (s *SendSerialConsoleSSHPublicKeyOutput) SetRequestId(v string) *SendSerialConsoleSSHPublicKeyOutput { 738 s.RequestId = &v 739 return s 740 } 741 742 // SetSuccess sets the Success field's value. 743 func (s *SendSerialConsoleSSHPublicKeyOutput) SetSuccess(v bool) *SendSerialConsoleSSHPublicKeyOutput { 744 s.Success = &v 745 return s 746 } 747 748 // Your account is not authorized to use the EC2 Serial Console. To authorize 749 // your account, run the EnableSerialConsoleAccess API. For more information, 750 // see EnableSerialConsoleAccess (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EnableSerialConsoleAccess.html) 751 // in the Amazon EC2 API Reference. 752 type SerialConsoleAccessDisabledException struct { 753 _ struct{} `type:"structure"` 754 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 755 756 Message_ *string `locationName:"Message" type:"string"` 757 } 758 759 // String returns the string representation. 760 // 761 // API parameter values that are decorated as "sensitive" in the API will not 762 // be included in the string output. The member name will be present, but the 763 // value will be replaced with "sensitive". 764 func (s SerialConsoleAccessDisabledException) String() string { 765 return awsutil.Prettify(s) 766 } 767 768 // GoString returns the string representation. 769 // 770 // API parameter values that are decorated as "sensitive" in the API will not 771 // be included in the string output. The member name will be present, but the 772 // value will be replaced with "sensitive". 773 func (s SerialConsoleAccessDisabledException) GoString() string { 774 return s.String() 775 } 776 777 func newErrorSerialConsoleAccessDisabledException(v protocol.ResponseMetadata) error { 778 return &SerialConsoleAccessDisabledException{ 779 RespMetadata: v, 780 } 781 } 782 783 // Code returns the exception type name. 784 func (s *SerialConsoleAccessDisabledException) Code() string { 785 return "SerialConsoleAccessDisabledException" 786 } 787 788 // Message returns the exception's message. 789 func (s *SerialConsoleAccessDisabledException) Message() string { 790 if s.Message_ != nil { 791 return *s.Message_ 792 } 793 return "" 794 } 795 796 // OrigErr always returns nil, satisfies awserr.Error interface. 797 func (s *SerialConsoleAccessDisabledException) OrigErr() error { 798 return nil 799 } 800 801 func (s *SerialConsoleAccessDisabledException) Error() string { 802 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 803 } 804 805 // Status code returns the HTTP status code for the request's response error. 806 func (s *SerialConsoleAccessDisabledException) StatusCode() int { 807 return s.RespMetadata.StatusCode 808 } 809 810 // RequestID returns the service's response RequestID for request. 811 func (s *SerialConsoleAccessDisabledException) RequestID() string { 812 return s.RespMetadata.RequestID 813 } 814 815 // The instance currently has 1 active serial console session. Only 1 session 816 // is supported at a time. 817 type SerialConsoleSessionLimitExceededException struct { 818 _ struct{} `type:"structure"` 819 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 820 821 Message_ *string `locationName:"Message" type:"string"` 822 } 823 824 // String returns the string representation. 825 // 826 // API parameter values that are decorated as "sensitive" in the API will not 827 // be included in the string output. The member name will be present, but the 828 // value will be replaced with "sensitive". 829 func (s SerialConsoleSessionLimitExceededException) String() string { 830 return awsutil.Prettify(s) 831 } 832 833 // GoString returns the string representation. 834 // 835 // API parameter values that are decorated as "sensitive" in the API will not 836 // be included in the string output. The member name will be present, but the 837 // value will be replaced with "sensitive". 838 func (s SerialConsoleSessionLimitExceededException) GoString() string { 839 return s.String() 840 } 841 842 func newErrorSerialConsoleSessionLimitExceededException(v protocol.ResponseMetadata) error { 843 return &SerialConsoleSessionLimitExceededException{ 844 RespMetadata: v, 845 } 846 } 847 848 // Code returns the exception type name. 849 func (s *SerialConsoleSessionLimitExceededException) Code() string { 850 return "SerialConsoleSessionLimitExceededException" 851 } 852 853 // Message returns the exception's message. 854 func (s *SerialConsoleSessionLimitExceededException) Message() string { 855 if s.Message_ != nil { 856 return *s.Message_ 857 } 858 return "" 859 } 860 861 // OrigErr always returns nil, satisfies awserr.Error interface. 862 func (s *SerialConsoleSessionLimitExceededException) OrigErr() error { 863 return nil 864 } 865 866 func (s *SerialConsoleSessionLimitExceededException) Error() string { 867 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 868 } 869 870 // Status code returns the HTTP status code for the request's response error. 871 func (s *SerialConsoleSessionLimitExceededException) StatusCode() int { 872 return s.RespMetadata.StatusCode 873 } 874 875 // RequestID returns the service's response RequestID for request. 876 func (s *SerialConsoleSessionLimitExceededException) RequestID() string { 877 return s.RespMetadata.RequestID 878 } 879 880 // Unable to start a serial console session. Please try again. 881 type SerialConsoleSessionUnavailableException struct { 882 _ struct{} `type:"structure"` 883 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 884 885 Message_ *string `locationName:"Message" type:"string"` 886 } 887 888 // String returns the string representation. 889 // 890 // API parameter values that are decorated as "sensitive" in the API will not 891 // be included in the string output. The member name will be present, but the 892 // value will be replaced with "sensitive". 893 func (s SerialConsoleSessionUnavailableException) String() string { 894 return awsutil.Prettify(s) 895 } 896 897 // GoString returns the string representation. 898 // 899 // API parameter values that are decorated as "sensitive" in the API will not 900 // be included in the string output. The member name will be present, but the 901 // value will be replaced with "sensitive". 902 func (s SerialConsoleSessionUnavailableException) GoString() string { 903 return s.String() 904 } 905 906 func newErrorSerialConsoleSessionUnavailableException(v protocol.ResponseMetadata) error { 907 return &SerialConsoleSessionUnavailableException{ 908 RespMetadata: v, 909 } 910 } 911 912 // Code returns the exception type name. 913 func (s *SerialConsoleSessionUnavailableException) Code() string { 914 return "SerialConsoleSessionUnavailableException" 915 } 916 917 // Message returns the exception's message. 918 func (s *SerialConsoleSessionUnavailableException) Message() string { 919 if s.Message_ != nil { 920 return *s.Message_ 921 } 922 return "" 923 } 924 925 // OrigErr always returns nil, satisfies awserr.Error interface. 926 func (s *SerialConsoleSessionUnavailableException) OrigErr() error { 927 return nil 928 } 929 930 func (s *SerialConsoleSessionUnavailableException) Error() string { 931 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 932 } 933 934 // Status code returns the HTTP status code for the request's response error. 935 func (s *SerialConsoleSessionUnavailableException) StatusCode() int { 936 return s.RespMetadata.StatusCode 937 } 938 939 // RequestID returns the service's response RequestID for request. 940 func (s *SerialConsoleSessionUnavailableException) RequestID() string { 941 return s.RespMetadata.RequestID 942 } 943 944 // The service encountered an error. Follow the instructions in the error message 945 // and try again. 946 type ServiceException struct { 947 _ struct{} `type:"structure"` 948 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 949 950 Message_ *string `locationName:"Message" type:"string"` 951 } 952 953 // String returns the string representation. 954 // 955 // API parameter values that are decorated as "sensitive" in the API will not 956 // be included in the string output. The member name will be present, but the 957 // value will be replaced with "sensitive". 958 func (s ServiceException) String() string { 959 return awsutil.Prettify(s) 960 } 961 962 // GoString returns the string representation. 963 // 964 // API parameter values that are decorated as "sensitive" in the API will not 965 // be included in the string output. The member name will be present, but the 966 // value will be replaced with "sensitive". 967 func (s ServiceException) GoString() string { 968 return s.String() 969 } 970 971 func newErrorServiceException(v protocol.ResponseMetadata) error { 972 return &ServiceException{ 973 RespMetadata: v, 974 } 975 } 976 977 // Code returns the exception type name. 978 func (s *ServiceException) Code() string { 979 return "ServiceException" 980 } 981 982 // Message returns the exception's message. 983 func (s *ServiceException) Message() string { 984 if s.Message_ != nil { 985 return *s.Message_ 986 } 987 return "" 988 } 989 990 // OrigErr always returns nil, satisfies awserr.Error interface. 991 func (s *ServiceException) OrigErr() error { 992 return nil 993 } 994 995 func (s *ServiceException) Error() string { 996 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 997 } 998 999 // Status code returns the HTTP status code for the request's response error. 1000 func (s *ServiceException) StatusCode() int { 1001 return s.RespMetadata.StatusCode 1002 } 1003 1004 // RequestID returns the service's response RequestID for request. 1005 func (s *ServiceException) RequestID() string { 1006 return s.RespMetadata.RequestID 1007 } 1008 1009 // The requests were made too frequently and have been throttled. Wait a while 1010 // and try again. To increase the limit on your request frequency, contact AWS 1011 // Support. 1012 type ThrottlingException struct { 1013 _ struct{} `type:"structure"` 1014 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1015 1016 Message_ *string `locationName:"Message" type:"string"` 1017 } 1018 1019 // String returns the string representation. 1020 // 1021 // API parameter values that are decorated as "sensitive" in the API will not 1022 // be included in the string output. The member name will be present, but the 1023 // value will be replaced with "sensitive". 1024 func (s ThrottlingException) String() string { 1025 return awsutil.Prettify(s) 1026 } 1027 1028 // GoString returns the string representation. 1029 // 1030 // API parameter values that are decorated as "sensitive" in the API will not 1031 // be included in the string output. The member name will be present, but the 1032 // value will be replaced with "sensitive". 1033 func (s ThrottlingException) GoString() string { 1034 return s.String() 1035 } 1036 1037 func newErrorThrottlingException(v protocol.ResponseMetadata) error { 1038 return &ThrottlingException{ 1039 RespMetadata: v, 1040 } 1041 } 1042 1043 // Code returns the exception type name. 1044 func (s *ThrottlingException) Code() string { 1045 return "ThrottlingException" 1046 } 1047 1048 // Message returns the exception's message. 1049 func (s *ThrottlingException) Message() string { 1050 if s.Message_ != nil { 1051 return *s.Message_ 1052 } 1053 return "" 1054 } 1055 1056 // OrigErr always returns nil, satisfies awserr.Error interface. 1057 func (s *ThrottlingException) OrigErr() error { 1058 return nil 1059 } 1060 1061 func (s *ThrottlingException) Error() string { 1062 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1063 } 1064 1065 // Status code returns the HTTP status code for the request's response error. 1066 func (s *ThrottlingException) StatusCode() int { 1067 return s.RespMetadata.StatusCode 1068 } 1069 1070 // RequestID returns the service's response RequestID for request. 1071 func (s *ThrottlingException) RequestID() string { 1072 return s.RespMetadata.RequestID 1073 }