Switch to using the dep tool and update all the dependencies
This commit is contained in:
parent
5135ff73cb
commit
98c2d2c41b
5321 changed files with 4483201 additions and 5922 deletions
3479
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/api.go
generated
vendored
Normal file
3479
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/api.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
120
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface.go
generated
vendored
Normal file
120
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface.go
generated
vendored
Normal file
|
@ -0,0 +1,120 @@
|
|||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package cloudwatchiface provides an interface to enable mocking the Amazon CloudWatch service client
|
||||
// for testing your code.
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters.
|
||||
package cloudwatchiface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/cloudwatch"
|
||||
)
|
||||
|
||||
// CloudWatchAPI provides an interface to enable mocking the
|
||||
// cloudwatch.CloudWatch service client's API operation,
|
||||
// paginators, and waiters. This make unit testing your code that calls out
|
||||
// to the SDK's service client's calls easier.
|
||||
//
|
||||
// The best way to use this interface is so the SDK's service client's calls
|
||||
// can be stubbed out for unit testing your code with the SDK without needing
|
||||
// to inject custom request handlers into the the SDK's request pipeline.
|
||||
//
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // Amazon CloudWatch.
|
||||
// func myFunc(svc cloudwatchiface.CloudWatchAPI) bool {
|
||||
// // Make svc.DeleteAlarms request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := cloudwatch.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockCloudWatchClient struct {
|
||||
// cloudwatchiface.CloudWatchAPI
|
||||
// }
|
||||
// func (m *mockCloudWatchClient) DeleteAlarms(input *cloudwatch.DeleteAlarmsInput) (*cloudwatch.DeleteAlarmsOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockCloudWatchClient{}
|
||||
//
|
||||
// myfunc(mockSvc)
|
||||
//
|
||||
// // Verify myFunc's functionality
|
||||
// }
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters. Its suggested to use the pattern above for testing, or using
|
||||
// tooling to generate mocks to satisfy the interfaces.
|
||||
type CloudWatchAPI interface {
|
||||
DeleteAlarms(*cloudwatch.DeleteAlarmsInput) (*cloudwatch.DeleteAlarmsOutput, error)
|
||||
DeleteAlarmsWithContext(aws.Context, *cloudwatch.DeleteAlarmsInput, ...request.Option) (*cloudwatch.DeleteAlarmsOutput, error)
|
||||
DeleteAlarmsRequest(*cloudwatch.DeleteAlarmsInput) (*request.Request, *cloudwatch.DeleteAlarmsOutput)
|
||||
|
||||
DescribeAlarmHistory(*cloudwatch.DescribeAlarmHistoryInput) (*cloudwatch.DescribeAlarmHistoryOutput, error)
|
||||
DescribeAlarmHistoryWithContext(aws.Context, *cloudwatch.DescribeAlarmHistoryInput, ...request.Option) (*cloudwatch.DescribeAlarmHistoryOutput, error)
|
||||
DescribeAlarmHistoryRequest(*cloudwatch.DescribeAlarmHistoryInput) (*request.Request, *cloudwatch.DescribeAlarmHistoryOutput)
|
||||
|
||||
DescribeAlarmHistoryPages(*cloudwatch.DescribeAlarmHistoryInput, func(*cloudwatch.DescribeAlarmHistoryOutput, bool) bool) error
|
||||
DescribeAlarmHistoryPagesWithContext(aws.Context, *cloudwatch.DescribeAlarmHistoryInput, func(*cloudwatch.DescribeAlarmHistoryOutput, bool) bool, ...request.Option) error
|
||||
|
||||
DescribeAlarms(*cloudwatch.DescribeAlarmsInput) (*cloudwatch.DescribeAlarmsOutput, error)
|
||||
DescribeAlarmsWithContext(aws.Context, *cloudwatch.DescribeAlarmsInput, ...request.Option) (*cloudwatch.DescribeAlarmsOutput, error)
|
||||
DescribeAlarmsRequest(*cloudwatch.DescribeAlarmsInput) (*request.Request, *cloudwatch.DescribeAlarmsOutput)
|
||||
|
||||
DescribeAlarmsPages(*cloudwatch.DescribeAlarmsInput, func(*cloudwatch.DescribeAlarmsOutput, bool) bool) error
|
||||
DescribeAlarmsPagesWithContext(aws.Context, *cloudwatch.DescribeAlarmsInput, func(*cloudwatch.DescribeAlarmsOutput, bool) bool, ...request.Option) error
|
||||
|
||||
DescribeAlarmsForMetric(*cloudwatch.DescribeAlarmsForMetricInput) (*cloudwatch.DescribeAlarmsForMetricOutput, error)
|
||||
DescribeAlarmsForMetricWithContext(aws.Context, *cloudwatch.DescribeAlarmsForMetricInput, ...request.Option) (*cloudwatch.DescribeAlarmsForMetricOutput, error)
|
||||
DescribeAlarmsForMetricRequest(*cloudwatch.DescribeAlarmsForMetricInput) (*request.Request, *cloudwatch.DescribeAlarmsForMetricOutput)
|
||||
|
||||
DisableAlarmActions(*cloudwatch.DisableAlarmActionsInput) (*cloudwatch.DisableAlarmActionsOutput, error)
|
||||
DisableAlarmActionsWithContext(aws.Context, *cloudwatch.DisableAlarmActionsInput, ...request.Option) (*cloudwatch.DisableAlarmActionsOutput, error)
|
||||
DisableAlarmActionsRequest(*cloudwatch.DisableAlarmActionsInput) (*request.Request, *cloudwatch.DisableAlarmActionsOutput)
|
||||
|
||||
EnableAlarmActions(*cloudwatch.EnableAlarmActionsInput) (*cloudwatch.EnableAlarmActionsOutput, error)
|
||||
EnableAlarmActionsWithContext(aws.Context, *cloudwatch.EnableAlarmActionsInput, ...request.Option) (*cloudwatch.EnableAlarmActionsOutput, error)
|
||||
EnableAlarmActionsRequest(*cloudwatch.EnableAlarmActionsInput) (*request.Request, *cloudwatch.EnableAlarmActionsOutput)
|
||||
|
||||
GetMetricStatistics(*cloudwatch.GetMetricStatisticsInput) (*cloudwatch.GetMetricStatisticsOutput, error)
|
||||
GetMetricStatisticsWithContext(aws.Context, *cloudwatch.GetMetricStatisticsInput, ...request.Option) (*cloudwatch.GetMetricStatisticsOutput, error)
|
||||
GetMetricStatisticsRequest(*cloudwatch.GetMetricStatisticsInput) (*request.Request, *cloudwatch.GetMetricStatisticsOutput)
|
||||
|
||||
ListMetrics(*cloudwatch.ListMetricsInput) (*cloudwatch.ListMetricsOutput, error)
|
||||
ListMetricsWithContext(aws.Context, *cloudwatch.ListMetricsInput, ...request.Option) (*cloudwatch.ListMetricsOutput, error)
|
||||
ListMetricsRequest(*cloudwatch.ListMetricsInput) (*request.Request, *cloudwatch.ListMetricsOutput)
|
||||
|
||||
ListMetricsPages(*cloudwatch.ListMetricsInput, func(*cloudwatch.ListMetricsOutput, bool) bool) error
|
||||
ListMetricsPagesWithContext(aws.Context, *cloudwatch.ListMetricsInput, func(*cloudwatch.ListMetricsOutput, bool) bool, ...request.Option) error
|
||||
|
||||
PutMetricAlarm(*cloudwatch.PutMetricAlarmInput) (*cloudwatch.PutMetricAlarmOutput, error)
|
||||
PutMetricAlarmWithContext(aws.Context, *cloudwatch.PutMetricAlarmInput, ...request.Option) (*cloudwatch.PutMetricAlarmOutput, error)
|
||||
PutMetricAlarmRequest(*cloudwatch.PutMetricAlarmInput) (*request.Request, *cloudwatch.PutMetricAlarmOutput)
|
||||
|
||||
PutMetricData(*cloudwatch.PutMetricDataInput) (*cloudwatch.PutMetricDataOutput, error)
|
||||
PutMetricDataWithContext(aws.Context, *cloudwatch.PutMetricDataInput, ...request.Option) (*cloudwatch.PutMetricDataOutput, error)
|
||||
PutMetricDataRequest(*cloudwatch.PutMetricDataInput) (*request.Request, *cloudwatch.PutMetricDataOutput)
|
||||
|
||||
SetAlarmState(*cloudwatch.SetAlarmStateInput) (*cloudwatch.SetAlarmStateOutput, error)
|
||||
SetAlarmStateWithContext(aws.Context, *cloudwatch.SetAlarmStateInput, ...request.Option) (*cloudwatch.SetAlarmStateOutput, error)
|
||||
SetAlarmStateRequest(*cloudwatch.SetAlarmStateInput) (*request.Request, *cloudwatch.SetAlarmStateOutput)
|
||||
|
||||
WaitUntilAlarmExists(*cloudwatch.DescribeAlarmsInput) error
|
||||
WaitUntilAlarmExistsWithContext(aws.Context, *cloudwatch.DescribeAlarmsInput, ...request.WaiterOption) error
|
||||
}
|
||||
|
||||
var _ CloudWatchAPI = (*cloudwatch.CloudWatch)(nil)
|
94
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/doc.go
generated
vendored
Normal file
94
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/doc.go
generated
vendored
Normal file
|
@ -0,0 +1,94 @@
|
|||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package cloudwatch provides the client and types for making API
|
||||
// requests to Amazon CloudWatch.
|
||||
//
|
||||
// Amazon CloudWatch monitors your Amazon Web Services (AWS) resources and the
|
||||
// applications you run on AWS in real-time. You can use CloudWatch to collect
|
||||
// and track metrics, which are the variables you want to measure for your resources
|
||||
// and applications.
|
||||
//
|
||||
// CloudWatch alarms send notifications or automatically make changes to the
|
||||
// resources you are monitoring based on rules that you define. For example,
|
||||
// you can monitor the CPU usage and disk reads and writes of your Amazon Elastic
|
||||
// Compute Cloud (Amazon EC2) instances and then use this data to determine
|
||||
// whether you should launch additional instances to handle increased load.
|
||||
// You can also use this data to stop under-used instances to save money.
|
||||
//
|
||||
// In addition to monitoring the built-in metrics that come with AWS, you can
|
||||
// monitor your own custom metrics. With CloudWatch, you gain system-wide visibility
|
||||
// into resource utilization, application performance, and operational health.
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01 for more information on this service.
|
||||
//
|
||||
// See cloudwatch package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/cloudwatch/
|
||||
//
|
||||
// Using the Client
|
||||
//
|
||||
// To use the client for Amazon CloudWatch you will first need
|
||||
// to create a new instance of it.
|
||||
//
|
||||
// When creating a client for an AWS service you'll first need to have a Session
|
||||
// already created. The Session provides configuration that can be shared
|
||||
// between multiple service clients. Additional configuration can be applied to
|
||||
// the Session and service's client when they are constructed. The aws package's
|
||||
// Config type contains several fields such as Region for the AWS Region the
|
||||
// client should make API requests too. The optional Config value can be provided
|
||||
// as the variadic argument for Sessions and client creation.
|
||||
//
|
||||
// Once the service's client is created you can use it to make API requests the
|
||||
// AWS service. These clients are safe to use concurrently.
|
||||
//
|
||||
// // Create a session to share configuration, and load external configuration.
|
||||
// sess := session.Must(session.NewSession())
|
||||
//
|
||||
// // Create the service's client with the session.
|
||||
// svc := cloudwatch.New(sess)
|
||||
//
|
||||
// See the SDK's documentation for more information on how to use service clients.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/
|
||||
//
|
||||
// See aws package's Config type for more information on configuration options.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
|
||||
//
|
||||
// See the Amazon CloudWatch client CloudWatch for more
|
||||
// information on creating the service's client.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/cloudwatch/#New
|
||||
//
|
||||
// Once the client is created you can make an API request to the service.
|
||||
// Each API method takes a input parameter, and returns the service response
|
||||
// and an error.
|
||||
//
|
||||
// The API method will document which error codes the service can be returned
|
||||
// by the operation if the service models the API operation's errors. These
|
||||
// errors will also be available as const strings prefixed with "ErrCode".
|
||||
//
|
||||
// result, err := svc.DeleteAlarms(params)
|
||||
// if err != nil {
|
||||
// // Cast err to awserr.Error to handle specific error codes.
|
||||
// aerr, ok := err.(awserr.Error)
|
||||
// if ok && aerr.Code() == <error code to check for> {
|
||||
// // Specific error code handling
|
||||
// }
|
||||
// return err
|
||||
// }
|
||||
//
|
||||
// fmt.Println("DeleteAlarms result:")
|
||||
// fmt.Println(result)
|
||||
//
|
||||
// Using the Client with Context
|
||||
//
|
||||
// The service's client also provides methods to make API requests with a Context
|
||||
// value. This allows you to control the timeout, and cancellation of pending
|
||||
// requests. These methods also take request Option as variadic parameter to apply
|
||||
// additional configuration to the API request.
|
||||
//
|
||||
// ctx := context.Background()
|
||||
//
|
||||
// result, err := svc.DeleteAlarmsWithContext(ctx, params)
|
||||
//
|
||||
// See the request package documentation for more information on using Context pattern
|
||||
// with the SDK.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/request/
|
||||
package cloudwatch
|
54
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/errors.go
generated
vendored
Normal file
54
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/errors.go
generated
vendored
Normal file
|
@ -0,0 +1,54 @@
|
|||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package cloudwatch
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeInternalServiceFault for service response error code
|
||||
// "InternalServiceError".
|
||||
//
|
||||
// Request processing has failed due to some unknown error, exception, or failure.
|
||||
ErrCodeInternalServiceFault = "InternalServiceError"
|
||||
|
||||
// ErrCodeInvalidFormatFault for service response error code
|
||||
// "InvalidFormat".
|
||||
//
|
||||
// Data was not syntactically valid JSON.
|
||||
ErrCodeInvalidFormatFault = "InvalidFormat"
|
||||
|
||||
// ErrCodeInvalidNextToken for service response error code
|
||||
// "InvalidNextToken".
|
||||
//
|
||||
// The next token specified is invalid.
|
||||
ErrCodeInvalidNextToken = "InvalidNextToken"
|
||||
|
||||
// ErrCodeInvalidParameterCombinationException for service response error code
|
||||
// "InvalidParameterCombination".
|
||||
//
|
||||
// Parameters that cannot be used together were used together.
|
||||
ErrCodeInvalidParameterCombinationException = "InvalidParameterCombination"
|
||||
|
||||
// ErrCodeInvalidParameterValueException for service response error code
|
||||
// "InvalidParameterValue".
|
||||
//
|
||||
// The value of an input parameter is bad or out-of-range.
|
||||
ErrCodeInvalidParameterValueException = "InvalidParameterValue"
|
||||
|
||||
// ErrCodeLimitExceededFault for service response error code
|
||||
// "LimitExceeded".
|
||||
//
|
||||
// The quota for alarms for this customer has already been reached.
|
||||
ErrCodeLimitExceededFault = "LimitExceeded"
|
||||
|
||||
// ErrCodeMissingRequiredParameterException for service response error code
|
||||
// "MissingParameter".
|
||||
//
|
||||
// An input parameter that is required is missing.
|
||||
ErrCodeMissingRequiredParameterException = "MissingParameter"
|
||||
|
||||
// ErrCodeResourceNotFound for service response error code
|
||||
// "ResourceNotFound".
|
||||
//
|
||||
// The named resource does not exist.
|
||||
ErrCodeResourceNotFound = "ResourceNotFound"
|
||||
)
|
367
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/examples_test.go
generated
vendored
Normal file
367
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/examples_test.go
generated
vendored
Normal file
|
@ -0,0 +1,367 @@
|
|||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package cloudwatch_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
"github.com/aws/aws-sdk-go/service/cloudwatch"
|
||||
)
|
||||
|
||||
var _ time.Duration
|
||||
var _ bytes.Buffer
|
||||
|
||||
func ExampleCloudWatch_DeleteAlarms() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudwatch.New(sess)
|
||||
|
||||
params := &cloudwatch.DeleteAlarmsInput{
|
||||
AlarmNames: []*string{ // Required
|
||||
aws.String("AlarmName"), // Required
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.DeleteAlarms(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudWatch_DescribeAlarmHistory() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudwatch.New(sess)
|
||||
|
||||
params := &cloudwatch.DescribeAlarmHistoryInput{
|
||||
AlarmName: aws.String("AlarmName"),
|
||||
EndDate: aws.Time(time.Now()),
|
||||
HistoryItemType: aws.String("HistoryItemType"),
|
||||
MaxRecords: aws.Int64(1),
|
||||
NextToken: aws.String("NextToken"),
|
||||
StartDate: aws.Time(time.Now()),
|
||||
}
|
||||
resp, err := svc.DescribeAlarmHistory(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudWatch_DescribeAlarms() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudwatch.New(sess)
|
||||
|
||||
params := &cloudwatch.DescribeAlarmsInput{
|
||||
ActionPrefix: aws.String("ActionPrefix"),
|
||||
AlarmNamePrefix: aws.String("AlarmNamePrefix"),
|
||||
AlarmNames: []*string{
|
||||
aws.String("AlarmName"), // Required
|
||||
// More values...
|
||||
},
|
||||
MaxRecords: aws.Int64(1),
|
||||
NextToken: aws.String("NextToken"),
|
||||
StateValue: aws.String("StateValue"),
|
||||
}
|
||||
resp, err := svc.DescribeAlarms(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudWatch_DescribeAlarmsForMetric() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudwatch.New(sess)
|
||||
|
||||
params := &cloudwatch.DescribeAlarmsForMetricInput{
|
||||
MetricName: aws.String("MetricName"), // Required
|
||||
Namespace: aws.String("Namespace"), // Required
|
||||
Dimensions: []*cloudwatch.Dimension{
|
||||
{ // Required
|
||||
Name: aws.String("DimensionName"), // Required
|
||||
Value: aws.String("DimensionValue"), // Required
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
ExtendedStatistic: aws.String("ExtendedStatistic"),
|
||||
Period: aws.Int64(1),
|
||||
Statistic: aws.String("Statistic"),
|
||||
Unit: aws.String("StandardUnit"),
|
||||
}
|
||||
resp, err := svc.DescribeAlarmsForMetric(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudWatch_DisableAlarmActions() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudwatch.New(sess)
|
||||
|
||||
params := &cloudwatch.DisableAlarmActionsInput{
|
||||
AlarmNames: []*string{ // Required
|
||||
aws.String("AlarmName"), // Required
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.DisableAlarmActions(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudWatch_EnableAlarmActions() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudwatch.New(sess)
|
||||
|
||||
params := &cloudwatch.EnableAlarmActionsInput{
|
||||
AlarmNames: []*string{ // Required
|
||||
aws.String("AlarmName"), // Required
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.EnableAlarmActions(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudWatch_GetMetricStatistics() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudwatch.New(sess)
|
||||
|
||||
params := &cloudwatch.GetMetricStatisticsInput{
|
||||
EndTime: aws.Time(time.Now()), // Required
|
||||
MetricName: aws.String("MetricName"), // Required
|
||||
Namespace: aws.String("Namespace"), // Required
|
||||
Period: aws.Int64(1), // Required
|
||||
StartTime: aws.Time(time.Now()), // Required
|
||||
Dimensions: []*cloudwatch.Dimension{
|
||||
{ // Required
|
||||
Name: aws.String("DimensionName"), // Required
|
||||
Value: aws.String("DimensionValue"), // Required
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
ExtendedStatistics: []*string{
|
||||
aws.String("ExtendedStatistic"), // Required
|
||||
// More values...
|
||||
},
|
||||
Statistics: []*string{
|
||||
aws.String("Statistic"), // Required
|
||||
// More values...
|
||||
},
|
||||
Unit: aws.String("StandardUnit"),
|
||||
}
|
||||
resp, err := svc.GetMetricStatistics(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudWatch_ListMetrics() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudwatch.New(sess)
|
||||
|
||||
params := &cloudwatch.ListMetricsInput{
|
||||
Dimensions: []*cloudwatch.DimensionFilter{
|
||||
{ // Required
|
||||
Name: aws.String("DimensionName"), // Required
|
||||
Value: aws.String("DimensionValue"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
MetricName: aws.String("MetricName"),
|
||||
Namespace: aws.String("Namespace"),
|
||||
NextToken: aws.String("NextToken"),
|
||||
}
|
||||
resp, err := svc.ListMetrics(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudWatch_PutMetricAlarm() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudwatch.New(sess)
|
||||
|
||||
params := &cloudwatch.PutMetricAlarmInput{
|
||||
AlarmName: aws.String("AlarmName"), // Required
|
||||
ComparisonOperator: aws.String("ComparisonOperator"), // Required
|
||||
EvaluationPeriods: aws.Int64(1), // Required
|
||||
MetricName: aws.String("MetricName"), // Required
|
||||
Namespace: aws.String("Namespace"), // Required
|
||||
Period: aws.Int64(1), // Required
|
||||
Threshold: aws.Float64(1.0), // Required
|
||||
ActionsEnabled: aws.Bool(true),
|
||||
AlarmActions: []*string{
|
||||
aws.String("ResourceName"), // Required
|
||||
// More values...
|
||||
},
|
||||
AlarmDescription: aws.String("AlarmDescription"),
|
||||
Dimensions: []*cloudwatch.Dimension{
|
||||
{ // Required
|
||||
Name: aws.String("DimensionName"), // Required
|
||||
Value: aws.String("DimensionValue"), // Required
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
EvaluateLowSampleCountPercentile: aws.String("EvaluateLowSampleCountPercentile"),
|
||||
ExtendedStatistic: aws.String("ExtendedStatistic"),
|
||||
InsufficientDataActions: []*string{
|
||||
aws.String("ResourceName"), // Required
|
||||
// More values...
|
||||
},
|
||||
OKActions: []*string{
|
||||
aws.String("ResourceName"), // Required
|
||||
// More values...
|
||||
},
|
||||
Statistic: aws.String("Statistic"),
|
||||
TreatMissingData: aws.String("TreatMissingData"),
|
||||
Unit: aws.String("StandardUnit"),
|
||||
}
|
||||
resp, err := svc.PutMetricAlarm(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudWatch_PutMetricData() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudwatch.New(sess)
|
||||
|
||||
params := &cloudwatch.PutMetricDataInput{
|
||||
MetricData: []*cloudwatch.MetricDatum{ // Required
|
||||
{ // Required
|
||||
MetricName: aws.String("MetricName"), // Required
|
||||
Dimensions: []*cloudwatch.Dimension{
|
||||
{ // Required
|
||||
Name: aws.String("DimensionName"), // Required
|
||||
Value: aws.String("DimensionValue"), // Required
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
StatisticValues: &cloudwatch.StatisticSet{
|
||||
Maximum: aws.Float64(1.0), // Required
|
||||
Minimum: aws.Float64(1.0), // Required
|
||||
SampleCount: aws.Float64(1.0), // Required
|
||||
Sum: aws.Float64(1.0), // Required
|
||||
},
|
||||
Timestamp: aws.Time(time.Now()),
|
||||
Unit: aws.String("StandardUnit"),
|
||||
Value: aws.Float64(1.0),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
Namespace: aws.String("Namespace"), // Required
|
||||
}
|
||||
resp, err := svc.PutMetricData(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudWatch_SetAlarmState() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudwatch.New(sess)
|
||||
|
||||
params := &cloudwatch.SetAlarmStateInput{
|
||||
AlarmName: aws.String("AlarmName"), // Required
|
||||
StateReason: aws.String("StateReason"), // Required
|
||||
StateValue: aws.String("StateValue"), // Required
|
||||
StateReasonData: aws.String("StateReasonData"),
|
||||
}
|
||||
resp, err := svc.SetAlarmState(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
93
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/service.go
generated
vendored
Normal file
93
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/service.go
generated
vendored
Normal file
|
@ -0,0 +1,93 @@
|
|||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package cloudwatch
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/client"
|
||||
"github.com/aws/aws-sdk-go/aws/client/metadata"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go/private/protocol/query"
|
||||
)
|
||||
|
||||
// CloudWatch provides the API operation methods for making requests to
|
||||
// Amazon CloudWatch. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// CloudWatch methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type CloudWatch struct {
|
||||
*client.Client
|
||||
}
|
||||
|
||||
// Used for custom client initialization logic
|
||||
var initClient func(*client.Client)
|
||||
|
||||
// Used for custom request initialization logic
|
||||
var initRequest func(*request.Request)
|
||||
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "monitoring" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the CloudWatch client with a session.
|
||||
// If additional configuration is needed for the client instance use the optional
|
||||
// aws.Config parameter to add your extra config.
|
||||
//
|
||||
// Example:
|
||||
// // Create a CloudWatch client from just a session.
|
||||
// svc := cloudwatch.New(mySession)
|
||||
//
|
||||
// // Create a CloudWatch client with additional configuration
|
||||
// svc := cloudwatch.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudWatch {
|
||||
c := p.ClientConfig(EndpointsID, cfgs...)
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *CloudWatch {
|
||||
svc := &CloudWatch{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2010-08-01",
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
}
|
||||
|
||||
// Handlers
|
||||
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
|
||||
svc.Handlers.Build.PushBackNamed(query.BuildHandler)
|
||||
svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler)
|
||||
svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler)
|
||||
svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler)
|
||||
|
||||
// Run custom client initialization if present
|
||||
if initClient != nil {
|
||||
initClient(svc.Client)
|
||||
}
|
||||
|
||||
return svc
|
||||
}
|
||||
|
||||
// newRequest creates a new request for a CloudWatch operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *CloudWatch) newRequest(op *request.Operation, params, data interface{}) *request.Request {
|
||||
req := c.NewRequest(op, params, data)
|
||||
|
||||
// Run custom request initialization if present
|
||||
if initRequest != nil {
|
||||
initRequest(req)
|
||||
}
|
||||
|
||||
return req
|
||||
}
|
56
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/waiters.go
generated
vendored
Normal file
56
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/waiters.go
generated
vendored
Normal file
|
@ -0,0 +1,56 @@
|
|||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package cloudwatch
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
)
|
||||
|
||||
// WaitUntilAlarmExists uses the CloudWatch API operation
|
||||
// DescribeAlarms to wait for a condition to be met before returning.
|
||||
// If the condition is not meet within the max attempt window an error will
|
||||
// be returned.
|
||||
func (c *CloudWatch) WaitUntilAlarmExists(input *DescribeAlarmsInput) error {
|
||||
return c.WaitUntilAlarmExistsWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilAlarmExistsWithContext is an extended version of WaitUntilAlarmExists.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *CloudWatch) WaitUntilAlarmExistsWithContext(ctx aws.Context, input *DescribeAlarmsInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilAlarmExists",
|
||||
MaxAttempts: 40,
|
||||
Delay: request.ConstantWaiterDelay(5 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.PathWaiterMatch, Argument: "length(MetricAlarms[]) > `0`",
|
||||
Expected: true,
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
var inCpy *DescribeAlarmsInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.DescribeAlarmsRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue