doc.go 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. // Package ec2 provides the client and types for making API
  3. // requests to Amazon Elastic Compute Cloud.
  4. //
  5. // Amazon Elastic Compute Cloud (Amazon EC2) provides resizable computing capacity
  6. // in the Amazon Web Services (AWS) cloud. Using Amazon EC2 eliminates your
  7. // need to invest in hardware up front, so you can develop and deploy applications
  8. // faster.
  9. //
  10. // See https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15 for more information on this service.
  11. //
  12. // See ec2 package documentation for more information.
  13. // https://docs.aws.amazon.com/sdk-for-go/api/service/ec2/
  14. //
  15. // Using the Client
  16. //
  17. // To use the client for Amazon Elastic Compute Cloud you will first need
  18. // to create a new instance of it.
  19. //
  20. // When creating a client for an AWS service you'll first need to have a Session
  21. // already created. The Session provides configuration that can be shared
  22. // between multiple service clients. Additional configuration can be applied to
  23. // the Session and service's client when they are constructed. The aws package's
  24. // Config type contains several fields such as Region for the AWS Region the
  25. // client should make API requests too. The optional Config value can be provided
  26. // as the variadic argument for Sessions and client creation.
  27. //
  28. // Once the service's client is created you can use it to make API requests the
  29. // AWS service. These clients are safe to use concurrently.
  30. //
  31. // // Create a session to share configuration, and load external configuration.
  32. // sess := session.Must(session.NewSession())
  33. //
  34. // // Create the service's client with the session.
  35. // svc := ec2.New(sess)
  36. //
  37. // See the SDK's documentation for more information on how to use service clients.
  38. // https://docs.aws.amazon.com/sdk-for-go/api/
  39. //
  40. // See aws package's Config type for more information on configuration options.
  41. // https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
  42. //
  43. // See the Amazon Elastic Compute Cloud client EC2 for more
  44. // information on creating the service's client.
  45. // https://docs.aws.amazon.com/sdk-for-go/api/service/ec2/#New
  46. //
  47. // Once the client is created you can make an API request to the service.
  48. // Each API method takes a input parameter, and returns the service response
  49. // and an error.
  50. //
  51. // The API method will document which error codes the service can be returned
  52. // by the operation if the service models the API operation's errors. These
  53. // errors will also be available as const strings prefixed with "ErrCode".
  54. //
  55. // result, err := svc.AcceptReservedInstancesExchangeQuote(params)
  56. // if err != nil {
  57. // // Cast err to awserr.Error to handle specific error codes.
  58. // aerr, ok := err.(awserr.Error)
  59. // if ok && aerr.Code() == <error code to check for> {
  60. // // Specific error code handling
  61. // }
  62. // return err
  63. // }
  64. //
  65. // fmt.Println("AcceptReservedInstancesExchangeQuote result:")
  66. // fmt.Println(result)
  67. //
  68. // Using the Client with Context
  69. //
  70. // The service's client also provides methods to make API requests with a Context
  71. // value. This allows you to control the timeout, and cancellation of pending
  72. // requests. These methods also take request Option as variadic parameter to apply
  73. // additional configuration to the API request.
  74. //
  75. // ctx := context.Background()
  76. //
  77. // result, err := svc.AcceptReservedInstancesExchangeQuoteWithContext(ctx, params)
  78. //
  79. // See the request package documentation for more information on using Context pattern
  80. // with the SDK.
  81. // https://docs.aws.amazon.com/sdk-for-go/api/aws/request/
  82. package ec2