doc.go 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. // Package cloudwatch provides the client and types for making API
  3. // requests to Amazon CloudWatch.
  4. //
  5. // Amazon CloudWatch monitors your Amazon Web Services (AWS) resources and the
  6. // applications you run on AWS in real time. You can use CloudWatch to collect
  7. // and track metrics, which are the variables you want to measure for your resources
  8. // and applications.
  9. //
  10. // CloudWatch alarms send notifications or automatically change the resources
  11. // you are monitoring based on rules that you define. For example, you can monitor
  12. // the CPU usage and disk reads and writes of your Amazon EC2 instances. Then,
  13. // use this data to determine whether you should launch additional instances
  14. // to handle increased load. You can also use this data to stop under-used instances
  15. // to save money.
  16. //
  17. // In addition to monitoring the built-in metrics that come with AWS, you can
  18. // monitor your own custom metrics. With CloudWatch, you gain system-wide visibility
  19. // into resource utilization, application performance, and operational health.
  20. //
  21. // See https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01 for more information on this service.
  22. //
  23. // See cloudwatch package documentation for more information.
  24. // https://docs.aws.amazon.com/sdk-for-go/api/service/cloudwatch/
  25. //
  26. // Using the Client
  27. //
  28. // To use the client for Amazon CloudWatch you will first need
  29. // to create a new instance of it.
  30. //
  31. // When creating a client for an AWS service you'll first need to have a Session
  32. // already created. The Session provides configuration that can be shared
  33. // between multiple service clients. Additional configuration can be applied to
  34. // the Session and service's client when they are constructed. The aws package's
  35. // Config type contains several fields such as Region for the AWS Region the
  36. // client should make API requests too. The optional Config value can be provided
  37. // as the variadic argument for Sessions and client creation.
  38. //
  39. // Once the service's client is created you can use it to make API requests the
  40. // AWS service. These clients are safe to use concurrently.
  41. //
  42. // // Create a session to share configuration, and load external configuration.
  43. // sess := session.Must(session.NewSession())
  44. //
  45. // // Create the service's client with the session.
  46. // svc := cloudwatch.New(sess)
  47. //
  48. // See the SDK's documentation for more information on how to use service clients.
  49. // https://docs.aws.amazon.com/sdk-for-go/api/
  50. //
  51. // See aws package's Config type for more information on configuration options.
  52. // https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
  53. //
  54. // See the Amazon CloudWatch client CloudWatch for more
  55. // information on creating the service's client.
  56. // https://docs.aws.amazon.com/sdk-for-go/api/service/cloudwatch/#New
  57. //
  58. // Once the client is created you can make an API request to the service.
  59. // Each API method takes a input parameter, and returns the service response
  60. // and an error.
  61. //
  62. // The API method will document which error codes the service can be returned
  63. // by the operation if the service models the API operation's errors. These
  64. // errors will also be available as const strings prefixed with "ErrCode".
  65. //
  66. // result, err := svc.DeleteAlarms(params)
  67. // if err != nil {
  68. // // Cast err to awserr.Error to handle specific error codes.
  69. // aerr, ok := err.(awserr.Error)
  70. // if ok && aerr.Code() == <error code to check for> {
  71. // // Specific error code handling
  72. // }
  73. // return err
  74. // }
  75. //
  76. // fmt.Println("DeleteAlarms result:")
  77. // fmt.Println(result)
  78. //
  79. // Using the Client with Context
  80. //
  81. // The service's client also provides methods to make API requests with a Context
  82. // value. This allows you to control the timeout, and cancellation of pending
  83. // requests. These methods also take request Option as variadic parameter to apply
  84. // additional configuration to the API request.
  85. //
  86. // ctx := context.Background()
  87. //
  88. // result, err := svc.DeleteAlarmsWithContext(ctx, params)
  89. //
  90. // See the request package documentation for more information on using Context pattern
  91. // with the SDK.
  92. // https://docs.aws.amazon.com/sdk-for-go/api/aws/request/
  93. package cloudwatch