1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3package cloudwatch 4 5import ( 6 "fmt" 7 "time" 8 9 "github.com/aws/aws-sdk-go/aws" 10 "github.com/aws/aws-sdk-go/aws/awsutil" 11 "github.com/aws/aws-sdk-go/aws/request" 12 "github.com/aws/aws-sdk-go/private/protocol" 13 "github.com/aws/aws-sdk-go/private/protocol/query" 14) 15 16const opDeleteAlarms = "DeleteAlarms" 17 18// DeleteAlarmsRequest generates a "aws/request.Request" representing the 19// client's request for the DeleteAlarms operation. The "output" return 20// value will be populated with the request's response once the request complets 21// successfuly. 22// 23// Use "Send" method on the returned Request to send the API call to the service. 24// the "output" return value is not valid until after Send returns without error. 25// 26// See DeleteAlarms for more information on using the DeleteAlarms 27// API call, and error handling. 28// 29// This method is useful when you want to inject custom logic or configuration 30// into the SDK's request lifecycle. Such as custom headers, or retry logic. 31// 32// 33// // Example sending a request using the DeleteAlarmsRequest method. 34// req, resp := client.DeleteAlarmsRequest(params) 35// 36// err := req.Send() 37// if err == nil { // resp is now filled 38// fmt.Println(resp) 39// } 40// 41// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteAlarms 42func (c *CloudWatch) DeleteAlarmsRequest(input *DeleteAlarmsInput) (req *request.Request, output *DeleteAlarmsOutput) { 43 op := &request.Operation{ 44 Name: opDeleteAlarms, 45 HTTPMethod: "POST", 46 HTTPPath: "/", 47 } 48 49 if input == nil { 50 input = &DeleteAlarmsInput{} 51 } 52 53 output = &DeleteAlarmsOutput{} 54 req = c.newRequest(op, input, output) 55 req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) 56 req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) 57 return 58} 59 60// DeleteAlarms API operation for Amazon CloudWatch. 61// 62// Deletes the specified alarms. In the event of an error, no alarms are deleted. 63// 64// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 65// with awserr.Error's Code and Message methods to get detailed information about 66// the error. 67// 68// See the AWS API reference guide for Amazon CloudWatch's 69// API operation DeleteAlarms for usage and error information. 70// 71// Returned Error Codes: 72// * ErrCodeResourceNotFound "ResourceNotFound" 73// The named resource does not exist. 74// 75// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteAlarms 76func (c *CloudWatch) DeleteAlarms(input *DeleteAlarmsInput) (*DeleteAlarmsOutput, error) { 77 req, out := c.DeleteAlarmsRequest(input) 78 return out, req.Send() 79} 80 81// DeleteAlarmsWithContext is the same as DeleteAlarms with the addition of 82// the ability to pass a context and additional request options. 83// 84// See DeleteAlarms for details on how to use this API operation. 85// 86// The context must be non-nil and will be used for request cancellation. If 87// the context is nil a panic will occur. In the future the SDK may create 88// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 89// for more information on using Contexts. 90func (c *CloudWatch) DeleteAlarmsWithContext(ctx aws.Context, input *DeleteAlarmsInput, opts ...request.Option) (*DeleteAlarmsOutput, error) { 91 req, out := c.DeleteAlarmsRequest(input) 92 req.SetContext(ctx) 93 req.ApplyOptions(opts...) 94 return out, req.Send() 95} 96 97const opDeleteDashboards = "DeleteDashboards" 98 99// DeleteDashboardsRequest generates a "aws/request.Request" representing the 100// client's request for the DeleteDashboards operation. The "output" return 101// value will be populated with the request's response once the request complets 102// successfuly. 103// 104// Use "Send" method on the returned Request to send the API call to the service. 105// the "output" return value is not valid until after Send returns without error. 106// 107// See DeleteDashboards for more information on using the DeleteDashboards 108// API call, and error handling. 109// 110// This method is useful when you want to inject custom logic or configuration 111// into the SDK's request lifecycle. Such as custom headers, or retry logic. 112// 113// 114// // Example sending a request using the DeleteDashboardsRequest method. 115// req, resp := client.DeleteDashboardsRequest(params) 116// 117// err := req.Send() 118// if err == nil { // resp is now filled 119// fmt.Println(resp) 120// } 121// 122// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteDashboards 123func (c *CloudWatch) DeleteDashboardsRequest(input *DeleteDashboardsInput) (req *request.Request, output *DeleteDashboardsOutput) { 124 op := &request.Operation{ 125 Name: opDeleteDashboards, 126 HTTPMethod: "POST", 127 HTTPPath: "/", 128 } 129 130 if input == nil { 131 input = &DeleteDashboardsInput{} 132 } 133 134 output = &DeleteDashboardsOutput{} 135 req = c.newRequest(op, input, output) 136 return 137} 138 139// DeleteDashboards API operation for Amazon CloudWatch. 140// 141// Deletes all dashboards that you specify. You may specify up to 100 dashboards 142// to delete. If there is an error during this call, no dashboards are deleted. 143// 144// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 145// with awserr.Error's Code and Message methods to get detailed information about 146// the error. 147// 148// See the AWS API reference guide for Amazon CloudWatch's 149// API operation DeleteDashboards for usage and error information. 150// 151// Returned Error Codes: 152// * ErrCodeInvalidParameterValueException "InvalidParameterValue" 153// The value of an input parameter is bad or out-of-range. 154// 155// * ErrCodeDashboardNotFoundError "ResourceNotFound" 156// The specified dashboard does not exist. 157// 158// * ErrCodeInternalServiceFault "InternalServiceError" 159// Request processing has failed due to some unknown error, exception, or failure. 160// 161// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteDashboards 162func (c *CloudWatch) DeleteDashboards(input *DeleteDashboardsInput) (*DeleteDashboardsOutput, error) { 163 req, out := c.DeleteDashboardsRequest(input) 164 return out, req.Send() 165} 166 167// DeleteDashboardsWithContext is the same as DeleteDashboards with the addition of 168// the ability to pass a context and additional request options. 169// 170// See DeleteDashboards for details on how to use this API operation. 171// 172// The context must be non-nil and will be used for request cancellation. If 173// the context is nil a panic will occur. In the future the SDK may create 174// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 175// for more information on using Contexts. 176func (c *CloudWatch) DeleteDashboardsWithContext(ctx aws.Context, input *DeleteDashboardsInput, opts ...request.Option) (*DeleteDashboardsOutput, error) { 177 req, out := c.DeleteDashboardsRequest(input) 178 req.SetContext(ctx) 179 req.ApplyOptions(opts...) 180 return out, req.Send() 181} 182 183const opDescribeAlarmHistory = "DescribeAlarmHistory" 184 185// DescribeAlarmHistoryRequest generates a "aws/request.Request" representing the 186// client's request for the DescribeAlarmHistory operation. The "output" return 187// value will be populated with the request's response once the request complets 188// successfuly. 189// 190// Use "Send" method on the returned Request to send the API call to the service. 191// the "output" return value is not valid until after Send returns without error. 192// 193// See DescribeAlarmHistory for more information on using the DescribeAlarmHistory 194// API call, and error handling. 195// 196// This method is useful when you want to inject custom logic or configuration 197// into the SDK's request lifecycle. Such as custom headers, or retry logic. 198// 199// 200// // Example sending a request using the DescribeAlarmHistoryRequest method. 201// req, resp := client.DescribeAlarmHistoryRequest(params) 202// 203// err := req.Send() 204// if err == nil { // resp is now filled 205// fmt.Println(resp) 206// } 207// 208// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmHistory 209func (c *CloudWatch) DescribeAlarmHistoryRequest(input *DescribeAlarmHistoryInput) (req *request.Request, output *DescribeAlarmHistoryOutput) { 210 op := &request.Operation{ 211 Name: opDescribeAlarmHistory, 212 HTTPMethod: "POST", 213 HTTPPath: "/", 214 Paginator: &request.Paginator{ 215 InputTokens: []string{"NextToken"}, 216 OutputTokens: []string{"NextToken"}, 217 LimitToken: "MaxRecords", 218 TruncationToken: "", 219 }, 220 } 221 222 if input == nil { 223 input = &DescribeAlarmHistoryInput{} 224 } 225 226 output = &DescribeAlarmHistoryOutput{} 227 req = c.newRequest(op, input, output) 228 return 229} 230 231// DescribeAlarmHistory API operation for Amazon CloudWatch. 232// 233// Retrieves the history for the specified alarm. You can filter the results 234// by date range or item type. If an alarm name is not specified, the histories 235// for all alarms are returned. 236// 237// CloudWatch retains the history of an alarm even if you delete the alarm. 238// 239// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 240// with awserr.Error's Code and Message methods to get detailed information about 241// the error. 242// 243// See the AWS API reference guide for Amazon CloudWatch's 244// API operation DescribeAlarmHistory for usage and error information. 245// 246// Returned Error Codes: 247// * ErrCodeInvalidNextToken "InvalidNextToken" 248// The next token specified is invalid. 249// 250// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmHistory 251func (c *CloudWatch) DescribeAlarmHistory(input *DescribeAlarmHistoryInput) (*DescribeAlarmHistoryOutput, error) { 252 req, out := c.DescribeAlarmHistoryRequest(input) 253 return out, req.Send() 254} 255 256// DescribeAlarmHistoryWithContext is the same as DescribeAlarmHistory with the addition of 257// the ability to pass a context and additional request options. 258// 259// See DescribeAlarmHistory for details on how to use this API operation. 260// 261// The context must be non-nil and will be used for request cancellation. If 262// the context is nil a panic will occur. In the future the SDK may create 263// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 264// for more information on using Contexts. 265func (c *CloudWatch) DescribeAlarmHistoryWithContext(ctx aws.Context, input *DescribeAlarmHistoryInput, opts ...request.Option) (*DescribeAlarmHistoryOutput, error) { 266 req, out := c.DescribeAlarmHistoryRequest(input) 267 req.SetContext(ctx) 268 req.ApplyOptions(opts...) 269 return out, req.Send() 270} 271 272// DescribeAlarmHistoryPages iterates over the pages of a DescribeAlarmHistory operation, 273// calling the "fn" function with the response data for each page. To stop 274// iterating, return false from the fn function. 275// 276// See DescribeAlarmHistory method for more information on how to use this operation. 277// 278// Note: This operation can generate multiple requests to a service. 279// 280// // Example iterating over at most 3 pages of a DescribeAlarmHistory operation. 281// pageNum := 0 282// err := client.DescribeAlarmHistoryPages(params, 283// func(page *DescribeAlarmHistoryOutput, lastPage bool) bool { 284// pageNum++ 285// fmt.Println(page) 286// return pageNum <= 3 287// }) 288// 289func (c *CloudWatch) DescribeAlarmHistoryPages(input *DescribeAlarmHistoryInput, fn func(*DescribeAlarmHistoryOutput, bool) bool) error { 290 return c.DescribeAlarmHistoryPagesWithContext(aws.BackgroundContext(), input, fn) 291} 292 293// DescribeAlarmHistoryPagesWithContext same as DescribeAlarmHistoryPages except 294// it takes a Context and allows setting request options on the pages. 295// 296// The context must be non-nil and will be used for request cancellation. If 297// the context is nil a panic will occur. In the future the SDK may create 298// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 299// for more information on using Contexts. 300func (c *CloudWatch) DescribeAlarmHistoryPagesWithContext(ctx aws.Context, input *DescribeAlarmHistoryInput, fn func(*DescribeAlarmHistoryOutput, bool) bool, opts ...request.Option) error { 301 p := request.Pagination{ 302 NewRequest: func() (*request.Request, error) { 303 var inCpy *DescribeAlarmHistoryInput 304 if input != nil { 305 tmp := *input 306 inCpy = &tmp 307 } 308 req, _ := c.DescribeAlarmHistoryRequest(inCpy) 309 req.SetContext(ctx) 310 req.ApplyOptions(opts...) 311 return req, nil 312 }, 313 } 314 315 cont := true 316 for p.Next() && cont { 317 cont = fn(p.Page().(*DescribeAlarmHistoryOutput), !p.HasNextPage()) 318 } 319 return p.Err() 320} 321 322const opDescribeAlarms = "DescribeAlarms" 323 324// DescribeAlarmsRequest generates a "aws/request.Request" representing the 325// client's request for the DescribeAlarms operation. The "output" return 326// value will be populated with the request's response once the request complets 327// successfuly. 328// 329// Use "Send" method on the returned Request to send the API call to the service. 330// the "output" return value is not valid until after Send returns without error. 331// 332// See DescribeAlarms for more information on using the DescribeAlarms 333// API call, and error handling. 334// 335// This method is useful when you want to inject custom logic or configuration 336// into the SDK's request lifecycle. Such as custom headers, or retry logic. 337// 338// 339// // Example sending a request using the DescribeAlarmsRequest method. 340// req, resp := client.DescribeAlarmsRequest(params) 341// 342// err := req.Send() 343// if err == nil { // resp is now filled 344// fmt.Println(resp) 345// } 346// 347// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarms 348func (c *CloudWatch) DescribeAlarmsRequest(input *DescribeAlarmsInput) (req *request.Request, output *DescribeAlarmsOutput) { 349 op := &request.Operation{ 350 Name: opDescribeAlarms, 351 HTTPMethod: "POST", 352 HTTPPath: "/", 353 Paginator: &request.Paginator{ 354 InputTokens: []string{"NextToken"}, 355 OutputTokens: []string{"NextToken"}, 356 LimitToken: "MaxRecords", 357 TruncationToken: "", 358 }, 359 } 360 361 if input == nil { 362 input = &DescribeAlarmsInput{} 363 } 364 365 output = &DescribeAlarmsOutput{} 366 req = c.newRequest(op, input, output) 367 return 368} 369 370// DescribeAlarms API operation for Amazon CloudWatch. 371// 372// Retrieves the specified alarms. If no alarms are specified, all alarms are 373// returned. Alarms can be retrieved by using only a prefix for the alarm name, 374// the alarm state, or a prefix for any action. 375// 376// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 377// with awserr.Error's Code and Message methods to get detailed information about 378// the error. 379// 380// See the AWS API reference guide for Amazon CloudWatch's 381// API operation DescribeAlarms for usage and error information. 382// 383// Returned Error Codes: 384// * ErrCodeInvalidNextToken "InvalidNextToken" 385// The next token specified is invalid. 386// 387// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarms 388func (c *CloudWatch) DescribeAlarms(input *DescribeAlarmsInput) (*DescribeAlarmsOutput, error) { 389 req, out := c.DescribeAlarmsRequest(input) 390 return out, req.Send() 391} 392 393// DescribeAlarmsWithContext is the same as DescribeAlarms with the addition of 394// the ability to pass a context and additional request options. 395// 396// See DescribeAlarms for details on how to use this API operation. 397// 398// The context must be non-nil and will be used for request cancellation. If 399// the context is nil a panic will occur. In the future the SDK may create 400// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 401// for more information on using Contexts. 402func (c *CloudWatch) DescribeAlarmsWithContext(ctx aws.Context, input *DescribeAlarmsInput, opts ...request.Option) (*DescribeAlarmsOutput, error) { 403 req, out := c.DescribeAlarmsRequest(input) 404 req.SetContext(ctx) 405 req.ApplyOptions(opts...) 406 return out, req.Send() 407} 408 409// DescribeAlarmsPages iterates over the pages of a DescribeAlarms operation, 410// calling the "fn" function with the response data for each page. To stop 411// iterating, return false from the fn function. 412// 413// See DescribeAlarms method for more information on how to use this operation. 414// 415// Note: This operation can generate multiple requests to a service. 416// 417// // Example iterating over at most 3 pages of a DescribeAlarms operation. 418// pageNum := 0 419// err := client.DescribeAlarmsPages(params, 420// func(page *DescribeAlarmsOutput, lastPage bool) bool { 421// pageNum++ 422// fmt.Println(page) 423// return pageNum <= 3 424// }) 425// 426func (c *CloudWatch) DescribeAlarmsPages(input *DescribeAlarmsInput, fn func(*DescribeAlarmsOutput, bool) bool) error { 427 return c.DescribeAlarmsPagesWithContext(aws.BackgroundContext(), input, fn) 428} 429 430// DescribeAlarmsPagesWithContext same as DescribeAlarmsPages except 431// it takes a Context and allows setting request options on the pages. 432// 433// The context must be non-nil and will be used for request cancellation. If 434// the context is nil a panic will occur. In the future the SDK may create 435// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 436// for more information on using Contexts. 437func (c *CloudWatch) DescribeAlarmsPagesWithContext(ctx aws.Context, input *DescribeAlarmsInput, fn func(*DescribeAlarmsOutput, bool) bool, opts ...request.Option) error { 438 p := request.Pagination{ 439 NewRequest: func() (*request.Request, error) { 440 var inCpy *DescribeAlarmsInput 441 if input != nil { 442 tmp := *input 443 inCpy = &tmp 444 } 445 req, _ := c.DescribeAlarmsRequest(inCpy) 446 req.SetContext(ctx) 447 req.ApplyOptions(opts...) 448 return req, nil 449 }, 450 } 451 452 cont := true 453 for p.Next() && cont { 454 cont = fn(p.Page().(*DescribeAlarmsOutput), !p.HasNextPage()) 455 } 456 return p.Err() 457} 458 459const opDescribeAlarmsForMetric = "DescribeAlarmsForMetric" 460 461// DescribeAlarmsForMetricRequest generates a "aws/request.Request" representing the 462// client's request for the DescribeAlarmsForMetric operation. The "output" return 463// value will be populated with the request's response once the request complets 464// successfuly. 465// 466// Use "Send" method on the returned Request to send the API call to the service. 467// the "output" return value is not valid until after Send returns without error. 468// 469// See DescribeAlarmsForMetric for more information on using the DescribeAlarmsForMetric 470// API call, and error handling. 471// 472// This method is useful when you want to inject custom logic or configuration 473// into the SDK's request lifecycle. Such as custom headers, or retry logic. 474// 475// 476// // Example sending a request using the DescribeAlarmsForMetricRequest method. 477// req, resp := client.DescribeAlarmsForMetricRequest(params) 478// 479// err := req.Send() 480// if err == nil { // resp is now filled 481// fmt.Println(resp) 482// } 483// 484// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmsForMetric 485func (c *CloudWatch) DescribeAlarmsForMetricRequest(input *DescribeAlarmsForMetricInput) (req *request.Request, output *DescribeAlarmsForMetricOutput) { 486 op := &request.Operation{ 487 Name: opDescribeAlarmsForMetric, 488 HTTPMethod: "POST", 489 HTTPPath: "/", 490 } 491 492 if input == nil { 493 input = &DescribeAlarmsForMetricInput{} 494 } 495 496 output = &DescribeAlarmsForMetricOutput{} 497 req = c.newRequest(op, input, output) 498 return 499} 500 501// DescribeAlarmsForMetric API operation for Amazon CloudWatch. 502// 503// Retrieves the alarms for the specified metric. To filter the results, specify 504// a statistic, period, or unit. 505// 506// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 507// with awserr.Error's Code and Message methods to get detailed information about 508// the error. 509// 510// See the AWS API reference guide for Amazon CloudWatch's 511// API operation DescribeAlarmsForMetric for usage and error information. 512// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmsForMetric 513func (c *CloudWatch) DescribeAlarmsForMetric(input *DescribeAlarmsForMetricInput) (*DescribeAlarmsForMetricOutput, error) { 514 req, out := c.DescribeAlarmsForMetricRequest(input) 515 return out, req.Send() 516} 517 518// DescribeAlarmsForMetricWithContext is the same as DescribeAlarmsForMetric with the addition of 519// the ability to pass a context and additional request options. 520// 521// See DescribeAlarmsForMetric for details on how to use this API operation. 522// 523// The context must be non-nil and will be used for request cancellation. If 524// the context is nil a panic will occur. In the future the SDK may create 525// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 526// for more information on using Contexts. 527func (c *CloudWatch) DescribeAlarmsForMetricWithContext(ctx aws.Context, input *DescribeAlarmsForMetricInput, opts ...request.Option) (*DescribeAlarmsForMetricOutput, error) { 528 req, out := c.DescribeAlarmsForMetricRequest(input) 529 req.SetContext(ctx) 530 req.ApplyOptions(opts...) 531 return out, req.Send() 532} 533 534const opDisableAlarmActions = "DisableAlarmActions" 535 536// DisableAlarmActionsRequest generates a "aws/request.Request" representing the 537// client's request for the DisableAlarmActions operation. The "output" return 538// value will be populated with the request's response once the request complets 539// successfuly. 540// 541// Use "Send" method on the returned Request to send the API call to the service. 542// the "output" return value is not valid until after Send returns without error. 543// 544// See DisableAlarmActions for more information on using the DisableAlarmActions 545// API call, and error handling. 546// 547// This method is useful when you want to inject custom logic or configuration 548// into the SDK's request lifecycle. Such as custom headers, or retry logic. 549// 550// 551// // Example sending a request using the DisableAlarmActionsRequest method. 552// req, resp := client.DisableAlarmActionsRequest(params) 553// 554// err := req.Send() 555// if err == nil { // resp is now filled 556// fmt.Println(resp) 557// } 558// 559// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DisableAlarmActions 560func (c *CloudWatch) DisableAlarmActionsRequest(input *DisableAlarmActionsInput) (req *request.Request, output *DisableAlarmActionsOutput) { 561 op := &request.Operation{ 562 Name: opDisableAlarmActions, 563 HTTPMethod: "POST", 564 HTTPPath: "/", 565 } 566 567 if input == nil { 568 input = &DisableAlarmActionsInput{} 569 } 570 571 output = &DisableAlarmActionsOutput{} 572 req = c.newRequest(op, input, output) 573 req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) 574 req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) 575 return 576} 577 578// DisableAlarmActions API operation for Amazon CloudWatch. 579// 580// Disables the actions for the specified alarms. When an alarm's actions are 581// disabled, the alarm actions do not execute when the alarm state changes. 582// 583// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 584// with awserr.Error's Code and Message methods to get detailed information about 585// the error. 586// 587// See the AWS API reference guide for Amazon CloudWatch's 588// API operation DisableAlarmActions for usage and error information. 589// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DisableAlarmActions 590func (c *CloudWatch) DisableAlarmActions(input *DisableAlarmActionsInput) (*DisableAlarmActionsOutput, error) { 591 req, out := c.DisableAlarmActionsRequest(input) 592 return out, req.Send() 593} 594 595// DisableAlarmActionsWithContext is the same as DisableAlarmActions with the addition of 596// the ability to pass a context and additional request options. 597// 598// See DisableAlarmActions for details on how to use this API operation. 599// 600// The context must be non-nil and will be used for request cancellation. If 601// the context is nil a panic will occur. In the future the SDK may create 602// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 603// for more information on using Contexts. 604func (c *CloudWatch) DisableAlarmActionsWithContext(ctx aws.Context, input *DisableAlarmActionsInput, opts ...request.Option) (*DisableAlarmActionsOutput, error) { 605 req, out := c.DisableAlarmActionsRequest(input) 606 req.SetContext(ctx) 607 req.ApplyOptions(opts...) 608 return out, req.Send() 609} 610 611const opEnableAlarmActions = "EnableAlarmActions" 612 613// EnableAlarmActionsRequest generates a "aws/request.Request" representing the 614// client's request for the EnableAlarmActions operation. The "output" return 615// value will be populated with the request's response once the request complets 616// successfuly. 617// 618// Use "Send" method on the returned Request to send the API call to the service. 619// the "output" return value is not valid until after Send returns without error. 620// 621// See EnableAlarmActions for more information on using the EnableAlarmActions 622// API call, and error handling. 623// 624// This method is useful when you want to inject custom logic or configuration 625// into the SDK's request lifecycle. Such as custom headers, or retry logic. 626// 627// 628// // Example sending a request using the EnableAlarmActionsRequest method. 629// req, resp := client.EnableAlarmActionsRequest(params) 630// 631// err := req.Send() 632// if err == nil { // resp is now filled 633// fmt.Println(resp) 634// } 635// 636// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/EnableAlarmActions 637func (c *CloudWatch) EnableAlarmActionsRequest(input *EnableAlarmActionsInput) (req *request.Request, output *EnableAlarmActionsOutput) { 638 op := &request.Operation{ 639 Name: opEnableAlarmActions, 640 HTTPMethod: "POST", 641 HTTPPath: "/", 642 } 643 644 if input == nil { 645 input = &EnableAlarmActionsInput{} 646 } 647 648 output = &EnableAlarmActionsOutput{} 649 req = c.newRequest(op, input, output) 650 req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) 651 req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) 652 return 653} 654 655// EnableAlarmActions API operation for Amazon CloudWatch. 656// 657// Enables the actions for the specified alarms. 658// 659// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 660// with awserr.Error's Code and Message methods to get detailed information about 661// the error. 662// 663// See the AWS API reference guide for Amazon CloudWatch's 664// API operation EnableAlarmActions for usage and error information. 665// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/EnableAlarmActions 666func (c *CloudWatch) EnableAlarmActions(input *EnableAlarmActionsInput) (*EnableAlarmActionsOutput, error) { 667 req, out := c.EnableAlarmActionsRequest(input) 668 return out, req.Send() 669} 670 671// EnableAlarmActionsWithContext is the same as EnableAlarmActions with the addition of 672// the ability to pass a context and additional request options. 673// 674// See EnableAlarmActions for details on how to use this API operation. 675// 676// The context must be non-nil and will be used for request cancellation. If 677// the context is nil a panic will occur. In the future the SDK may create 678// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 679// for more information on using Contexts. 680func (c *CloudWatch) EnableAlarmActionsWithContext(ctx aws.Context, input *EnableAlarmActionsInput, opts ...request.Option) (*EnableAlarmActionsOutput, error) { 681 req, out := c.EnableAlarmActionsRequest(input) 682 req.SetContext(ctx) 683 req.ApplyOptions(opts...) 684 return out, req.Send() 685} 686 687const opGetDashboard = "GetDashboard" 688 689// GetDashboardRequest generates a "aws/request.Request" representing the 690// client's request for the GetDashboard operation. The "output" return 691// value will be populated with the request's response once the request complets 692// successfuly. 693// 694// Use "Send" method on the returned Request to send the API call to the service. 695// the "output" return value is not valid until after Send returns without error. 696// 697// See GetDashboard for more information on using the GetDashboard 698// API call, and error handling. 699// 700// This method is useful when you want to inject custom logic or configuration 701// into the SDK's request lifecycle. Such as custom headers, or retry logic. 702// 703// 704// // Example sending a request using the GetDashboardRequest method. 705// req, resp := client.GetDashboardRequest(params) 706// 707// err := req.Send() 708// if err == nil { // resp is now filled 709// fmt.Println(resp) 710// } 711// 712// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetDashboard 713func (c *CloudWatch) GetDashboardRequest(input *GetDashboardInput) (req *request.Request, output *GetDashboardOutput) { 714 op := &request.Operation{ 715 Name: opGetDashboard, 716 HTTPMethod: "POST", 717 HTTPPath: "/", 718 } 719 720 if input == nil { 721 input = &GetDashboardInput{} 722 } 723 724 output = &GetDashboardOutput{} 725 req = c.newRequest(op, input, output) 726 return 727} 728 729// GetDashboard API operation for Amazon CloudWatch. 730// 731// Displays the details of the dashboard that you specify. 732// 733// To copy an existing dashboard, use GetDashboard, and then use the data returned 734// within DashboardBody as the template for the new dashboard when you call 735// PutDashboard to create the copy. 736// 737// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 738// with awserr.Error's Code and Message methods to get detailed information about 739// the error. 740// 741// See the AWS API reference guide for Amazon CloudWatch's 742// API operation GetDashboard for usage and error information. 743// 744// Returned Error Codes: 745// * ErrCodeInvalidParameterValueException "InvalidParameterValue" 746// The value of an input parameter is bad or out-of-range. 747// 748// * ErrCodeDashboardNotFoundError "ResourceNotFound" 749// The specified dashboard does not exist. 750// 751// * ErrCodeInternalServiceFault "InternalServiceError" 752// Request processing has failed due to some unknown error, exception, or failure. 753// 754// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetDashboard 755func (c *CloudWatch) GetDashboard(input *GetDashboardInput) (*GetDashboardOutput, error) { 756 req, out := c.GetDashboardRequest(input) 757 return out, req.Send() 758} 759 760// GetDashboardWithContext is the same as GetDashboard with the addition of 761// the ability to pass a context and additional request options. 762// 763// See GetDashboard for details on how to use this API operation. 764// 765// The context must be non-nil and will be used for request cancellation. If 766// the context is nil a panic will occur. In the future the SDK may create 767// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 768// for more information on using Contexts. 769func (c *CloudWatch) GetDashboardWithContext(ctx aws.Context, input *GetDashboardInput, opts ...request.Option) (*GetDashboardOutput, error) { 770 req, out := c.GetDashboardRequest(input) 771 req.SetContext(ctx) 772 req.ApplyOptions(opts...) 773 return out, req.Send() 774} 775 776const opGetMetricStatistics = "GetMetricStatistics" 777 778// GetMetricStatisticsRequest generates a "aws/request.Request" representing the 779// client's request for the GetMetricStatistics operation. The "output" return 780// value will be populated with the request's response once the request complets 781// successfuly. 782// 783// Use "Send" method on the returned Request to send the API call to the service. 784// the "output" return value is not valid until after Send returns without error. 785// 786// See GetMetricStatistics for more information on using the GetMetricStatistics 787// API call, and error handling. 788// 789// This method is useful when you want to inject custom logic or configuration 790// into the SDK's request lifecycle. Such as custom headers, or retry logic. 791// 792// 793// // Example sending a request using the GetMetricStatisticsRequest method. 794// req, resp := client.GetMetricStatisticsRequest(params) 795// 796// err := req.Send() 797// if err == nil { // resp is now filled 798// fmt.Println(resp) 799// } 800// 801// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetMetricStatistics 802func (c *CloudWatch) GetMetricStatisticsRequest(input *GetMetricStatisticsInput) (req *request.Request, output *GetMetricStatisticsOutput) { 803 op := &request.Operation{ 804 Name: opGetMetricStatistics, 805 HTTPMethod: "POST", 806 HTTPPath: "/", 807 } 808 809 if input == nil { 810 input = &GetMetricStatisticsInput{} 811 } 812 813 output = &GetMetricStatisticsOutput{} 814 req = c.newRequest(op, input, output) 815 return 816} 817 818// GetMetricStatistics API operation for Amazon CloudWatch. 819// 820// Gets statistics for the specified metric. 821// 822// The maximum number of data points returned from a single call is 1,440. If 823// you request more than 1,440 data points, CloudWatch returns an error. To 824// reduce the number of data points, you can narrow the specified time range 825// and make multiple requests across adjacent time ranges, or you can increase 826// the specified period. Data points are not returned in chronological order. 827// 828// CloudWatch aggregates data points based on the length of the period that 829// you specify. For example, if you request statistics with a one-hour period, 830// CloudWatch aggregates all data points with time stamps that fall within each 831// one-hour period. Therefore, the number of values aggregated by CloudWatch 832// is larger than the number of data points returned. 833// 834// CloudWatch needs raw data points to calculate percentile statistics. If you 835// publish data using a statistic set instead, you can only retrieve percentile 836// statistics for this data if one of the following conditions is true: 837// 838// * The SampleCount value of the statistic set is 1. 839// 840// * The Min and the Max values of the statistic set are equal. 841// 842// Amazon CloudWatch retains metric data as follows: 843// 844// * Data points with a period of less than 60 seconds are available for 845// 3 hours. These data points are high-resolution metrics and are available 846// only for custom metrics that have been defined with a StorageResolution 847// of 1. 848// 849// * Data points with a period of 60 seconds (1-minute) are available for 850// 15 days. 851// 852// * Data points with a period of 300 seconds (5-minute) are available for 853// 63 days. 854// 855// * Data points with a period of 3600 seconds (1 hour) are available for 856// 455 days (15 months). 857// 858// Data points that are initially published with a shorter period are aggregated 859// together for long-term storage. For example, if you collect data using a 860// period of 1 minute, the data remains available for 15 days with 1-minute 861// resolution. After 15 days, this data is still available, but is aggregated 862// and retrievable only with a resolution of 5 minutes. After 63 days, the data 863// is further aggregated and is available with a resolution of 1 hour. 864// 865// CloudWatch started retaining 5-minute and 1-hour metric data as of July 9, 866// 2016. 867// 868// For information about metrics and dimensions supported by AWS services, see 869// the Amazon CloudWatch Metrics and Dimensions Reference (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CW_Support_For_AWS.html) 870// in the Amazon CloudWatch User Guide. 871// 872// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 873// with awserr.Error's Code and Message methods to get detailed information about 874// the error. 875// 876// See the AWS API reference guide for Amazon CloudWatch's 877// API operation GetMetricStatistics for usage and error information. 878// 879// Returned Error Codes: 880// * ErrCodeInvalidParameterValueException "InvalidParameterValue" 881// The value of an input parameter is bad or out-of-range. 882// 883// * ErrCodeMissingRequiredParameterException "MissingParameter" 884// An input parameter that is required is missing. 885// 886// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" 887// Parameters were used together that cannot be used together. 888// 889// * ErrCodeInternalServiceFault "InternalServiceError" 890// Request processing has failed due to some unknown error, exception, or failure. 891// 892// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetMetricStatistics 893func (c *CloudWatch) GetMetricStatistics(input *GetMetricStatisticsInput) (*GetMetricStatisticsOutput, error) { 894 req, out := c.GetMetricStatisticsRequest(input) 895 return out, req.Send() 896} 897 898// GetMetricStatisticsWithContext is the same as GetMetricStatistics with the addition of 899// the ability to pass a context and additional request options. 900// 901// See GetMetricStatistics for details on how to use this API operation. 902// 903// The context must be non-nil and will be used for request cancellation. If 904// the context is nil a panic will occur. In the future the SDK may create 905// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 906// for more information on using Contexts. 907func (c *CloudWatch) GetMetricStatisticsWithContext(ctx aws.Context, input *GetMetricStatisticsInput, opts ...request.Option) (*GetMetricStatisticsOutput, error) { 908 req, out := c.GetMetricStatisticsRequest(input) 909 req.SetContext(ctx) 910 req.ApplyOptions(opts...) 911 return out, req.Send() 912} 913 914const opListDashboards = "ListDashboards" 915 916// ListDashboardsRequest generates a "aws/request.Request" representing the 917// client's request for the ListDashboards operation. The "output" return 918// value will be populated with the request's response once the request complets 919// successfuly. 920// 921// Use "Send" method on the returned Request to send the API call to the service. 922// the "output" return value is not valid until after Send returns without error. 923// 924// See ListDashboards for more information on using the ListDashboards 925// API call, and error handling. 926// 927// This method is useful when you want to inject custom logic or configuration 928// into the SDK's request lifecycle. Such as custom headers, or retry logic. 929// 930// 931// // Example sending a request using the ListDashboardsRequest method. 932// req, resp := client.ListDashboardsRequest(params) 933// 934// err := req.Send() 935// if err == nil { // resp is now filled 936// fmt.Println(resp) 937// } 938// 939// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListDashboards 940func (c *CloudWatch) ListDashboardsRequest(input *ListDashboardsInput) (req *request.Request, output *ListDashboardsOutput) { 941 op := &request.Operation{ 942 Name: opListDashboards, 943 HTTPMethod: "POST", 944 HTTPPath: "/", 945 } 946 947 if input == nil { 948 input = &ListDashboardsInput{} 949 } 950 951 output = &ListDashboardsOutput{} 952 req = c.newRequest(op, input, output) 953 return 954} 955 956// ListDashboards API operation for Amazon CloudWatch. 957// 958// Returns a list of the dashboards for your account. If you include DashboardNamePrefix, 959// only those dashboards with names starting with the prefix are listed. Otherwise, 960// all dashboards in your account are listed. 961// 962// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 963// with awserr.Error's Code and Message methods to get detailed information about 964// the error. 965// 966// See the AWS API reference guide for Amazon CloudWatch's 967// API operation ListDashboards for usage and error information. 968// 969// Returned Error Codes: 970// * ErrCodeInvalidParameterValueException "InvalidParameterValue" 971// The value of an input parameter is bad or out-of-range. 972// 973// * ErrCodeInternalServiceFault "InternalServiceError" 974// Request processing has failed due to some unknown error, exception, or failure. 975// 976// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListDashboards 977func (c *CloudWatch) ListDashboards(input *ListDashboardsInput) (*ListDashboardsOutput, error) { 978 req, out := c.ListDashboardsRequest(input) 979 return out, req.Send() 980} 981 982// ListDashboardsWithContext is the same as ListDashboards with the addition of 983// the ability to pass a context and additional request options. 984// 985// See ListDashboards for details on how to use this API operation. 986// 987// The context must be non-nil and will be used for request cancellation. If 988// the context is nil a panic will occur. In the future the SDK may create 989// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 990// for more information on using Contexts. 991func (c *CloudWatch) ListDashboardsWithContext(ctx aws.Context, input *ListDashboardsInput, opts ...request.Option) (*ListDashboardsOutput, error) { 992 req, out := c.ListDashboardsRequest(input) 993 req.SetContext(ctx) 994 req.ApplyOptions(opts...) 995 return out, req.Send() 996} 997 998const opListMetrics = "ListMetrics" 999 1000// ListMetricsRequest generates a "aws/request.Request" representing the 1001// client's request for the ListMetrics operation. The "output" return 1002// value will be populated with the request's response once the request complets 1003// successfuly. 1004// 1005// Use "Send" method on the returned Request to send the API call to the service. 1006// the "output" return value is not valid until after Send returns without error. 1007// 1008// See ListMetrics for more information on using the ListMetrics 1009// API call, and error handling. 1010// 1011// This method is useful when you want to inject custom logic or configuration 1012// into the SDK's request lifecycle. Such as custom headers, or retry logic. 1013// 1014// 1015// // Example sending a request using the ListMetricsRequest method. 1016// req, resp := client.ListMetricsRequest(params) 1017// 1018// err := req.Send() 1019// if err == nil { // resp is now filled 1020// fmt.Println(resp) 1021// } 1022// 1023// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListMetrics 1024func (c *CloudWatch) ListMetricsRequest(input *ListMetricsInput) (req *request.Request, output *ListMetricsOutput) { 1025 op := &request.Operation{ 1026 Name: opListMetrics, 1027 HTTPMethod: "POST", 1028 HTTPPath: "/", 1029 Paginator: &request.Paginator{ 1030 InputTokens: []string{"NextToken"}, 1031 OutputTokens: []string{"NextToken"}, 1032 LimitToken: "", 1033 TruncationToken: "", 1034 }, 1035 } 1036 1037 if input == nil { 1038 input = &ListMetricsInput{} 1039 } 1040 1041 output = &ListMetricsOutput{} 1042 req = c.newRequest(op, input, output) 1043 return 1044} 1045 1046// ListMetrics API operation for Amazon CloudWatch. 1047// 1048// List the specified metrics. You can use the returned metrics with GetMetricStatistics 1049// to obtain statistical data. 1050// 1051// Up to 500 results are returned for any one call. To retrieve additional results, 1052// use the returned token with subsequent calls. 1053// 1054// After you create a metric, allow up to fifteen minutes before the metric 1055// appears. Statistics about the metric, however, are available sooner using 1056// GetMetricStatistics. 1057// 1058// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1059// with awserr.Error's Code and Message methods to get detailed information about 1060// the error. 1061// 1062// See the AWS API reference guide for Amazon CloudWatch's 1063// API operation ListMetrics for usage and error information. 1064// 1065// Returned Error Codes: 1066// * ErrCodeInternalServiceFault "InternalServiceError" 1067// Request processing has failed due to some unknown error, exception, or failure. 1068// 1069// * ErrCodeInvalidParameterValueException "InvalidParameterValue" 1070// The value of an input parameter is bad or out-of-range. 1071// 1072// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListMetrics 1073func (c *CloudWatch) ListMetrics(input *ListMetricsInput) (*ListMetricsOutput, error) { 1074 req, out := c.ListMetricsRequest(input) 1075 return out, req.Send() 1076} 1077 1078// ListMetricsWithContext is the same as ListMetrics with the addition of 1079// the ability to pass a context and additional request options. 1080// 1081// See ListMetrics for details on how to use this API operation. 1082// 1083// The context must be non-nil and will be used for request cancellation. If 1084// the context is nil a panic will occur. In the future the SDK may create 1085// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1086// for more information on using Contexts. 1087func (c *CloudWatch) ListMetricsWithContext(ctx aws.Context, input *ListMetricsInput, opts ...request.Option) (*ListMetricsOutput, error) { 1088 req, out := c.ListMetricsRequest(input) 1089 req.SetContext(ctx) 1090 req.ApplyOptions(opts...) 1091 return out, req.Send() 1092} 1093 1094// ListMetricsPages iterates over the pages of a ListMetrics operation, 1095// calling the "fn" function with the response data for each page. To stop 1096// iterating, return false from the fn function. 1097// 1098// See ListMetrics method for more information on how to use this operation. 1099// 1100// Note: This operation can generate multiple requests to a service. 1101// 1102// // Example iterating over at most 3 pages of a ListMetrics operation. 1103// pageNum := 0 1104// err := client.ListMetricsPages(params, 1105// func(page *ListMetricsOutput, lastPage bool) bool { 1106// pageNum++ 1107// fmt.Println(page) 1108// return pageNum <= 3 1109// }) 1110// 1111func (c *CloudWatch) ListMetricsPages(input *ListMetricsInput, fn func(*ListMetricsOutput, bool) bool) error { 1112 return c.ListMetricsPagesWithContext(aws.BackgroundContext(), input, fn) 1113} 1114 1115// ListMetricsPagesWithContext same as ListMetricsPages except 1116// it takes a Context and allows setting request options on the pages. 1117// 1118// The context must be non-nil and will be used for request cancellation. If 1119// the context is nil a panic will occur. In the future the SDK may create 1120// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1121// for more information on using Contexts. 1122func (c *CloudWatch) ListMetricsPagesWithContext(ctx aws.Context, input *ListMetricsInput, fn func(*ListMetricsOutput, bool) bool, opts ...request.Option) error { 1123 p := request.Pagination{ 1124 NewRequest: func() (*request.Request, error) { 1125 var inCpy *ListMetricsInput 1126 if input != nil { 1127 tmp := *input 1128 inCpy = &tmp 1129 } 1130 req, _ := c.ListMetricsRequest(inCpy) 1131 req.SetContext(ctx) 1132 req.ApplyOptions(opts...) 1133 return req, nil 1134 }, 1135 } 1136 1137 cont := true 1138 for p.Next() && cont { 1139 cont = fn(p.Page().(*ListMetricsOutput), !p.HasNextPage()) 1140 } 1141 return p.Err() 1142} 1143 1144const opPutDashboard = "PutDashboard" 1145 1146// PutDashboardRequest generates a "aws/request.Request" representing the 1147// client's request for the PutDashboard operation. The "output" return 1148// value will be populated with the request's response once the request complets 1149// successfuly. 1150// 1151// Use "Send" method on the returned Request to send the API call to the service. 1152// the "output" return value is not valid until after Send returns without error. 1153// 1154// See PutDashboard for more information on using the PutDashboard 1155// API call, and error handling. 1156// 1157// This method is useful when you want to inject custom logic or configuration 1158// into the SDK's request lifecycle. Such as custom headers, or retry logic. 1159// 1160// 1161// // Example sending a request using the PutDashboardRequest method. 1162// req, resp := client.PutDashboardRequest(params) 1163// 1164// err := req.Send() 1165// if err == nil { // resp is now filled 1166// fmt.Println(resp) 1167// } 1168// 1169// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutDashboard 1170func (c *CloudWatch) PutDashboardRequest(input *PutDashboardInput) (req *request.Request, output *PutDashboardOutput) { 1171 op := &request.Operation{ 1172 Name: opPutDashboard, 1173 HTTPMethod: "POST", 1174 HTTPPath: "/", 1175 } 1176 1177 if input == nil { 1178 input = &PutDashboardInput{} 1179 } 1180 1181 output = &PutDashboardOutput{} 1182 req = c.newRequest(op, input, output) 1183 return 1184} 1185 1186// PutDashboard API operation for Amazon CloudWatch. 1187// 1188// Creates a dashboard if it does not already exist, or updates an existing 1189// dashboard. If you update a dashboard, the entire contents are replaced with 1190// what you specify here. 1191// 1192// You can have up to 500 dashboards per account. All dashboards in your account 1193// are global, not region-specific. 1194// 1195// A simple way to create a dashboard using PutDashboard is to copy an existing 1196// dashboard. To copy an existing dashboard using the console, you can load 1197// the dashboard and then use the View/edit source command in the Actions menu 1198// to display the JSON block for that dashboard. Another way to copy a dashboard 1199// is to use GetDashboard, and then use the data returned within DashboardBody 1200// as the template for the new dashboard when you call PutDashboard. 1201// 1202// When you create a dashboard with PutDashboard, a good practice is to add 1203// a text widget at the top of the dashboard with a message that the dashboard 1204// was created by script and should not be changed in the console. This message 1205// could also point console users to the location of the DashboardBody script 1206// or the CloudFormation template used to create the dashboard. 1207// 1208// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1209// with awserr.Error's Code and Message methods to get detailed information about 1210// the error. 1211// 1212// See the AWS API reference guide for Amazon CloudWatch's 1213// API operation PutDashboard for usage and error information. 1214// 1215// Returned Error Codes: 1216// * ErrCodeDashboardInvalidInputError "InvalidParameterInput" 1217// Some part of the dashboard data is invalid. 1218// 1219// * ErrCodeInternalServiceFault "InternalServiceError" 1220// Request processing has failed due to some unknown error, exception, or failure. 1221// 1222// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutDashboard 1223func (c *CloudWatch) PutDashboard(input *PutDashboardInput) (*PutDashboardOutput, error) { 1224 req, out := c.PutDashboardRequest(input) 1225 return out, req.Send() 1226} 1227 1228// PutDashboardWithContext is the same as PutDashboard with the addition of 1229// the ability to pass a context and additional request options. 1230// 1231// See PutDashboard for details on how to use this API operation. 1232// 1233// The context must be non-nil and will be used for request cancellation. If 1234// the context is nil a panic will occur. In the future the SDK may create 1235// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1236// for more information on using Contexts. 1237func (c *CloudWatch) PutDashboardWithContext(ctx aws.Context, input *PutDashboardInput, opts ...request.Option) (*PutDashboardOutput, error) { 1238 req, out := c.PutDashboardRequest(input) 1239 req.SetContext(ctx) 1240 req.ApplyOptions(opts...) 1241 return out, req.Send() 1242} 1243 1244const opPutMetricAlarm = "PutMetricAlarm" 1245 1246// PutMetricAlarmRequest generates a "aws/request.Request" representing the 1247// client's request for the PutMetricAlarm operation. The "output" return 1248// value will be populated with the request's response once the request complets 1249// successfuly. 1250// 1251// Use "Send" method on the returned Request to send the API call to the service. 1252// the "output" return value is not valid until after Send returns without error. 1253// 1254// See PutMetricAlarm for more information on using the PutMetricAlarm 1255// API call, and error handling. 1256// 1257// This method is useful when you want to inject custom logic or configuration 1258// into the SDK's request lifecycle. Such as custom headers, or retry logic. 1259// 1260// 1261// // Example sending a request using the PutMetricAlarmRequest method. 1262// req, resp := client.PutMetricAlarmRequest(params) 1263// 1264// err := req.Send() 1265// if err == nil { // resp is now filled 1266// fmt.Println(resp) 1267// } 1268// 1269// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricAlarm 1270func (c *CloudWatch) PutMetricAlarmRequest(input *PutMetricAlarmInput) (req *request.Request, output *PutMetricAlarmOutput) { 1271 op := &request.Operation{ 1272 Name: opPutMetricAlarm, 1273 HTTPMethod: "POST", 1274 HTTPPath: "/", 1275 } 1276 1277 if input == nil { 1278 input = &PutMetricAlarmInput{} 1279 } 1280 1281 output = &PutMetricAlarmOutput{} 1282 req = c.newRequest(op, input, output) 1283 req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) 1284 req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) 1285 return 1286} 1287 1288// PutMetricAlarm API operation for Amazon CloudWatch. 1289// 1290// Creates or updates an alarm and associates it with the specified metric. 1291// Optionally, this operation can associate one or more Amazon SNS resources 1292// with the alarm. 1293// 1294// When this operation creates an alarm, the alarm state is immediately set 1295// to INSUFFICIENT_DATA. The alarm is evaluated and its state is set appropriately. 1296// Any actions associated with the state are then executed. 1297// 1298// When you update an existing alarm, its state is left unchanged, but the update 1299// completely overwrites the previous configuration of the alarm. 1300// 1301// If you are an IAM user, you must have Amazon EC2 permissions for some operations: 1302// 1303// * ec2:DescribeInstanceStatus and ec2:DescribeInstances for all alarms 1304// on EC2 instance status metrics 1305// 1306// * ec2:StopInstances for alarms with stop actions 1307// 1308// * ec2:TerminateInstances for alarms with terminate actions 1309// 1310// * ec2:DescribeInstanceRecoveryAttribute and ec2:RecoverInstances for alarms 1311// with recover actions 1312// 1313// If you have read/write permissions for Amazon CloudWatch but not for Amazon 1314// EC2, you can still create an alarm, but the stop or terminate actions are 1315// not performed. However, if you are later granted the required permissions, 1316// the alarm actions that you created earlier are performed. 1317// 1318// If you are using an IAM role (for example, an EC2 instance profile), you 1319// cannot stop or terminate the instance using alarm actions. However, you can 1320// still see the alarm state and perform any other actions such as Amazon SNS 1321// notifications or Auto Scaling policies. 1322// 1323// If you are using temporary security credentials granted using AWS STS, you 1324// cannot stop or terminate an EC2 instance using alarm actions. 1325// 1326// You must create at least one stop, terminate, or reboot alarm using either 1327// the Amazon EC2 or CloudWatch consoles to create the EC2ActionsAccess IAM 1328// role. After this IAM role is created, you can create stop, terminate, or 1329// reboot alarms using a command-line interface or API. 1330// 1331// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1332// with awserr.Error's Code and Message methods to get detailed information about 1333// the error. 1334// 1335// See the AWS API reference guide for Amazon CloudWatch's 1336// API operation PutMetricAlarm for usage and error information. 1337// 1338// Returned Error Codes: 1339// * ErrCodeLimitExceededFault "LimitExceeded" 1340// The quota for alarms for this customer has already been reached. 1341// 1342// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricAlarm 1343func (c *CloudWatch) PutMetricAlarm(input *PutMetricAlarmInput) (*PutMetricAlarmOutput, error) { 1344 req, out := c.PutMetricAlarmRequest(input) 1345 return out, req.Send() 1346} 1347 1348// PutMetricAlarmWithContext is the same as PutMetricAlarm with the addition of 1349// the ability to pass a context and additional request options. 1350// 1351// See PutMetricAlarm for details on how to use this API operation. 1352// 1353// The context must be non-nil and will be used for request cancellation. If 1354// the context is nil a panic will occur. In the future the SDK may create 1355// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1356// for more information on using Contexts. 1357func (c *CloudWatch) PutMetricAlarmWithContext(ctx aws.Context, input *PutMetricAlarmInput, opts ...request.Option) (*PutMetricAlarmOutput, error) { 1358 req, out := c.PutMetricAlarmRequest(input) 1359 req.SetContext(ctx) 1360 req.ApplyOptions(opts...) 1361 return out, req.Send() 1362} 1363 1364const opPutMetricData = "PutMetricData" 1365 1366// PutMetricDataRequest generates a "aws/request.Request" representing the 1367// client's request for the PutMetricData operation. The "output" return 1368// value will be populated with the request's response once the request complets 1369// successfuly. 1370// 1371// Use "Send" method on the returned Request to send the API call to the service. 1372// the "output" return value is not valid until after Send returns without error. 1373// 1374// See PutMetricData for more information on using the PutMetricData 1375// API call, and error handling. 1376// 1377// This method is useful when you want to inject custom logic or configuration 1378// into the SDK's request lifecycle. Such as custom headers, or retry logic. 1379// 1380// 1381// // Example sending a request using the PutMetricDataRequest method. 1382// req, resp := client.PutMetricDataRequest(params) 1383// 1384// err := req.Send() 1385// if err == nil { // resp is now filled 1386// fmt.Println(resp) 1387// } 1388// 1389// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricData 1390func (c *CloudWatch) PutMetricDataRequest(input *PutMetricDataInput) (req *request.Request, output *PutMetricDataOutput) { 1391 op := &request.Operation{ 1392 Name: opPutMetricData, 1393 HTTPMethod: "POST", 1394 HTTPPath: "/", 1395 } 1396 1397 if input == nil { 1398 input = &PutMetricDataInput{} 1399 } 1400 1401 output = &PutMetricDataOutput{} 1402 req = c.newRequest(op, input, output) 1403 req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) 1404 req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) 1405 return 1406} 1407 1408// PutMetricData API operation for Amazon CloudWatch. 1409// 1410// Publishes metric data points to Amazon CloudWatch. CloudWatch associates 1411// the data points with the specified metric. If the specified metric does not 1412// exist, CloudWatch creates the metric. When CloudWatch creates a metric, it 1413// can take up to fifteen minutes for the metric to appear in calls to ListMetrics. 1414// 1415// Each PutMetricData request is limited to 40 KB in size for HTTP POST requests. 1416// 1417// Although the Value parameter accepts numbers of type Double, CloudWatch rejects 1418// values that are either too small or too large. Values must be in the range 1419// of 8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base 2). 1420// In addition, special values (for example, NaN, +Infinity, -Infinity) are 1421// not supported. 1422// 1423// You can use up to 10 dimensions per metric to further clarify what data the 1424// metric collects. For more information about specifying dimensions, see Publishing 1425// Metrics (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html) 1426// in the Amazon CloudWatch User Guide. 1427// 1428// Data points with time stamps from 24 hours ago or longer can take at least 1429// 48 hours to become available for GetMetricStatistics from the time they are 1430// submitted. 1431// 1432// CloudWatch needs raw data points to calculate percentile statistics. If you 1433// publish data using a statistic set instead, you can only retrieve percentile 1434// statistics for this data if one of the following conditions is true: 1435// 1436// * The SampleCount value of the statistic set is 1 1437// 1438// * The Min and the Max values of the statistic set are equal 1439// 1440// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1441// with awserr.Error's Code and Message methods to get detailed information about 1442// the error. 1443// 1444// See the AWS API reference guide for Amazon CloudWatch's 1445// API operation PutMetricData for usage and error information. 1446// 1447// Returned Error Codes: 1448// * ErrCodeInvalidParameterValueException "InvalidParameterValue" 1449// The value of an input parameter is bad or out-of-range. 1450// 1451// * ErrCodeMissingRequiredParameterException "MissingParameter" 1452// An input parameter that is required is missing. 1453// 1454// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" 1455// Parameters were used together that cannot be used together. 1456// 1457// * ErrCodeInternalServiceFault "InternalServiceError" 1458// Request processing has failed due to some unknown error, exception, or failure. 1459// 1460// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricData 1461func (c *CloudWatch) PutMetricData(input *PutMetricDataInput) (*PutMetricDataOutput, error) { 1462 req, out := c.PutMetricDataRequest(input) 1463 return out, req.Send() 1464} 1465 1466// PutMetricDataWithContext is the same as PutMetricData with the addition of 1467// the ability to pass a context and additional request options. 1468// 1469// See PutMetricData for details on how to use this API operation. 1470// 1471// The context must be non-nil and will be used for request cancellation. If 1472// the context is nil a panic will occur. In the future the SDK may create 1473// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1474// for more information on using Contexts. 1475func (c *CloudWatch) PutMetricDataWithContext(ctx aws.Context, input *PutMetricDataInput, opts ...request.Option) (*PutMetricDataOutput, error) { 1476 req, out := c.PutMetricDataRequest(input) 1477 req.SetContext(ctx) 1478 req.ApplyOptions(opts...) 1479 return out, req.Send() 1480} 1481 1482const opSetAlarmState = "SetAlarmState" 1483 1484// SetAlarmStateRequest generates a "aws/request.Request" representing the 1485// client's request for the SetAlarmState operation. The "output" return 1486// value will be populated with the request's response once the request complets 1487// successfuly. 1488// 1489// Use "Send" method on the returned Request to send the API call to the service. 1490// the "output" return value is not valid until after Send returns without error. 1491// 1492// See SetAlarmState for more information on using the SetAlarmState 1493// API call, and error handling. 1494// 1495// This method is useful when you want to inject custom logic or configuration 1496// into the SDK's request lifecycle. Such as custom headers, or retry logic. 1497// 1498// 1499// // Example sending a request using the SetAlarmStateRequest method. 1500// req, resp := client.SetAlarmStateRequest(params) 1501// 1502// err := req.Send() 1503// if err == nil { // resp is now filled 1504// fmt.Println(resp) 1505// } 1506// 1507// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/SetAlarmState 1508func (c *CloudWatch) SetAlarmStateRequest(input *SetAlarmStateInput) (req *request.Request, output *SetAlarmStateOutput) { 1509 op := &request.Operation{ 1510 Name: opSetAlarmState, 1511 HTTPMethod: "POST", 1512 HTTPPath: "/", 1513 } 1514 1515 if input == nil { 1516 input = &SetAlarmStateInput{} 1517 } 1518 1519 output = &SetAlarmStateOutput{} 1520 req = c.newRequest(op, input, output) 1521 req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) 1522 req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) 1523 return 1524} 1525 1526// SetAlarmState API operation for Amazon CloudWatch. 1527// 1528// Temporarily sets the state of an alarm for testing purposes. When the updated 1529// state differs from the previous value, the action configured for the appropriate 1530// state is invoked. For example, if your alarm is configured to send an Amazon 1531// SNS message when an alarm is triggered, temporarily changing the alarm state 1532// to ALARM sends an SNS message. The alarm returns to its actual state (often 1533// within seconds). Because the alarm state change happens quickly, it is typically 1534// only visible in the alarm's History tab in the Amazon CloudWatch console 1535// or through DescribeAlarmHistory. 1536// 1537// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1538// with awserr.Error's Code and Message methods to get detailed information about 1539// the error. 1540// 1541// See the AWS API reference guide for Amazon CloudWatch's 1542// API operation SetAlarmState for usage and error information. 1543// 1544// Returned Error Codes: 1545// * ErrCodeResourceNotFound "ResourceNotFound" 1546// The named resource does not exist. 1547// 1548// * ErrCodeInvalidFormatFault "InvalidFormat" 1549// Data was not syntactically valid JSON. 1550// 1551// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/SetAlarmState 1552func (c *CloudWatch) SetAlarmState(input *SetAlarmStateInput) (*SetAlarmStateOutput, error) { 1553 req, out := c.SetAlarmStateRequest(input) 1554 return out, req.Send() 1555} 1556 1557// SetAlarmStateWithContext is the same as SetAlarmState with the addition of 1558// the ability to pass a context and additional request options. 1559// 1560// See SetAlarmState for details on how to use this API operation. 1561// 1562// The context must be non-nil and will be used for request cancellation. If 1563// the context is nil a panic will occur. In the future the SDK may create 1564// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1565// for more information on using Contexts. 1566func (c *CloudWatch) SetAlarmStateWithContext(ctx aws.Context, input *SetAlarmStateInput, opts ...request.Option) (*SetAlarmStateOutput, error) { 1567 req, out := c.SetAlarmStateRequest(input) 1568 req.SetContext(ctx) 1569 req.ApplyOptions(opts...) 1570 return out, req.Send() 1571} 1572 1573// Represents the history of a specific alarm. 1574// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/AlarmHistoryItem 1575type AlarmHistoryItem struct { 1576 _ struct{} `type:"structure"` 1577 1578 // The descriptive name for the alarm. 1579 AlarmName *string `min:"1" type:"string"` 1580 1581 // Data about the alarm, in JSON format. 1582 HistoryData *string `min:"1" type:"string"` 1583 1584 // The type of alarm history item. 1585 HistoryItemType *string `type:"string" enum:"HistoryItemType"` 1586 1587 // A summary of the alarm history, in text format. 1588 HistorySummary *string `min:"1" type:"string"` 1589 1590 // The time stamp for the alarm history item. 1591 Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` 1592} 1593 1594// String returns the string representation 1595func (s AlarmHistoryItem) String() string { 1596 return awsutil.Prettify(s) 1597} 1598 1599// GoString returns the string representation 1600func (s AlarmHistoryItem) GoString() string { 1601 return s.String() 1602} 1603 1604// SetAlarmName sets the AlarmName field's value. 1605func (s *AlarmHistoryItem) SetAlarmName(v string) *AlarmHistoryItem { 1606 s.AlarmName = &v 1607 return s 1608} 1609 1610// SetHistoryData sets the HistoryData field's value. 1611func (s *AlarmHistoryItem) SetHistoryData(v string) *AlarmHistoryItem { 1612 s.HistoryData = &v 1613 return s 1614} 1615 1616// SetHistoryItemType sets the HistoryItemType field's value. 1617func (s *AlarmHistoryItem) SetHistoryItemType(v string) *AlarmHistoryItem { 1618 s.HistoryItemType = &v 1619 return s 1620} 1621 1622// SetHistorySummary sets the HistorySummary field's value. 1623func (s *AlarmHistoryItem) SetHistorySummary(v string) *AlarmHistoryItem { 1624 s.HistorySummary = &v 1625 return s 1626} 1627 1628// SetTimestamp sets the Timestamp field's value. 1629func (s *AlarmHistoryItem) SetTimestamp(v time.Time) *AlarmHistoryItem { 1630 s.Timestamp = &v 1631 return s 1632} 1633 1634// Represents a specific dashboard. 1635// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DashboardEntry 1636type DashboardEntry struct { 1637 _ struct{} `type:"structure"` 1638 1639 // The Amazon Resource Name (ARN) of the dashboard. 1640 DashboardArn *string `type:"string"` 1641 1642 // The name of the dashboard. 1643 DashboardName *string `type:"string"` 1644 1645 // The time stamp of when the dashboard was last modified, either by an API 1646 // call or through the console. This number is expressed as the number of milliseconds 1647 // since Jan 1, 1970 00:00:00 UTC. 1648 LastModified *time.Time `type:"timestamp" timestampFormat:"iso8601"` 1649 1650 // The size of the dashboard, in bytes. 1651 Size *int64 `type:"long"` 1652} 1653 1654// String returns the string representation 1655func (s DashboardEntry) String() string { 1656 return awsutil.Prettify(s) 1657} 1658 1659// GoString returns the string representation 1660func (s DashboardEntry) GoString() string { 1661 return s.String() 1662} 1663 1664// SetDashboardArn sets the DashboardArn field's value. 1665func (s *DashboardEntry) SetDashboardArn(v string) *DashboardEntry { 1666 s.DashboardArn = &v 1667 return s 1668} 1669 1670// SetDashboardName sets the DashboardName field's value. 1671func (s *DashboardEntry) SetDashboardName(v string) *DashboardEntry { 1672 s.DashboardName = &v 1673 return s 1674} 1675 1676// SetLastModified sets the LastModified field's value. 1677func (s *DashboardEntry) SetLastModified(v time.Time) *DashboardEntry { 1678 s.LastModified = &v 1679 return s 1680} 1681 1682// SetSize sets the Size field's value. 1683func (s *DashboardEntry) SetSize(v int64) *DashboardEntry { 1684 s.Size = &v 1685 return s 1686} 1687 1688// An error or warning for the operation. 1689// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DashboardValidationMessage 1690type DashboardValidationMessage struct { 1691 _ struct{} `type:"structure"` 1692 1693 // The data path related to the message. 1694 DataPath *string `type:"string"` 1695 1696 // A message describing the error or warning. 1697 Message *string `type:"string"` 1698} 1699 1700// String returns the string representation 1701func (s DashboardValidationMessage) String() string { 1702 return awsutil.Prettify(s) 1703} 1704 1705// GoString returns the string representation 1706func (s DashboardValidationMessage) GoString() string { 1707 return s.String() 1708} 1709 1710// SetDataPath sets the DataPath field's value. 1711func (s *DashboardValidationMessage) SetDataPath(v string) *DashboardValidationMessage { 1712 s.DataPath = &v 1713 return s 1714} 1715 1716// SetMessage sets the Message field's value. 1717func (s *DashboardValidationMessage) SetMessage(v string) *DashboardValidationMessage { 1718 s.Message = &v 1719 return s 1720} 1721 1722// Encapsulates the statistical data that CloudWatch computes from metric data. 1723// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/Datapoint 1724type Datapoint struct { 1725 _ struct{} `type:"structure"` 1726 1727 // The average of the metric values that correspond to the data point. 1728 Average *float64 `type:"double"` 1729 1730 // The percentile statistic for the data point. 1731 ExtendedStatistics map[string]*float64 `type:"map"` 1732 1733 // The maximum metric value for the data point. 1734 Maximum *float64 `type:"double"` 1735 1736 // The minimum metric value for the data point. 1737 Minimum *float64 `type:"double"` 1738 1739 // The number of metric values that contributed to the aggregate value of this 1740 // data point. 1741 SampleCount *float64 `type:"double"` 1742 1743 // The sum of the metric values for the data point. 1744 Sum *float64 `type:"double"` 1745 1746 // The time stamp used for the data point. 1747 Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` 1748 1749 // The standard unit for the data point. 1750 Unit *string `type:"string" enum:"StandardUnit"` 1751} 1752 1753// String returns the string representation 1754func (s Datapoint) String() string { 1755 return awsutil.Prettify(s) 1756} 1757 1758// GoString returns the string representation 1759func (s Datapoint) GoString() string { 1760 return s.String() 1761} 1762 1763// SetAverage sets the Average field's value. 1764func (s *Datapoint) SetAverage(v float64) *Datapoint { 1765 s.Average = &v 1766 return s 1767} 1768 1769// SetExtendedStatistics sets the ExtendedStatistics field's value. 1770func (s *Datapoint) SetExtendedStatistics(v map[string]*float64) *Datapoint { 1771 s.ExtendedStatistics = v 1772 return s 1773} 1774 1775// SetMaximum sets the Maximum field's value. 1776func (s *Datapoint) SetMaximum(v float64) *Datapoint { 1777 s.Maximum = &v 1778 return s 1779} 1780 1781// SetMinimum sets the Minimum field's value. 1782func (s *Datapoint) SetMinimum(v float64) *Datapoint { 1783 s.Minimum = &v 1784 return s 1785} 1786 1787// SetSampleCount sets the SampleCount field's value. 1788func (s *Datapoint) SetSampleCount(v float64) *Datapoint { 1789 s.SampleCount = &v 1790 return s 1791} 1792 1793// SetSum sets the Sum field's value. 1794func (s *Datapoint) SetSum(v float64) *Datapoint { 1795 s.Sum = &v 1796 return s 1797} 1798 1799// SetTimestamp sets the Timestamp field's value. 1800func (s *Datapoint) SetTimestamp(v time.Time) *Datapoint { 1801 s.Timestamp = &v 1802 return s 1803} 1804 1805// SetUnit sets the Unit field's value. 1806func (s *Datapoint) SetUnit(v string) *Datapoint { 1807 s.Unit = &v 1808 return s 1809} 1810 1811// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteAlarmsInput 1812type DeleteAlarmsInput struct { 1813 _ struct{} `type:"structure"` 1814 1815 // The alarms to be deleted. 1816 // 1817 // AlarmNames is a required field 1818 AlarmNames []*string `type:"list" required:"true"` 1819} 1820 1821// String returns the string representation 1822func (s DeleteAlarmsInput) String() string { 1823 return awsutil.Prettify(s) 1824} 1825 1826// GoString returns the string representation 1827func (s DeleteAlarmsInput) GoString() string { 1828 return s.String() 1829} 1830 1831// Validate inspects the fields of the type to determine if they are valid. 1832func (s *DeleteAlarmsInput) Validate() error { 1833 invalidParams := request.ErrInvalidParams{Context: "DeleteAlarmsInput"} 1834 if s.AlarmNames == nil { 1835 invalidParams.Add(request.NewErrParamRequired("AlarmNames")) 1836 } 1837 1838 if invalidParams.Len() > 0 { 1839 return invalidParams 1840 } 1841 return nil 1842} 1843 1844// SetAlarmNames sets the AlarmNames field's value. 1845func (s *DeleteAlarmsInput) SetAlarmNames(v []*string) *DeleteAlarmsInput { 1846 s.AlarmNames = v 1847 return s 1848} 1849 1850// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteAlarmsOutput 1851type DeleteAlarmsOutput struct { 1852 _ struct{} `type:"structure"` 1853} 1854 1855// String returns the string representation 1856func (s DeleteAlarmsOutput) String() string { 1857 return awsutil.Prettify(s) 1858} 1859 1860// GoString returns the string representation 1861func (s DeleteAlarmsOutput) GoString() string { 1862 return s.String() 1863} 1864 1865// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteDashboardsInput 1866type DeleteDashboardsInput struct { 1867 _ struct{} `type:"structure"` 1868 1869 // The dashboards to be deleted. 1870 DashboardNames []*string `type:"list"` 1871} 1872 1873// String returns the string representation 1874func (s DeleteDashboardsInput) String() string { 1875 return awsutil.Prettify(s) 1876} 1877 1878// GoString returns the string representation 1879func (s DeleteDashboardsInput) GoString() string { 1880 return s.String() 1881} 1882 1883// SetDashboardNames sets the DashboardNames field's value. 1884func (s *DeleteDashboardsInput) SetDashboardNames(v []*string) *DeleteDashboardsInput { 1885 s.DashboardNames = v 1886 return s 1887} 1888 1889// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteDashboardsOutput 1890type DeleteDashboardsOutput struct { 1891 _ struct{} `type:"structure"` 1892} 1893 1894// String returns the string representation 1895func (s DeleteDashboardsOutput) String() string { 1896 return awsutil.Prettify(s) 1897} 1898 1899// GoString returns the string representation 1900func (s DeleteDashboardsOutput) GoString() string { 1901 return s.String() 1902} 1903 1904// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmHistoryInput 1905type DescribeAlarmHistoryInput struct { 1906 _ struct{} `type:"structure"` 1907 1908 // The name of the alarm. 1909 AlarmName *string `min:"1" type:"string"` 1910 1911 // The ending date to retrieve alarm history. 1912 EndDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` 1913 1914 // The type of alarm histories to retrieve. 1915 HistoryItemType *string `type:"string" enum:"HistoryItemType"` 1916 1917 // The maximum number of alarm history records to retrieve. 1918 MaxRecords *int64 `min:"1" type:"integer"` 1919 1920 // The token returned by a previous call to indicate that there is more data 1921 // available. 1922 NextToken *string `type:"string"` 1923 1924 // The starting date to retrieve alarm history. 1925 StartDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` 1926} 1927 1928// String returns the string representation 1929func (s DescribeAlarmHistoryInput) String() string { 1930 return awsutil.Prettify(s) 1931} 1932 1933// GoString returns the string representation 1934func (s DescribeAlarmHistoryInput) GoString() string { 1935 return s.String() 1936} 1937 1938// Validate inspects the fields of the type to determine if they are valid. 1939func (s *DescribeAlarmHistoryInput) Validate() error { 1940 invalidParams := request.ErrInvalidParams{Context: "DescribeAlarmHistoryInput"} 1941 if s.AlarmName != nil && len(*s.AlarmName) < 1 { 1942 invalidParams.Add(request.NewErrParamMinLen("AlarmName", 1)) 1943 } 1944 if s.MaxRecords != nil && *s.MaxRecords < 1 { 1945 invalidParams.Add(request.NewErrParamMinValue("MaxRecords", 1)) 1946 } 1947 1948 if invalidParams.Len() > 0 { 1949 return invalidParams 1950 } 1951 return nil 1952} 1953 1954// SetAlarmName sets the AlarmName field's value. 1955func (s *DescribeAlarmHistoryInput) SetAlarmName(v string) *DescribeAlarmHistoryInput { 1956 s.AlarmName = &v 1957 return s 1958} 1959 1960// SetEndDate sets the EndDate field's value. 1961func (s *DescribeAlarmHistoryInput) SetEndDate(v time.Time) *DescribeAlarmHistoryInput { 1962 s.EndDate = &v 1963 return s 1964} 1965 1966// SetHistoryItemType sets the HistoryItemType field's value. 1967func (s *DescribeAlarmHistoryInput) SetHistoryItemType(v string) *DescribeAlarmHistoryInput { 1968 s.HistoryItemType = &v 1969 return s 1970} 1971 1972// SetMaxRecords sets the MaxRecords field's value. 1973func (s *DescribeAlarmHistoryInput) SetMaxRecords(v int64) *DescribeAlarmHistoryInput { 1974 s.MaxRecords = &v 1975 return s 1976} 1977 1978// SetNextToken sets the NextToken field's value. 1979func (s *DescribeAlarmHistoryInput) SetNextToken(v string) *DescribeAlarmHistoryInput { 1980 s.NextToken = &v 1981 return s 1982} 1983 1984// SetStartDate sets the StartDate field's value. 1985func (s *DescribeAlarmHistoryInput) SetStartDate(v time.Time) *DescribeAlarmHistoryInput { 1986 s.StartDate = &v 1987 return s 1988} 1989 1990// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmHistoryOutput 1991type DescribeAlarmHistoryOutput struct { 1992 _ struct{} `type:"structure"` 1993 1994 // The alarm histories, in JSON format. 1995 AlarmHistoryItems []*AlarmHistoryItem `type:"list"` 1996 1997 // The token that marks the start of the next batch of returned results. 1998 NextToken *string `type:"string"` 1999} 2000 2001// String returns the string representation 2002func (s DescribeAlarmHistoryOutput) String() string { 2003 return awsutil.Prettify(s) 2004} 2005 2006// GoString returns the string representation 2007func (s DescribeAlarmHistoryOutput) GoString() string { 2008 return s.String() 2009} 2010 2011// SetAlarmHistoryItems sets the AlarmHistoryItems field's value. 2012func (s *DescribeAlarmHistoryOutput) SetAlarmHistoryItems(v []*AlarmHistoryItem) *DescribeAlarmHistoryOutput { 2013 s.AlarmHistoryItems = v 2014 return s 2015} 2016 2017// SetNextToken sets the NextToken field's value. 2018func (s *DescribeAlarmHistoryOutput) SetNextToken(v string) *DescribeAlarmHistoryOutput { 2019 s.NextToken = &v 2020 return s 2021} 2022 2023// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmsForMetricInput 2024type DescribeAlarmsForMetricInput struct { 2025 _ struct{} `type:"structure"` 2026 2027 // The dimensions associated with the metric. If the metric has any associated 2028 // dimensions, you must specify them in order for the call to succeed. 2029 Dimensions []*Dimension `type:"list"` 2030 2031 // The percentile statistic for the metric. Specify a value between p0.0 and 2032 // p100. 2033 ExtendedStatistic *string `type:"string"` 2034 2035 // The name of the metric. 2036 // 2037 // MetricName is a required field 2038 MetricName *string `min:"1" type:"string" required:"true"` 2039 2040 // The namespace of the metric. 2041 // 2042 // Namespace is a required field 2043 Namespace *string `min:"1" type:"string" required:"true"` 2044 2045 // The period, in seconds, over which the statistic is applied. 2046 Period *int64 `min:"1" type:"integer"` 2047 2048 // The statistic for the metric, other than percentiles. For percentile statistics, 2049 // use ExtendedStatistics. 2050 Statistic *string `type:"string" enum:"Statistic"` 2051 2052 // The unit for the metric. 2053 Unit *string `type:"string" enum:"StandardUnit"` 2054} 2055 2056// String returns the string representation 2057func (s DescribeAlarmsForMetricInput) String() string { 2058 return awsutil.Prettify(s) 2059} 2060 2061// GoString returns the string representation 2062func (s DescribeAlarmsForMetricInput) GoString() string { 2063 return s.String() 2064} 2065 2066// Validate inspects the fields of the type to determine if they are valid. 2067func (s *DescribeAlarmsForMetricInput) Validate() error { 2068 invalidParams := request.ErrInvalidParams{Context: "DescribeAlarmsForMetricInput"} 2069 if s.MetricName == nil { 2070 invalidParams.Add(request.NewErrParamRequired("MetricName")) 2071 } 2072 if s.MetricName != nil && len(*s.MetricName) < 1 { 2073 invalidParams.Add(request.NewErrParamMinLen("MetricName", 1)) 2074 } 2075 if s.Namespace == nil { 2076 invalidParams.Add(request.NewErrParamRequired("Namespace")) 2077 } 2078 if s.Namespace != nil && len(*s.Namespace) < 1 { 2079 invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) 2080 } 2081 if s.Period != nil && *s.Period < 1 { 2082 invalidParams.Add(request.NewErrParamMinValue("Period", 1)) 2083 } 2084 if s.Dimensions != nil { 2085 for i, v := range s.Dimensions { 2086 if v == nil { 2087 continue 2088 } 2089 if err := v.Validate(); err != nil { 2090 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams)) 2091 } 2092 } 2093 } 2094 2095 if invalidParams.Len() > 0 { 2096 return invalidParams 2097 } 2098 return nil 2099} 2100 2101// SetDimensions sets the Dimensions field's value. 2102func (s *DescribeAlarmsForMetricInput) SetDimensions(v []*Dimension) *DescribeAlarmsForMetricInput { 2103 s.Dimensions = v 2104 return s 2105} 2106 2107// SetExtendedStatistic sets the ExtendedStatistic field's value. 2108func (s *DescribeAlarmsForMetricInput) SetExtendedStatistic(v string) *DescribeAlarmsForMetricInput { 2109 s.ExtendedStatistic = &v 2110 return s 2111} 2112 2113// SetMetricName sets the MetricName field's value. 2114func (s *DescribeAlarmsForMetricInput) SetMetricName(v string) *DescribeAlarmsForMetricInput { 2115 s.MetricName = &v 2116 return s 2117} 2118 2119// SetNamespace sets the Namespace field's value. 2120func (s *DescribeAlarmsForMetricInput) SetNamespace(v string) *DescribeAlarmsForMetricInput { 2121 s.Namespace = &v 2122 return s 2123} 2124 2125// SetPeriod sets the Period field's value. 2126func (s *DescribeAlarmsForMetricInput) SetPeriod(v int64) *DescribeAlarmsForMetricInput { 2127 s.Period = &v 2128 return s 2129} 2130 2131// SetStatistic sets the Statistic field's value. 2132func (s *DescribeAlarmsForMetricInput) SetStatistic(v string) *DescribeAlarmsForMetricInput { 2133 s.Statistic = &v 2134 return s 2135} 2136 2137// SetUnit sets the Unit field's value. 2138func (s *DescribeAlarmsForMetricInput) SetUnit(v string) *DescribeAlarmsForMetricInput { 2139 s.Unit = &v 2140 return s 2141} 2142 2143// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmsForMetricOutput 2144type DescribeAlarmsForMetricOutput struct { 2145 _ struct{} `type:"structure"` 2146 2147 // The information for each alarm with the specified metric. 2148 MetricAlarms []*MetricAlarm `type:"list"` 2149} 2150 2151// String returns the string representation 2152func (s DescribeAlarmsForMetricOutput) String() string { 2153 return awsutil.Prettify(s) 2154} 2155 2156// GoString returns the string representation 2157func (s DescribeAlarmsForMetricOutput) GoString() string { 2158 return s.String() 2159} 2160 2161// SetMetricAlarms sets the MetricAlarms field's value. 2162func (s *DescribeAlarmsForMetricOutput) SetMetricAlarms(v []*MetricAlarm) *DescribeAlarmsForMetricOutput { 2163 s.MetricAlarms = v 2164 return s 2165} 2166 2167// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmsInput 2168type DescribeAlarmsInput struct { 2169 _ struct{} `type:"structure"` 2170 2171 // The action name prefix. 2172 ActionPrefix *string `min:"1" type:"string"` 2173 2174 // The alarm name prefix. If this parameter is specified, you cannot specify 2175 // AlarmNames. 2176 AlarmNamePrefix *string `min:"1" type:"string"` 2177 2178 // The names of the alarms. 2179 AlarmNames []*string `type:"list"` 2180 2181 // The maximum number of alarm descriptions to retrieve. 2182 MaxRecords *int64 `min:"1" type:"integer"` 2183 2184 // The token returned by a previous call to indicate that there is more data 2185 // available. 2186 NextToken *string `type:"string"` 2187 2188 // The state value to be used in matching alarms. 2189 StateValue *string `type:"string" enum:"StateValue"` 2190} 2191 2192// String returns the string representation 2193func (s DescribeAlarmsInput) String() string { 2194 return awsutil.Prettify(s) 2195} 2196 2197// GoString returns the string representation 2198func (s DescribeAlarmsInput) GoString() string { 2199 return s.String() 2200} 2201 2202// Validate inspects the fields of the type to determine if they are valid. 2203func (s *DescribeAlarmsInput) Validate() error { 2204 invalidParams := request.ErrInvalidParams{Context: "DescribeAlarmsInput"} 2205 if s.ActionPrefix != nil && len(*s.ActionPrefix) < 1 { 2206 invalidParams.Add(request.NewErrParamMinLen("ActionPrefix", 1)) 2207 } 2208 if s.AlarmNamePrefix != nil && len(*s.AlarmNamePrefix) < 1 { 2209 invalidParams.Add(request.NewErrParamMinLen("AlarmNamePrefix", 1)) 2210 } 2211 if s.MaxRecords != nil && *s.MaxRecords < 1 { 2212 invalidParams.Add(request.NewErrParamMinValue("MaxRecords", 1)) 2213 } 2214 2215 if invalidParams.Len() > 0 { 2216 return invalidParams 2217 } 2218 return nil 2219} 2220 2221// SetActionPrefix sets the ActionPrefix field's value. 2222func (s *DescribeAlarmsInput) SetActionPrefix(v string) *DescribeAlarmsInput { 2223 s.ActionPrefix = &v 2224 return s 2225} 2226 2227// SetAlarmNamePrefix sets the AlarmNamePrefix field's value. 2228func (s *DescribeAlarmsInput) SetAlarmNamePrefix(v string) *DescribeAlarmsInput { 2229 s.AlarmNamePrefix = &v 2230 return s 2231} 2232 2233// SetAlarmNames sets the AlarmNames field's value. 2234func (s *DescribeAlarmsInput) SetAlarmNames(v []*string) *DescribeAlarmsInput { 2235 s.AlarmNames = v 2236 return s 2237} 2238 2239// SetMaxRecords sets the MaxRecords field's value. 2240func (s *DescribeAlarmsInput) SetMaxRecords(v int64) *DescribeAlarmsInput { 2241 s.MaxRecords = &v 2242 return s 2243} 2244 2245// SetNextToken sets the NextToken field's value. 2246func (s *DescribeAlarmsInput) SetNextToken(v string) *DescribeAlarmsInput { 2247 s.NextToken = &v 2248 return s 2249} 2250 2251// SetStateValue sets the StateValue field's value. 2252func (s *DescribeAlarmsInput) SetStateValue(v string) *DescribeAlarmsInput { 2253 s.StateValue = &v 2254 return s 2255} 2256 2257// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmsOutput 2258type DescribeAlarmsOutput struct { 2259 _ struct{} `type:"structure"` 2260 2261 // The information for the specified alarms. 2262 MetricAlarms []*MetricAlarm `type:"list"` 2263 2264 // The token that marks the start of the next batch of returned results. 2265 NextToken *string `type:"string"` 2266} 2267 2268// String returns the string representation 2269func (s DescribeAlarmsOutput) String() string { 2270 return awsutil.Prettify(s) 2271} 2272 2273// GoString returns the string representation 2274func (s DescribeAlarmsOutput) GoString() string { 2275 return s.String() 2276} 2277 2278// SetMetricAlarms sets the MetricAlarms field's value. 2279func (s *DescribeAlarmsOutput) SetMetricAlarms(v []*MetricAlarm) *DescribeAlarmsOutput { 2280 s.MetricAlarms = v 2281 return s 2282} 2283 2284// SetNextToken sets the NextToken field's value. 2285func (s *DescribeAlarmsOutput) SetNextToken(v string) *DescribeAlarmsOutput { 2286 s.NextToken = &v 2287 return s 2288} 2289 2290// Expands the identity of a metric. 2291// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/Dimension 2292type Dimension struct { 2293 _ struct{} `type:"structure"` 2294 2295 // The name of the dimension. 2296 // 2297 // Name is a required field 2298 Name *string `min:"1" type:"string" required:"true"` 2299 2300 // The value representing the dimension measurement. 2301 // 2302 // Value is a required field 2303 Value *string `min:"1" type:"string" required:"true"` 2304} 2305 2306// String returns the string representation 2307func (s Dimension) String() string { 2308 return awsutil.Prettify(s) 2309} 2310 2311// GoString returns the string representation 2312func (s Dimension) GoString() string { 2313 return s.String() 2314} 2315 2316// Validate inspects the fields of the type to determine if they are valid. 2317func (s *Dimension) Validate() error { 2318 invalidParams := request.ErrInvalidParams{Context: "Dimension"} 2319 if s.Name == nil { 2320 invalidParams.Add(request.NewErrParamRequired("Name")) 2321 } 2322 if s.Name != nil && len(*s.Name) < 1 { 2323 invalidParams.Add(request.NewErrParamMinLen("Name", 1)) 2324 } 2325 if s.Value == nil { 2326 invalidParams.Add(request.NewErrParamRequired("Value")) 2327 } 2328 if s.Value != nil && len(*s.Value) < 1 { 2329 invalidParams.Add(request.NewErrParamMinLen("Value", 1)) 2330 } 2331 2332 if invalidParams.Len() > 0 { 2333 return invalidParams 2334 } 2335 return nil 2336} 2337 2338// SetName sets the Name field's value. 2339func (s *Dimension) SetName(v string) *Dimension { 2340 s.Name = &v 2341 return s 2342} 2343 2344// SetValue sets the Value field's value. 2345func (s *Dimension) SetValue(v string) *Dimension { 2346 s.Value = &v 2347 return s 2348} 2349 2350// Represents filters for a dimension. 2351// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DimensionFilter 2352type DimensionFilter struct { 2353 _ struct{} `type:"structure"` 2354 2355 // The dimension name to be matched. 2356 // 2357 // Name is a required field 2358 Name *string `min:"1" type:"string" required:"true"` 2359 2360 // The value of the dimension to be matched. 2361 Value *string `min:"1" type:"string"` 2362} 2363 2364// String returns the string representation 2365func (s DimensionFilter) String() string { 2366 return awsutil.Prettify(s) 2367} 2368 2369// GoString returns the string representation 2370func (s DimensionFilter) GoString() string { 2371 return s.String() 2372} 2373 2374// Validate inspects the fields of the type to determine if they are valid. 2375func (s *DimensionFilter) Validate() error { 2376 invalidParams := request.ErrInvalidParams{Context: "DimensionFilter"} 2377 if s.Name == nil { 2378 invalidParams.Add(request.NewErrParamRequired("Name")) 2379 } 2380 if s.Name != nil && len(*s.Name) < 1 { 2381 invalidParams.Add(request.NewErrParamMinLen("Name", 1)) 2382 } 2383 if s.Value != nil && len(*s.Value) < 1 { 2384 invalidParams.Add(request.NewErrParamMinLen("Value", 1)) 2385 } 2386 2387 if invalidParams.Len() > 0 { 2388 return invalidParams 2389 } 2390 return nil 2391} 2392 2393// SetName sets the Name field's value. 2394func (s *DimensionFilter) SetName(v string) *DimensionFilter { 2395 s.Name = &v 2396 return s 2397} 2398 2399// SetValue sets the Value field's value. 2400func (s *DimensionFilter) SetValue(v string) *DimensionFilter { 2401 s.Value = &v 2402 return s 2403} 2404 2405// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DisableAlarmActionsInput 2406type DisableAlarmActionsInput struct { 2407 _ struct{} `type:"structure"` 2408 2409 // The names of the alarms. 2410 // 2411 // AlarmNames is a required field 2412 AlarmNames []*string `type:"list" required:"true"` 2413} 2414 2415// String returns the string representation 2416func (s DisableAlarmActionsInput) String() string { 2417 return awsutil.Prettify(s) 2418} 2419 2420// GoString returns the string representation 2421func (s DisableAlarmActionsInput) GoString() string { 2422 return s.String() 2423} 2424 2425// Validate inspects the fields of the type to determine if they are valid. 2426func (s *DisableAlarmActionsInput) Validate() error { 2427 invalidParams := request.ErrInvalidParams{Context: "DisableAlarmActionsInput"} 2428 if s.AlarmNames == nil { 2429 invalidParams.Add(request.NewErrParamRequired("AlarmNames")) 2430 } 2431 2432 if invalidParams.Len() > 0 { 2433 return invalidParams 2434 } 2435 return nil 2436} 2437 2438// SetAlarmNames sets the AlarmNames field's value. 2439func (s *DisableAlarmActionsInput) SetAlarmNames(v []*string) *DisableAlarmActionsInput { 2440 s.AlarmNames = v 2441 return s 2442} 2443 2444// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DisableAlarmActionsOutput 2445type DisableAlarmActionsOutput struct { 2446 _ struct{} `type:"structure"` 2447} 2448 2449// String returns the string representation 2450func (s DisableAlarmActionsOutput) String() string { 2451 return awsutil.Prettify(s) 2452} 2453 2454// GoString returns the string representation 2455func (s DisableAlarmActionsOutput) GoString() string { 2456 return s.String() 2457} 2458 2459// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/EnableAlarmActionsInput 2460type EnableAlarmActionsInput struct { 2461 _ struct{} `type:"structure"` 2462 2463 // The names of the alarms. 2464 // 2465 // AlarmNames is a required field 2466 AlarmNames []*string `type:"list" required:"true"` 2467} 2468 2469// String returns the string representation 2470func (s EnableAlarmActionsInput) String() string { 2471 return awsutil.Prettify(s) 2472} 2473 2474// GoString returns the string representation 2475func (s EnableAlarmActionsInput) GoString() string { 2476 return s.String() 2477} 2478 2479// Validate inspects the fields of the type to determine if they are valid. 2480func (s *EnableAlarmActionsInput) Validate() error { 2481 invalidParams := request.ErrInvalidParams{Context: "EnableAlarmActionsInput"} 2482 if s.AlarmNames == nil { 2483 invalidParams.Add(request.NewErrParamRequired("AlarmNames")) 2484 } 2485 2486 if invalidParams.Len() > 0 { 2487 return invalidParams 2488 } 2489 return nil 2490} 2491 2492// SetAlarmNames sets the AlarmNames field's value. 2493func (s *EnableAlarmActionsInput) SetAlarmNames(v []*string) *EnableAlarmActionsInput { 2494 s.AlarmNames = v 2495 return s 2496} 2497 2498// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/EnableAlarmActionsOutput 2499type EnableAlarmActionsOutput struct { 2500 _ struct{} `type:"structure"` 2501} 2502 2503// String returns the string representation 2504func (s EnableAlarmActionsOutput) String() string { 2505 return awsutil.Prettify(s) 2506} 2507 2508// GoString returns the string representation 2509func (s EnableAlarmActionsOutput) GoString() string { 2510 return s.String() 2511} 2512 2513// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetDashboardInput 2514type GetDashboardInput struct { 2515 _ struct{} `type:"structure"` 2516 2517 // The name of the dashboard to be described. 2518 DashboardName *string `type:"string"` 2519} 2520 2521// String returns the string representation 2522func (s GetDashboardInput) String() string { 2523 return awsutil.Prettify(s) 2524} 2525 2526// GoString returns the string representation 2527func (s GetDashboardInput) GoString() string { 2528 return s.String() 2529} 2530 2531// SetDashboardName sets the DashboardName field's value. 2532func (s *GetDashboardInput) SetDashboardName(v string) *GetDashboardInput { 2533 s.DashboardName = &v 2534 return s 2535} 2536 2537// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetDashboardOutput 2538type GetDashboardOutput struct { 2539 _ struct{} `type:"structure"` 2540 2541 // The Amazon Resource Name (ARN) of the dashboard. 2542 DashboardArn *string `type:"string"` 2543 2544 // The detailed information about the dashboard, including what widgets are 2545 // included and their location on the dashboard. For more information about 2546 // the DashboardBody syntax, see CloudWatch-Dashboard-Body-Structure. 2547 DashboardBody *string `type:"string"` 2548 2549 // The name of the dashboard. 2550 DashboardName *string `type:"string"` 2551} 2552 2553// String returns the string representation 2554func (s GetDashboardOutput) String() string { 2555 return awsutil.Prettify(s) 2556} 2557 2558// GoString returns the string representation 2559func (s GetDashboardOutput) GoString() string { 2560 return s.String() 2561} 2562 2563// SetDashboardArn sets the DashboardArn field's value. 2564func (s *GetDashboardOutput) SetDashboardArn(v string) *GetDashboardOutput { 2565 s.DashboardArn = &v 2566 return s 2567} 2568 2569// SetDashboardBody sets the DashboardBody field's value. 2570func (s *GetDashboardOutput) SetDashboardBody(v string) *GetDashboardOutput { 2571 s.DashboardBody = &v 2572 return s 2573} 2574 2575// SetDashboardName sets the DashboardName field's value. 2576func (s *GetDashboardOutput) SetDashboardName(v string) *GetDashboardOutput { 2577 s.DashboardName = &v 2578 return s 2579} 2580 2581// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetMetricStatisticsInput 2582type GetMetricStatisticsInput struct { 2583 _ struct{} `type:"structure"` 2584 2585 // The dimensions. If the metric contains multiple dimensions, you must include 2586 // a value for each dimension. CloudWatch treats each unique combination of 2587 // dimensions as a separate metric. If a specific combination of dimensions 2588 // was not published, you can't retrieve statistics for it. You must specify 2589 // the same dimensions that were used when the metrics were created. For an 2590 // example, see Dimension Combinations (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#dimension-combinations) 2591 // in the Amazon CloudWatch User Guide. For more information about specifying 2592 // dimensions, see Publishing Metrics (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html) 2593 // in the Amazon CloudWatch User Guide. 2594 Dimensions []*Dimension `type:"list"` 2595 2596 // The time stamp that determines the last data point to return. 2597 // 2598 // The value specified is exclusive; results include data points up to the specified 2599 // time stamp. The time stamp must be in ISO 8601 UTC format (for example, 2016-10-10T23:00:00Z). 2600 // 2601 // EndTime is a required field 2602 EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` 2603 2604 // The percentile statistics. Specify values between p0.0 and p100. When calling 2605 // GetMetricStatistics, you must specify either Statistics or ExtendedStatistics, 2606 // but not both. 2607 ExtendedStatistics []*string `min:"1" type:"list"` 2608 2609 // The name of the metric, with or without spaces. 2610 // 2611 // MetricName is a required field 2612 MetricName *string `min:"1" type:"string" required:"true"` 2613 2614 // The namespace of the metric, with or without spaces. 2615 // 2616 // Namespace is a required field 2617 Namespace *string `min:"1" type:"string" required:"true"` 2618 2619 // The granularity, in seconds, of the returned data points. For metrics with 2620 // regular resolution, a period can be as short as one minute (60 seconds) and 2621 // must be a multiple of 60. For high-resolution metrics that are collected 2622 // at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, 2623 // or any multiple of 60. High-resolution metrics are those metrics stored by 2624 // a PutMetricData call that includes a StorageResolution of 1 second. 2625 // 2626 // If the StartTime parameter specifies a time stamp that is greater than 3 2627 // hours ago, you must specify the period as follows or no data points in that 2628 // time range is returned: 2629 // 2630 // * Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds 2631 // (1 minute). 2632 // 2633 // * Start time between 15 and 63 days ago - Use a multiple of 300 seconds 2634 // (5 minutes). 2635 // 2636 // * Start time greater than 63 days ago - Use a multiple of 3600 seconds 2637 // (1 hour). 2638 // 2639 // Period is a required field 2640 Period *int64 `min:"1" type:"integer" required:"true"` 2641 2642 // The time stamp that determines the first data point to return. Start times 2643 // are evaluated relative to the time that CloudWatch receives the request. 2644 // 2645 // The value specified is inclusive; results include data points with the specified 2646 // time stamp. The time stamp must be in ISO 8601 UTC format (for example, 2016-10-03T23:00:00Z). 2647 // 2648 // CloudWatch rounds the specified time stamp as follows: 2649 // 2650 // * Start time less than 15 days ago - Round down to the nearest whole minute. 2651 // For example, 12:32:34 is rounded down to 12:32:00. 2652 // 2653 // * Start time between 15 and 63 days ago - Round down to the nearest 5-minute 2654 // clock interval. For example, 12:32:34 is rounded down to 12:30:00. 2655 // 2656 // * Start time greater than 63 days ago - Round down to the nearest 1-hour 2657 // clock interval. For example, 12:32:34 is rounded down to 12:00:00. 2658 // 2659 // If you set Period to 5, 10, or 30, the start time of your request is rounded 2660 // down to the nearest time that corresponds to even 5-, 10-, or 30-second divisions 2661 // of a minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for 2662 // the previous 10-second period, the start time of your request is rounded 2663 // down and you receive data from 01:05:10 to 01:05:20. If you make a query 2664 // at 15:07:17 for the previous 5 minutes of data, using a period of 5 seconds, 2665 // you receive data timestamped between 15:02:15 and 15:07:15. 2666 // 2667 // StartTime is a required field 2668 StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` 2669 2670 // The metric statistics, other than percentile. For percentile statistics, 2671 // use ExtendedStatistics. When calling GetMetricStatistics, you must specify 2672 // either Statistics or ExtendedStatistics, but not both. 2673 Statistics []*string `min:"1" type:"list"` 2674 2675 // The unit for a given metric. Metrics may be reported in multiple units. Not 2676 // supplying a unit results in all units being returned. If the metric only 2677 // ever reports one unit, specifying a unit has no effect. 2678 Unit *string `type:"string" enum:"StandardUnit"` 2679} 2680 2681// String returns the string representation 2682func (s GetMetricStatisticsInput) String() string { 2683 return awsutil.Prettify(s) 2684} 2685 2686// GoString returns the string representation 2687func (s GetMetricStatisticsInput) GoString() string { 2688 return s.String() 2689} 2690 2691// Validate inspects the fields of the type to determine if they are valid. 2692func (s *GetMetricStatisticsInput) Validate() error { 2693 invalidParams := request.ErrInvalidParams{Context: "GetMetricStatisticsInput"} 2694 if s.EndTime == nil { 2695 invalidParams.Add(request.NewErrParamRequired("EndTime")) 2696 } 2697 if s.ExtendedStatistics != nil && len(s.ExtendedStatistics) < 1 { 2698 invalidParams.Add(request.NewErrParamMinLen("ExtendedStatistics", 1)) 2699 } 2700 if s.MetricName == nil { 2701 invalidParams.Add(request.NewErrParamRequired("MetricName")) 2702 } 2703 if s.MetricName != nil && len(*s.MetricName) < 1 { 2704 invalidParams.Add(request.NewErrParamMinLen("MetricName", 1)) 2705 } 2706 if s.Namespace == nil { 2707 invalidParams.Add(request.NewErrParamRequired("Namespace")) 2708 } 2709 if s.Namespace != nil && len(*s.Namespace) < 1 { 2710 invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) 2711 } 2712 if s.Period == nil { 2713 invalidParams.Add(request.NewErrParamRequired("Period")) 2714 } 2715 if s.Period != nil && *s.Period < 1 { 2716 invalidParams.Add(request.NewErrParamMinValue("Period", 1)) 2717 } 2718 if s.StartTime == nil { 2719 invalidParams.Add(request.NewErrParamRequired("StartTime")) 2720 } 2721 if s.Statistics != nil && len(s.Statistics) < 1 { 2722 invalidParams.Add(request.NewErrParamMinLen("Statistics", 1)) 2723 } 2724 if s.Dimensions != nil { 2725 for i, v := range s.Dimensions { 2726 if v == nil { 2727 continue 2728 } 2729 if err := v.Validate(); err != nil { 2730 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams)) 2731 } 2732 } 2733 } 2734 2735 if invalidParams.Len() > 0 { 2736 return invalidParams 2737 } 2738 return nil 2739} 2740 2741// SetDimensions sets the Dimensions field's value. 2742func (s *GetMetricStatisticsInput) SetDimensions(v []*Dimension) *GetMetricStatisticsInput { 2743 s.Dimensions = v 2744 return s 2745} 2746 2747// SetEndTime sets the EndTime field's value. 2748func (s *GetMetricStatisticsInput) SetEndTime(v time.Time) *GetMetricStatisticsInput { 2749 s.EndTime = &v 2750 return s 2751} 2752 2753// SetExtendedStatistics sets the ExtendedStatistics field's value. 2754func (s *GetMetricStatisticsInput) SetExtendedStatistics(v []*string) *GetMetricStatisticsInput { 2755 s.ExtendedStatistics = v 2756 return s 2757} 2758 2759// SetMetricName sets the MetricName field's value. 2760func (s *GetMetricStatisticsInput) SetMetricName(v string) *GetMetricStatisticsInput { 2761 s.MetricName = &v 2762 return s 2763} 2764 2765// SetNamespace sets the Namespace field's value. 2766func (s *GetMetricStatisticsInput) SetNamespace(v string) *GetMetricStatisticsInput { 2767 s.Namespace = &v 2768 return s 2769} 2770 2771// SetPeriod sets the Period field's value. 2772func (s *GetMetricStatisticsInput) SetPeriod(v int64) *GetMetricStatisticsInput { 2773 s.Period = &v 2774 return s 2775} 2776 2777// SetStartTime sets the StartTime field's value. 2778func (s *GetMetricStatisticsInput) SetStartTime(v time.Time) *GetMetricStatisticsInput { 2779 s.StartTime = &v 2780 return s 2781} 2782 2783// SetStatistics sets the Statistics field's value. 2784func (s *GetMetricStatisticsInput) SetStatistics(v []*string) *GetMetricStatisticsInput { 2785 s.Statistics = v 2786 return s 2787} 2788 2789// SetUnit sets the Unit field's value. 2790func (s *GetMetricStatisticsInput) SetUnit(v string) *GetMetricStatisticsInput { 2791 s.Unit = &v 2792 return s 2793} 2794 2795// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetMetricStatisticsOutput 2796type GetMetricStatisticsOutput struct { 2797 _ struct{} `type:"structure"` 2798 2799 // The data points for the specified metric. 2800 Datapoints []*Datapoint `type:"list"` 2801 2802 // A label for the specified metric. 2803 Label *string `type:"string"` 2804} 2805 2806// String returns the string representation 2807func (s GetMetricStatisticsOutput) String() string { 2808 return awsutil.Prettify(s) 2809} 2810 2811// GoString returns the string representation 2812func (s GetMetricStatisticsOutput) GoString() string { 2813 return s.String() 2814} 2815 2816// SetDatapoints sets the Datapoints field's value. 2817func (s *GetMetricStatisticsOutput) SetDatapoints(v []*Datapoint) *GetMetricStatisticsOutput { 2818 s.Datapoints = v 2819 return s 2820} 2821 2822// SetLabel sets the Label field's value. 2823func (s *GetMetricStatisticsOutput) SetLabel(v string) *GetMetricStatisticsOutput { 2824 s.Label = &v 2825 return s 2826} 2827 2828// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListDashboardsInput 2829type ListDashboardsInput struct { 2830 _ struct{} `type:"structure"` 2831 2832 // If you specify this parameter, only the dashboards with names starting with 2833 // the specified string are listed. The maximum length is 255, and valid characters 2834 // are A-Z, a-z, 0-9, ".", "-", and "_". 2835 DashboardNamePrefix *string `type:"string"` 2836 2837 // The token returned by a previous call to indicate that there is more data 2838 // available. 2839 NextToken *string `type:"string"` 2840} 2841 2842// String returns the string representation 2843func (s ListDashboardsInput) String() string { 2844 return awsutil.Prettify(s) 2845} 2846 2847// GoString returns the string representation 2848func (s ListDashboardsInput) GoString() string { 2849 return s.String() 2850} 2851 2852// SetDashboardNamePrefix sets the DashboardNamePrefix field's value. 2853func (s *ListDashboardsInput) SetDashboardNamePrefix(v string) *ListDashboardsInput { 2854 s.DashboardNamePrefix = &v 2855 return s 2856} 2857 2858// SetNextToken sets the NextToken field's value. 2859func (s *ListDashboardsInput) SetNextToken(v string) *ListDashboardsInput { 2860 s.NextToken = &v 2861 return s 2862} 2863 2864// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListDashboardsOutput 2865type ListDashboardsOutput struct { 2866 _ struct{} `type:"structure"` 2867 2868 // The list of matching dashboards. 2869 DashboardEntries []*DashboardEntry `type:"list"` 2870 2871 // The token that marks the start of the next batch of returned results. 2872 NextToken *string `type:"string"` 2873} 2874 2875// String returns the string representation 2876func (s ListDashboardsOutput) String() string { 2877 return awsutil.Prettify(s) 2878} 2879 2880// GoString returns the string representation 2881func (s ListDashboardsOutput) GoString() string { 2882 return s.String() 2883} 2884 2885// SetDashboardEntries sets the DashboardEntries field's value. 2886func (s *ListDashboardsOutput) SetDashboardEntries(v []*DashboardEntry) *ListDashboardsOutput { 2887 s.DashboardEntries = v 2888 return s 2889} 2890 2891// SetNextToken sets the NextToken field's value. 2892func (s *ListDashboardsOutput) SetNextToken(v string) *ListDashboardsOutput { 2893 s.NextToken = &v 2894 return s 2895} 2896 2897// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListMetricsInput 2898type ListMetricsInput struct { 2899 _ struct{} `type:"structure"` 2900 2901 // The dimensions to filter against. 2902 Dimensions []*DimensionFilter `type:"list"` 2903 2904 // The name of the metric to filter against. 2905 MetricName *string `min:"1" type:"string"` 2906 2907 // The namespace to filter against. 2908 Namespace *string `min:"1" type:"string"` 2909 2910 // The token returned by a previous call to indicate that there is more data 2911 // available. 2912 NextToken *string `type:"string"` 2913} 2914 2915// String returns the string representation 2916func (s ListMetricsInput) String() string { 2917 return awsutil.Prettify(s) 2918} 2919 2920// GoString returns the string representation 2921func (s ListMetricsInput) GoString() string { 2922 return s.String() 2923} 2924 2925// Validate inspects the fields of the type to determine if they are valid. 2926func (s *ListMetricsInput) Validate() error { 2927 invalidParams := request.ErrInvalidParams{Context: "ListMetricsInput"} 2928 if s.MetricName != nil && len(*s.MetricName) < 1 { 2929 invalidParams.Add(request.NewErrParamMinLen("MetricName", 1)) 2930 } 2931 if s.Namespace != nil && len(*s.Namespace) < 1 { 2932 invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) 2933 } 2934 if s.Dimensions != nil { 2935 for i, v := range s.Dimensions { 2936 if v == nil { 2937 continue 2938 } 2939 if err := v.Validate(); err != nil { 2940 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams)) 2941 } 2942 } 2943 } 2944 2945 if invalidParams.Len() > 0 { 2946 return invalidParams 2947 } 2948 return nil 2949} 2950 2951// SetDimensions sets the Dimensions field's value. 2952func (s *ListMetricsInput) SetDimensions(v []*DimensionFilter) *ListMetricsInput { 2953 s.Dimensions = v 2954 return s 2955} 2956 2957// SetMetricName sets the MetricName field's value. 2958func (s *ListMetricsInput) SetMetricName(v string) *ListMetricsInput { 2959 s.MetricName = &v 2960 return s 2961} 2962 2963// SetNamespace sets the Namespace field's value. 2964func (s *ListMetricsInput) SetNamespace(v string) *ListMetricsInput { 2965 s.Namespace = &v 2966 return s 2967} 2968 2969// SetNextToken sets the NextToken field's value. 2970func (s *ListMetricsInput) SetNextToken(v string) *ListMetricsInput { 2971 s.NextToken = &v 2972 return s 2973} 2974 2975// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListMetricsOutput 2976type ListMetricsOutput struct { 2977 _ struct{} `type:"structure"` 2978 2979 // The metrics. 2980 Metrics []*Metric `type:"list"` 2981 2982 // The token that marks the start of the next batch of returned results. 2983 NextToken *string `type:"string"` 2984} 2985 2986// String returns the string representation 2987func (s ListMetricsOutput) String() string { 2988 return awsutil.Prettify(s) 2989} 2990 2991// GoString returns the string representation 2992func (s ListMetricsOutput) GoString() string { 2993 return s.String() 2994} 2995 2996// SetMetrics sets the Metrics field's value. 2997func (s *ListMetricsOutput) SetMetrics(v []*Metric) *ListMetricsOutput { 2998 s.Metrics = v 2999 return s 3000} 3001 3002// SetNextToken sets the NextToken field's value. 3003func (s *ListMetricsOutput) SetNextToken(v string) *ListMetricsOutput { 3004 s.NextToken = &v 3005 return s 3006} 3007 3008// Represents a specific metric. 3009// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/Metric 3010type Metric struct { 3011 _ struct{} `type:"structure"` 3012 3013 // The dimensions for the metric. 3014 Dimensions []*Dimension `type:"list"` 3015 3016 // The name of the metric. 3017 MetricName *string `min:"1" type:"string"` 3018 3019 // The namespace of the metric. 3020 Namespace *string `min:"1" type:"string"` 3021} 3022 3023// String returns the string representation 3024func (s Metric) String() string { 3025 return awsutil.Prettify(s) 3026} 3027 3028// GoString returns the string representation 3029func (s Metric) GoString() string { 3030 return s.String() 3031} 3032 3033// SetDimensions sets the Dimensions field's value. 3034func (s *Metric) SetDimensions(v []*Dimension) *Metric { 3035 s.Dimensions = v 3036 return s 3037} 3038 3039// SetMetricName sets the MetricName field's value. 3040func (s *Metric) SetMetricName(v string) *Metric { 3041 s.MetricName = &v 3042 return s 3043} 3044 3045// SetNamespace sets the Namespace field's value. 3046func (s *Metric) SetNamespace(v string) *Metric { 3047 s.Namespace = &v 3048 return s 3049} 3050 3051// Represents an alarm. 3052// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/MetricAlarm 3053type MetricAlarm struct { 3054 _ struct{} `type:"structure"` 3055 3056 // Indicates whether actions should be executed during any changes to the alarm 3057 // state. 3058 ActionsEnabled *bool `type:"boolean"` 3059 3060 // The actions to execute when this alarm transitions to the ALARM state from 3061 // any other state. Each action is specified as an Amazon Resource Name (ARN). 3062 AlarmActions []*string `type:"list"` 3063 3064 // The Amazon Resource Name (ARN) of the alarm. 3065 AlarmArn *string `min:"1" type:"string"` 3066 3067 // The time stamp of the last update to the alarm configuration. 3068 AlarmConfigurationUpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` 3069 3070 // The description of the alarm. 3071 AlarmDescription *string `type:"string"` 3072 3073 // The name of the alarm. 3074 AlarmName *string `min:"1" type:"string"` 3075 3076 // The arithmetic operation to use when comparing the specified statistic and 3077 // threshold. The specified statistic value is used as the first operand. 3078 ComparisonOperator *string `type:"string" enum:"ComparisonOperator"` 3079 3080 // The dimensions for the metric associated with the alarm. 3081 Dimensions []*Dimension `type:"list"` 3082 3083 // Used only for alarms based on percentiles. If ignore, the alarm state does 3084 // not change during periods with too few data points to be statistically significant. 3085 // If evaluate or this parameter is not used, the alarm is always evaluated 3086 // and possibly changes state no matter how many data points are available. 3087 EvaluateLowSampleCountPercentile *string `min:"1" type:"string"` 3088 3089 // The number of periods over which data is compared to the specified threshold. 3090 EvaluationPeriods *int64 `min:"1" type:"integer"` 3091 3092 // The percentile statistic for the metric associated with the alarm. Specify 3093 // a value between p0.0 and p100. 3094 ExtendedStatistic *string `type:"string"` 3095 3096 // The actions to execute when this alarm transitions to the INSUFFICIENT_DATA 3097 // state from any other state. Each action is specified as an Amazon Resource 3098 // Name (ARN). 3099 InsufficientDataActions []*string `type:"list"` 3100 3101 // The name of the metric associated with the alarm. 3102 MetricName *string `min:"1" type:"string"` 3103 3104 // The namespace of the metric associated with the alarm. 3105 Namespace *string `min:"1" type:"string"` 3106 3107 // The actions to execute when this alarm transitions to the OK state from any 3108 // other state. Each action is specified as an Amazon Resource Name (ARN). 3109 OKActions []*string `type:"list"` 3110 3111 // The period, in seconds, over which the statistic is applied. 3112 Period *int64 `min:"1" type:"integer"` 3113 3114 // An explanation for the alarm state, in text format. 3115 StateReason *string `type:"string"` 3116 3117 // An explanation for the alarm state, in JSON format. 3118 StateReasonData *string `type:"string"` 3119 3120 // The time stamp of the last update to the alarm state. 3121 StateUpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` 3122 3123 // The state value for the alarm. 3124 StateValue *string `type:"string" enum:"StateValue"` 3125 3126 // The statistic for the metric associated with the alarm, other than percentile. 3127 // For percentile statistics, use ExtendedStatistic. 3128 Statistic *string `type:"string" enum:"Statistic"` 3129 3130 // The value to compare with the specified statistic. 3131 Threshold *float64 `type:"double"` 3132 3133 // Sets how this alarm is to handle missing data points. If this parameter is 3134 // omitted, the default behavior of missing is used. 3135 TreatMissingData *string `min:"1" type:"string"` 3136 3137 // The unit of the metric associated with the alarm. 3138 Unit *string `type:"string" enum:"StandardUnit"` 3139} 3140 3141// String returns the string representation 3142func (s MetricAlarm) String() string { 3143 return awsutil.Prettify(s) 3144} 3145 3146// GoString returns the string representation 3147func (s MetricAlarm) GoString() string { 3148 return s.String() 3149} 3150 3151// SetActionsEnabled sets the ActionsEnabled field's value. 3152func (s *MetricAlarm) SetActionsEnabled(v bool) *MetricAlarm { 3153 s.ActionsEnabled = &v 3154 return s 3155} 3156 3157// SetAlarmActions sets the AlarmActions field's value. 3158func (s *MetricAlarm) SetAlarmActions(v []*string) *MetricAlarm { 3159 s.AlarmActions = v 3160 return s 3161} 3162 3163// SetAlarmArn sets the AlarmArn field's value. 3164func (s *MetricAlarm) SetAlarmArn(v string) *MetricAlarm { 3165 s.AlarmArn = &v 3166 return s 3167} 3168 3169// SetAlarmConfigurationUpdatedTimestamp sets the AlarmConfigurationUpdatedTimestamp field's value. 3170func (s *MetricAlarm) SetAlarmConfigurationUpdatedTimestamp(v time.Time) *MetricAlarm { 3171 s.AlarmConfigurationUpdatedTimestamp = &v 3172 return s 3173} 3174 3175// SetAlarmDescription sets the AlarmDescription field's value. 3176func (s *MetricAlarm) SetAlarmDescription(v string) *MetricAlarm { 3177 s.AlarmDescription = &v 3178 return s 3179} 3180 3181// SetAlarmName sets the AlarmName field's value. 3182func (s *MetricAlarm) SetAlarmName(v string) *MetricAlarm { 3183 s.AlarmName = &v 3184 return s 3185} 3186 3187// SetComparisonOperator sets the ComparisonOperator field's value. 3188func (s *MetricAlarm) SetComparisonOperator(v string) *MetricAlarm { 3189 s.ComparisonOperator = &v 3190 return s 3191} 3192 3193// SetDimensions sets the Dimensions field's value. 3194func (s *MetricAlarm) SetDimensions(v []*Dimension) *MetricAlarm { 3195 s.Dimensions = v 3196 return s 3197} 3198 3199// SetEvaluateLowSampleCountPercentile sets the EvaluateLowSampleCountPercentile field's value. 3200func (s *MetricAlarm) SetEvaluateLowSampleCountPercentile(v string) *MetricAlarm { 3201 s.EvaluateLowSampleCountPercentile = &v 3202 return s 3203} 3204 3205// SetEvaluationPeriods sets the EvaluationPeriods field's value. 3206func (s *MetricAlarm) SetEvaluationPeriods(v int64) *MetricAlarm { 3207 s.EvaluationPeriods = &v 3208 return s 3209} 3210 3211// SetExtendedStatistic sets the ExtendedStatistic field's value. 3212func (s *MetricAlarm) SetExtendedStatistic(v string) *MetricAlarm { 3213 s.ExtendedStatistic = &v 3214 return s 3215} 3216 3217// SetInsufficientDataActions sets the InsufficientDataActions field's value. 3218func (s *MetricAlarm) SetInsufficientDataActions(v []*string) *MetricAlarm { 3219 s.InsufficientDataActions = v 3220 return s 3221} 3222 3223// SetMetricName sets the MetricName field's value. 3224func (s *MetricAlarm) SetMetricName(v string) *MetricAlarm { 3225 s.MetricName = &v 3226 return s 3227} 3228 3229// SetNamespace sets the Namespace field's value. 3230func (s *MetricAlarm) SetNamespace(v string) *MetricAlarm { 3231 s.Namespace = &v 3232 return s 3233} 3234 3235// SetOKActions sets the OKActions field's value. 3236func (s *MetricAlarm) SetOKActions(v []*string) *MetricAlarm { 3237 s.OKActions = v 3238 return s 3239} 3240 3241// SetPeriod sets the Period field's value. 3242func (s *MetricAlarm) SetPeriod(v int64) *MetricAlarm { 3243 s.Period = &v 3244 return s 3245} 3246 3247// SetStateReason sets the StateReason field's value. 3248func (s *MetricAlarm) SetStateReason(v string) *MetricAlarm { 3249 s.StateReason = &v 3250 return s 3251} 3252 3253// SetStateReasonData sets the StateReasonData field's value. 3254func (s *MetricAlarm) SetStateReasonData(v string) *MetricAlarm { 3255 s.StateReasonData = &v 3256 return s 3257} 3258 3259// SetStateUpdatedTimestamp sets the StateUpdatedTimestamp field's value. 3260func (s *MetricAlarm) SetStateUpdatedTimestamp(v time.Time) *MetricAlarm { 3261 s.StateUpdatedTimestamp = &v 3262 return s 3263} 3264 3265// SetStateValue sets the StateValue field's value. 3266func (s *MetricAlarm) SetStateValue(v string) *MetricAlarm { 3267 s.StateValue = &v 3268 return s 3269} 3270 3271// SetStatistic sets the Statistic field's value. 3272func (s *MetricAlarm) SetStatistic(v string) *MetricAlarm { 3273 s.Statistic = &v 3274 return s 3275} 3276 3277// SetThreshold sets the Threshold field's value. 3278func (s *MetricAlarm) SetThreshold(v float64) *MetricAlarm { 3279 s.Threshold = &v 3280 return s 3281} 3282 3283// SetTreatMissingData sets the TreatMissingData field's value. 3284func (s *MetricAlarm) SetTreatMissingData(v string) *MetricAlarm { 3285 s.TreatMissingData = &v 3286 return s 3287} 3288 3289// SetUnit sets the Unit field's value. 3290func (s *MetricAlarm) SetUnit(v string) *MetricAlarm { 3291 s.Unit = &v 3292 return s 3293} 3294 3295// Encapsulates the information sent to either create a metric or add new values 3296// to be aggregated into an existing metric. 3297// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/MetricDatum 3298type MetricDatum struct { 3299 _ struct{} `type:"structure"` 3300 3301 // The dimensions associated with the metric. 3302 Dimensions []*Dimension `type:"list"` 3303 3304 // The name of the metric. 3305 // 3306 // MetricName is a required field 3307 MetricName *string `min:"1" type:"string" required:"true"` 3308 3309 // The statistical values for the metric. 3310 StatisticValues *StatisticSet `type:"structure"` 3311 3312 // Valid values are 1 and 60. Setting this to 1 specifies this metric as a high-resolution 3313 // metric, so that CloudWatch stores the metric with sub-minute resolution down 3314 // to one second. Setting this to 60 specifies this metric as a regular-resolution 3315 // metric, which CloudWatch stores at 1-minute resolution. Currently, high resolution 3316 // is available only for custom metrics. For more information about high-resolution 3317 // metrics, see High-Resolution Metrics (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html#high-resolution-metrics) 3318 // in the Amazon CloudWatch User Guide. 3319 // 3320 // This field is optional, if you do not specify it the default of 60 is used. 3321 StorageResolution *int64 `min:"1" type:"integer"` 3322 3323 // The time the metric data was received, expressed as the number of milliseconds 3324 // since Jan 1, 1970 00:00:00 UTC. 3325 Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` 3326 3327 // The unit of the metric. 3328 Unit *string `type:"string" enum:"StandardUnit"` 3329 3330 // The value for the metric. 3331 // 3332 // Although the parameter accepts numbers of type Double, CloudWatch rejects 3333 // values that are either too small or too large. Values must be in the range 3334 // of 8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base 2). 3335 // In addition, special values (for example, NaN, +Infinity, -Infinity) are 3336 // not supported. 3337 Value *float64 `type:"double"` 3338} 3339 3340// String returns the string representation 3341func (s MetricDatum) String() string { 3342 return awsutil.Prettify(s) 3343} 3344 3345// GoString returns the string representation 3346func (s MetricDatum) GoString() string { 3347 return s.String() 3348} 3349 3350// Validate inspects the fields of the type to determine if they are valid. 3351func (s *MetricDatum) Validate() error { 3352 invalidParams := request.ErrInvalidParams{Context: "MetricDatum"} 3353 if s.MetricName == nil { 3354 invalidParams.Add(request.NewErrParamRequired("MetricName")) 3355 } 3356 if s.MetricName != nil && len(*s.MetricName) < 1 { 3357 invalidParams.Add(request.NewErrParamMinLen("MetricName", 1)) 3358 } 3359 if s.StorageResolution != nil && *s.StorageResolution < 1 { 3360 invalidParams.Add(request.NewErrParamMinValue("StorageResolution", 1)) 3361 } 3362 if s.Dimensions != nil { 3363 for i, v := range s.Dimensions { 3364 if v == nil { 3365 continue 3366 } 3367 if err := v.Validate(); err != nil { 3368 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams)) 3369 } 3370 } 3371 } 3372 if s.StatisticValues != nil { 3373 if err := s.StatisticValues.Validate(); err != nil { 3374 invalidParams.AddNested("StatisticValues", err.(request.ErrInvalidParams)) 3375 } 3376 } 3377 3378 if invalidParams.Len() > 0 { 3379 return invalidParams 3380 } 3381 return nil 3382} 3383 3384// SetDimensions sets the Dimensions field's value. 3385func (s *MetricDatum) SetDimensions(v []*Dimension) *MetricDatum { 3386 s.Dimensions = v 3387 return s 3388} 3389 3390// SetMetricName sets the MetricName field's value. 3391func (s *MetricDatum) SetMetricName(v string) *MetricDatum { 3392 s.MetricName = &v 3393 return s 3394} 3395 3396// SetStatisticValues sets the StatisticValues field's value. 3397func (s *MetricDatum) SetStatisticValues(v *StatisticSet) *MetricDatum { 3398 s.StatisticValues = v 3399 return s 3400} 3401 3402// SetStorageResolution sets the StorageResolution field's value. 3403func (s *MetricDatum) SetStorageResolution(v int64) *MetricDatum { 3404 s.StorageResolution = &v 3405 return s 3406} 3407 3408// SetTimestamp sets the Timestamp field's value. 3409func (s *MetricDatum) SetTimestamp(v time.Time) *MetricDatum { 3410 s.Timestamp = &v 3411 return s 3412} 3413 3414// SetUnit sets the Unit field's value. 3415func (s *MetricDatum) SetUnit(v string) *MetricDatum { 3416 s.Unit = &v 3417 return s 3418} 3419 3420// SetValue sets the Value field's value. 3421func (s *MetricDatum) SetValue(v float64) *MetricDatum { 3422 s.Value = &v 3423 return s 3424} 3425 3426// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutDashboardInput 3427type PutDashboardInput struct { 3428 _ struct{} `type:"structure"` 3429 3430 // The detailed information about the dashboard in JSON format, including the 3431 // widgets to include and their location on the dashboard. 3432 // 3433 // For more information about the syntax, see CloudWatch-Dashboard-Body-Structure. 3434 DashboardBody *string `type:"string"` 3435 3436 // The name of the dashboard. If a dashboard with this name already exists, 3437 // this call modifies that dashboard, replacing its current contents. Otherwise, 3438 // a new dashboard is created. The maximum length is 255, and valid characters 3439 // are A-Z, a-z, 0-9, "-", and "_". 3440 DashboardName *string `type:"string"` 3441} 3442 3443// String returns the string representation 3444func (s PutDashboardInput) String() string { 3445 return awsutil.Prettify(s) 3446} 3447 3448// GoString returns the string representation 3449func (s PutDashboardInput) GoString() string { 3450 return s.String() 3451} 3452 3453// SetDashboardBody sets the DashboardBody field's value. 3454func (s *PutDashboardInput) SetDashboardBody(v string) *PutDashboardInput { 3455 s.DashboardBody = &v 3456 return s 3457} 3458 3459// SetDashboardName sets the DashboardName field's value. 3460func (s *PutDashboardInput) SetDashboardName(v string) *PutDashboardInput { 3461 s.DashboardName = &v 3462 return s 3463} 3464 3465// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutDashboardOutput 3466type PutDashboardOutput struct { 3467 _ struct{} `type:"structure"` 3468 3469 // If the input for PutDashboard was correct and the dashboard was successfully 3470 // created or modified, this result is empty. 3471 // 3472 // If this result includes only warning messages, then the input was valid enough 3473 // for the dashboard to be created or modified, but some elements of the dashboard 3474 // may not render. 3475 // 3476 // If this result includes error messages, the input was not valid and the operation 3477 // failed. 3478 DashboardValidationMessages []*DashboardValidationMessage `type:"list"` 3479} 3480 3481// String returns the string representation 3482func (s PutDashboardOutput) String() string { 3483 return awsutil.Prettify(s) 3484} 3485 3486// GoString returns the string representation 3487func (s PutDashboardOutput) GoString() string { 3488 return s.String() 3489} 3490 3491// SetDashboardValidationMessages sets the DashboardValidationMessages field's value. 3492func (s *PutDashboardOutput) SetDashboardValidationMessages(v []*DashboardValidationMessage) *PutDashboardOutput { 3493 s.DashboardValidationMessages = v 3494 return s 3495} 3496 3497// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricAlarmInput 3498type PutMetricAlarmInput struct { 3499 _ struct{} `type:"structure"` 3500 3501 // Indicates whether actions should be executed during any changes to the alarm 3502 // state. 3503 ActionsEnabled *bool `type:"boolean"` 3504 3505 // The actions to execute when this alarm transitions to the ALARM state from 3506 // any other state. Each action is specified as an Amazon Resource Name (ARN). 3507 // 3508 // Valid Values: arn:aws:automate:region:ec2:stop | arn:aws:automate:region:ec2:terminate 3509 // | arn:aws:automate:region:ec2:recover 3510 // 3511 // Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 3512 // | arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Terminate/1.0 3513 // | arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Reboot/1.0 3514 AlarmActions []*string `type:"list"` 3515 3516 // The description for the alarm. 3517 AlarmDescription *string `type:"string"` 3518 3519 // The name for the alarm. This name must be unique within the AWS account. 3520 // 3521 // AlarmName is a required field 3522 AlarmName *string `min:"1" type:"string" required:"true"` 3523 3524 // The arithmetic operation to use when comparing the specified statistic and 3525 // threshold. The specified statistic value is used as the first operand. 3526 // 3527 // ComparisonOperator is a required field 3528 ComparisonOperator *string `type:"string" required:"true" enum:"ComparisonOperator"` 3529 3530 // The dimensions for the metric associated with the alarm. 3531 Dimensions []*Dimension `type:"list"` 3532 3533 // Used only for alarms based on percentiles. If you specify ignore, the alarm 3534 // state does not change during periods with too few data points to be statistically 3535 // significant. If you specify evaluate or omit this parameter, the alarm is 3536 // always evaluated and possibly changes state no matter how many data points 3537 // are available. For more information, see Percentile-Based CloudWatch Alarms 3538 // and Low Data Samples (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#percentiles-with-low-samples). 3539 // 3540 // Valid Values: evaluate | ignore 3541 EvaluateLowSampleCountPercentile *string `min:"1" type:"string"` 3542 3543 // The number of periods over which data is compared to the specified threshold. 3544 // An alarm's total current evaluation period can be no longer than one day, 3545 // so this number multiplied by Period cannot be more than 86,400 seconds. 3546 // 3547 // EvaluationPeriods is a required field 3548 EvaluationPeriods *int64 `min:"1" type:"integer" required:"true"` 3549 3550 // The percentile statistic for the metric associated with the alarm. Specify 3551 // a value between p0.0 and p100. 3552 ExtendedStatistic *string `type:"string"` 3553 3554 // The actions to execute when this alarm transitions to the INSUFFICIENT_DATA 3555 // state from any other state. Each action is specified as an Amazon Resource 3556 // Name (ARN). 3557 // 3558 // Valid Values: arn:aws:automate:region:ec2:stop | arn:aws:automate:region:ec2:terminate 3559 // | arn:aws:automate:region:ec2:recover 3560 // 3561 // Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 3562 // | arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Terminate/1.0 3563 // | arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Reboot/1.0 3564 InsufficientDataActions []*string `type:"list"` 3565 3566 // The name for the metric associated with the alarm. 3567 // 3568 // MetricName is a required field 3569 MetricName *string `min:"1" type:"string" required:"true"` 3570 3571 // The namespace for the metric associated with the alarm. 3572 // 3573 // Namespace is a required field 3574 Namespace *string `min:"1" type:"string" required:"true"` 3575 3576 // The actions to execute when this alarm transitions to an OK state from any 3577 // other state. Each action is specified as an Amazon Resource Name (ARN). 3578 // 3579 // Valid Values: arn:aws:automate:region:ec2:stop | arn:aws:automate:region:ec2:terminate 3580 // | arn:aws:automate:region:ec2:recover 3581 // 3582 // Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 3583 // | arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Terminate/1.0 3584 // | arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Reboot/1.0 3585 OKActions []*string `type:"list"` 3586 3587 // The period, in seconds, over which the specified statistic is applied. Valid 3588 // values are 10, 30, and any multiple of 60. 3589 // 3590 // Be sure to specify 10 or 30 only for metrics that are stored by a PutMetricData 3591 // call with a StorageResolution of 1. If you specify a Period of 10 or 30 for 3592 // a metric that does not have sub-minute resolution, the alarm still attempts 3593 // to gather data at the period rate that you specify. In this case, it does 3594 // not receive data for the attempts that do not correspond to a one-minute 3595 // data resolution, and the alarm may often lapse into INSUFFICENT_DATA status. 3596 // Specifying 10 or 30 also sets this alarm as a high-resolution alarm, which 3597 // has a higher charge than other alarms. For more information about pricing, 3598 // see Amazon CloudWatch Pricing (https://aws.amazon.com/cloudwatch/pricing/). 3599 // 3600 // An alarm's total current evaluation period can be no longer than one day, 3601 // so Period multiplied by EvaluationPeriods cannot be more than 86,400 seconds. 3602 // 3603 // Period is a required field 3604 Period *int64 `min:"1" type:"integer" required:"true"` 3605 3606 // The statistic for the metric associated with the alarm, other than percentile. 3607 // For percentile statistics, use ExtendedStatistic. 3608 Statistic *string `type:"string" enum:"Statistic"` 3609 3610 // The value against which the specified statistic is compared. 3611 // 3612 // Threshold is a required field 3613 Threshold *float64 `type:"double" required:"true"` 3614 3615 // Sets how this alarm is to handle missing data points. If TreatMissingData 3616 // is omitted, the default behavior of missing is used. For more information, 3617 // see Configuring How CloudWatch Alarms Treats Missing Data (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data). 3618 // 3619 // Valid Values: breaching | notBreaching | ignore | missing 3620 TreatMissingData *string `min:"1" type:"string"` 3621 3622 // The unit of measure for the statistic. For example, the units for the Amazon 3623 // EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes 3624 // that an instance receives on all network interfaces. You can also specify 3625 // a unit when you create a custom metric. Units help provide conceptual meaning 3626 // to your data. Metric data points that specify a unit of measure, such as 3627 // Percent, are aggregated separately. 3628 // 3629 // If you specify a unit, you must use a unit that is appropriate for the metric. 3630 // Otherwise, the CloudWatch alarm can get stuck in the INSUFFICIENT DATA state. 3631 Unit *string `type:"string" enum:"StandardUnit"` 3632} 3633 3634// String returns the string representation 3635func (s PutMetricAlarmInput) String() string { 3636 return awsutil.Prettify(s) 3637} 3638 3639// GoString returns the string representation 3640func (s PutMetricAlarmInput) GoString() string { 3641 return s.String() 3642} 3643 3644// Validate inspects the fields of the type to determine if they are valid. 3645func (s *PutMetricAlarmInput) Validate() error { 3646 invalidParams := request.ErrInvalidParams{Context: "PutMetricAlarmInput"} 3647 if s.AlarmName == nil { 3648 invalidParams.Add(request.NewErrParamRequired("AlarmName")) 3649 } 3650 if s.AlarmName != nil && len(*s.AlarmName) < 1 { 3651 invalidParams.Add(request.NewErrParamMinLen("AlarmName", 1)) 3652 } 3653 if s.ComparisonOperator == nil { 3654 invalidParams.Add(request.NewErrParamRequired("ComparisonOperator")) 3655 } 3656 if s.EvaluateLowSampleCountPercentile != nil && len(*s.EvaluateLowSampleCountPercentile) < 1 { 3657 invalidParams.Add(request.NewErrParamMinLen("EvaluateLowSampleCountPercentile", 1)) 3658 } 3659 if s.EvaluationPeriods == nil { 3660 invalidParams.Add(request.NewErrParamRequired("EvaluationPeriods")) 3661 } 3662 if s.EvaluationPeriods != nil && *s.EvaluationPeriods < 1 { 3663 invalidParams.Add(request.NewErrParamMinValue("EvaluationPeriods", 1)) 3664 } 3665 if s.MetricName == nil { 3666 invalidParams.Add(request.NewErrParamRequired("MetricName")) 3667 } 3668 if s.MetricName != nil && len(*s.MetricName) < 1 { 3669 invalidParams.Add(request.NewErrParamMinLen("MetricName", 1)) 3670 } 3671 if s.Namespace == nil { 3672 invalidParams.Add(request.NewErrParamRequired("Namespace")) 3673 } 3674 if s.Namespace != nil && len(*s.Namespace) < 1 { 3675 invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) 3676 } 3677 if s.Period == nil { 3678 invalidParams.Add(request.NewErrParamRequired("Period")) 3679 } 3680 if s.Period != nil && *s.Period < 1 { 3681 invalidParams.Add(request.NewErrParamMinValue("Period", 1)) 3682 } 3683 if s.Threshold == nil { 3684 invalidParams.Add(request.NewErrParamRequired("Threshold")) 3685 } 3686 if s.TreatMissingData != nil && len(*s.TreatMissingData) < 1 { 3687 invalidParams.Add(request.NewErrParamMinLen("TreatMissingData", 1)) 3688 } 3689 if s.Dimensions != nil { 3690 for i, v := range s.Dimensions { 3691 if v == nil { 3692 continue 3693 } 3694 if err := v.Validate(); err != nil { 3695 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams)) 3696 } 3697 } 3698 } 3699 3700 if invalidParams.Len() > 0 { 3701 return invalidParams 3702 } 3703 return nil 3704} 3705 3706// SetActionsEnabled sets the ActionsEnabled field's value. 3707func (s *PutMetricAlarmInput) SetActionsEnabled(v bool) *PutMetricAlarmInput { 3708 s.ActionsEnabled = &v 3709 return s 3710} 3711 3712// SetAlarmActions sets the AlarmActions field's value. 3713func (s *PutMetricAlarmInput) SetAlarmActions(v []*string) *PutMetricAlarmInput { 3714 s.AlarmActions = v 3715 return s 3716} 3717 3718// SetAlarmDescription sets the AlarmDescription field's value. 3719func (s *PutMetricAlarmInput) SetAlarmDescription(v string) *PutMetricAlarmInput { 3720 s.AlarmDescription = &v 3721 return s 3722} 3723 3724// SetAlarmName sets the AlarmName field's value. 3725func (s *PutMetricAlarmInput) SetAlarmName(v string) *PutMetricAlarmInput { 3726 s.AlarmName = &v 3727 return s 3728} 3729 3730// SetComparisonOperator sets the ComparisonOperator field's value. 3731func (s *PutMetricAlarmInput) SetComparisonOperator(v string) *PutMetricAlarmInput { 3732 s.ComparisonOperator = &v 3733 return s 3734} 3735 3736// SetDimensions sets the Dimensions field's value. 3737func (s *PutMetricAlarmInput) SetDimensions(v []*Dimension) *PutMetricAlarmInput { 3738 s.Dimensions = v 3739 return s 3740} 3741 3742// SetEvaluateLowSampleCountPercentile sets the EvaluateLowSampleCountPercentile field's value. 3743func (s *PutMetricAlarmInput) SetEvaluateLowSampleCountPercentile(v string) *PutMetricAlarmInput { 3744 s.EvaluateLowSampleCountPercentile = &v 3745 return s 3746} 3747 3748// SetEvaluationPeriods sets the EvaluationPeriods field's value. 3749func (s *PutMetricAlarmInput) SetEvaluationPeriods(v int64) *PutMetricAlarmInput { 3750 s.EvaluationPeriods = &v 3751 return s 3752} 3753 3754// SetExtendedStatistic sets the ExtendedStatistic field's value. 3755func (s *PutMetricAlarmInput) SetExtendedStatistic(v string) *PutMetricAlarmInput { 3756 s.ExtendedStatistic = &v 3757 return s 3758} 3759 3760// SetInsufficientDataActions sets the InsufficientDataActions field's value. 3761func (s *PutMetricAlarmInput) SetInsufficientDataActions(v []*string) *PutMetricAlarmInput { 3762 s.InsufficientDataActions = v 3763 return s 3764} 3765 3766// SetMetricName sets the MetricName field's value. 3767func (s *PutMetricAlarmInput) SetMetricName(v string) *PutMetricAlarmInput { 3768 s.MetricName = &v 3769 return s 3770} 3771 3772// SetNamespace sets the Namespace field's value. 3773func (s *PutMetricAlarmInput) SetNamespace(v string) *PutMetricAlarmInput { 3774 s.Namespace = &v 3775 return s 3776} 3777 3778// SetOKActions sets the OKActions field's value. 3779func (s *PutMetricAlarmInput) SetOKActions(v []*string) *PutMetricAlarmInput { 3780 s.OKActions = v 3781 return s 3782} 3783 3784// SetPeriod sets the Period field's value. 3785func (s *PutMetricAlarmInput) SetPeriod(v int64) *PutMetricAlarmInput { 3786 s.Period = &v 3787 return s 3788} 3789 3790// SetStatistic sets the Statistic field's value. 3791func (s *PutMetricAlarmInput) SetStatistic(v string) *PutMetricAlarmInput { 3792 s.Statistic = &v 3793 return s 3794} 3795 3796// SetThreshold sets the Threshold field's value. 3797func (s *PutMetricAlarmInput) SetThreshold(v float64) *PutMetricAlarmInput { 3798 s.Threshold = &v 3799 return s 3800} 3801 3802// SetTreatMissingData sets the TreatMissingData field's value. 3803func (s *PutMetricAlarmInput) SetTreatMissingData(v string) *PutMetricAlarmInput { 3804 s.TreatMissingData = &v 3805 return s 3806} 3807 3808// SetUnit sets the Unit field's value. 3809func (s *PutMetricAlarmInput) SetUnit(v string) *PutMetricAlarmInput { 3810 s.Unit = &v 3811 return s 3812} 3813 3814// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricAlarmOutput 3815type PutMetricAlarmOutput struct { 3816 _ struct{} `type:"structure"` 3817} 3818 3819// String returns the string representation 3820func (s PutMetricAlarmOutput) String() string { 3821 return awsutil.Prettify(s) 3822} 3823 3824// GoString returns the string representation 3825func (s PutMetricAlarmOutput) GoString() string { 3826 return s.String() 3827} 3828 3829// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricDataInput 3830type PutMetricDataInput struct { 3831 _ struct{} `type:"structure"` 3832 3833 // The data for the metric. 3834 // 3835 // MetricData is a required field 3836 MetricData []*MetricDatum `type:"list" required:"true"` 3837 3838 // The namespace for the metric data. 3839 // 3840 // You cannot specify a namespace that begins with "AWS/". Namespaces that begin 3841 // with "AWS/" are reserved for use by Amazon Web Services products. 3842 // 3843 // Namespace is a required field 3844 Namespace *string `min:"1" type:"string" required:"true"` 3845} 3846 3847// String returns the string representation 3848func (s PutMetricDataInput) String() string { 3849 return awsutil.Prettify(s) 3850} 3851 3852// GoString returns the string representation 3853func (s PutMetricDataInput) GoString() string { 3854 return s.String() 3855} 3856 3857// Validate inspects the fields of the type to determine if they are valid. 3858func (s *PutMetricDataInput) Validate() error { 3859 invalidParams := request.ErrInvalidParams{Context: "PutMetricDataInput"} 3860 if s.MetricData == nil { 3861 invalidParams.Add(request.NewErrParamRequired("MetricData")) 3862 } 3863 if s.Namespace == nil { 3864 invalidParams.Add(request.NewErrParamRequired("Namespace")) 3865 } 3866 if s.Namespace != nil && len(*s.Namespace) < 1 { 3867 invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) 3868 } 3869 if s.MetricData != nil { 3870 for i, v := range s.MetricData { 3871 if v == nil { 3872 continue 3873 } 3874 if err := v.Validate(); err != nil { 3875 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MetricData", i), err.(request.ErrInvalidParams)) 3876 } 3877 } 3878 } 3879 3880 if invalidParams.Len() > 0 { 3881 return invalidParams 3882 } 3883 return nil 3884} 3885 3886// SetMetricData sets the MetricData field's value. 3887func (s *PutMetricDataInput) SetMetricData(v []*MetricDatum) *PutMetricDataInput { 3888 s.MetricData = v 3889 return s 3890} 3891 3892// SetNamespace sets the Namespace field's value. 3893func (s *PutMetricDataInput) SetNamespace(v string) *PutMetricDataInput { 3894 s.Namespace = &v 3895 return s 3896} 3897 3898// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricDataOutput 3899type PutMetricDataOutput struct { 3900 _ struct{} `type:"structure"` 3901} 3902 3903// String returns the string representation 3904func (s PutMetricDataOutput) String() string { 3905 return awsutil.Prettify(s) 3906} 3907 3908// GoString returns the string representation 3909func (s PutMetricDataOutput) GoString() string { 3910 return s.String() 3911} 3912 3913// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/SetAlarmStateInput 3914type SetAlarmStateInput struct { 3915 _ struct{} `type:"structure"` 3916 3917 // The name for the alarm. This name must be unique within the AWS account. 3918 // The maximum length is 255 characters. 3919 // 3920 // AlarmName is a required field 3921 AlarmName *string `min:"1" type:"string" required:"true"` 3922 3923 // The reason that this alarm is set to this specific state, in text format. 3924 // 3925 // StateReason is a required field 3926 StateReason *string `type:"string" required:"true"` 3927 3928 // The reason that this alarm is set to this specific state, in JSON format. 3929 StateReasonData *string `type:"string"` 3930 3931 // The value of the state. 3932 // 3933 // StateValue is a required field 3934 StateValue *string `type:"string" required:"true" enum:"StateValue"` 3935} 3936 3937// String returns the string representation 3938func (s SetAlarmStateInput) String() string { 3939 return awsutil.Prettify(s) 3940} 3941 3942// GoString returns the string representation 3943func (s SetAlarmStateInput) GoString() string { 3944 return s.String() 3945} 3946 3947// Validate inspects the fields of the type to determine if they are valid. 3948func (s *SetAlarmStateInput) Validate() error { 3949 invalidParams := request.ErrInvalidParams{Context: "SetAlarmStateInput"} 3950 if s.AlarmName == nil { 3951 invalidParams.Add(request.NewErrParamRequired("AlarmName")) 3952 } 3953 if s.AlarmName != nil && len(*s.AlarmName) < 1 { 3954 invalidParams.Add(request.NewErrParamMinLen("AlarmName", 1)) 3955 } 3956 if s.StateReason == nil { 3957 invalidParams.Add(request.NewErrParamRequired("StateReason")) 3958 } 3959 if s.StateValue == nil { 3960 invalidParams.Add(request.NewErrParamRequired("StateValue")) 3961 } 3962 3963 if invalidParams.Len() > 0 { 3964 return invalidParams 3965 } 3966 return nil 3967} 3968 3969// SetAlarmName sets the AlarmName field's value. 3970func (s *SetAlarmStateInput) SetAlarmName(v string) *SetAlarmStateInput { 3971 s.AlarmName = &v 3972 return s 3973} 3974 3975// SetStateReason sets the StateReason field's value. 3976func (s *SetAlarmStateInput) SetStateReason(v string) *SetAlarmStateInput { 3977 s.StateReason = &v 3978 return s 3979} 3980 3981// SetStateReasonData sets the StateReasonData field's value. 3982func (s *SetAlarmStateInput) SetStateReasonData(v string) *SetAlarmStateInput { 3983 s.StateReasonData = &v 3984 return s 3985} 3986 3987// SetStateValue sets the StateValue field's value. 3988func (s *SetAlarmStateInput) SetStateValue(v string) *SetAlarmStateInput { 3989 s.StateValue = &v 3990 return s 3991} 3992 3993// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/SetAlarmStateOutput 3994type SetAlarmStateOutput struct { 3995 _ struct{} `type:"structure"` 3996} 3997 3998// String returns the string representation 3999func (s SetAlarmStateOutput) String() string { 4000 return awsutil.Prettify(s) 4001} 4002 4003// GoString returns the string representation 4004func (s SetAlarmStateOutput) GoString() string { 4005 return s.String() 4006} 4007 4008// Represents a set of statistics that describes a specific metric. 4009// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/StatisticSet 4010type StatisticSet struct { 4011 _ struct{} `type:"structure"` 4012 4013 // The maximum value of the sample set. 4014 // 4015 // Maximum is a required field 4016 Maximum *float64 `type:"double" required:"true"` 4017 4018 // The minimum value of the sample set. 4019 // 4020 // Minimum is a required field 4021 Minimum *float64 `type:"double" required:"true"` 4022 4023 // The number of samples used for the statistic set. 4024 // 4025 // SampleCount is a required field 4026 SampleCount *float64 `type:"double" required:"true"` 4027 4028 // The sum of values for the sample set. 4029 // 4030 // Sum is a required field 4031 Sum *float64 `type:"double" required:"true"` 4032} 4033 4034// String returns the string representation 4035func (s StatisticSet) String() string { 4036 return awsutil.Prettify(s) 4037} 4038 4039// GoString returns the string representation 4040func (s StatisticSet) GoString() string { 4041 return s.String() 4042} 4043 4044// Validate inspects the fields of the type to determine if they are valid. 4045func (s *StatisticSet) Validate() error { 4046 invalidParams := request.ErrInvalidParams{Context: "StatisticSet"} 4047 if s.Maximum == nil { 4048 invalidParams.Add(request.NewErrParamRequired("Maximum")) 4049 } 4050 if s.Minimum == nil { 4051 invalidParams.Add(request.NewErrParamRequired("Minimum")) 4052 } 4053 if s.SampleCount == nil { 4054 invalidParams.Add(request.NewErrParamRequired("SampleCount")) 4055 } 4056 if s.Sum == nil { 4057 invalidParams.Add(request.NewErrParamRequired("Sum")) 4058 } 4059 4060 if invalidParams.Len() > 0 { 4061 return invalidParams 4062 } 4063 return nil 4064} 4065 4066// SetMaximum sets the Maximum field's value. 4067func (s *StatisticSet) SetMaximum(v float64) *StatisticSet { 4068 s.Maximum = &v 4069 return s 4070} 4071 4072// SetMinimum sets the Minimum field's value. 4073func (s *StatisticSet) SetMinimum(v float64) *StatisticSet { 4074 s.Minimum = &v 4075 return s 4076} 4077 4078// SetSampleCount sets the SampleCount field's value. 4079func (s *StatisticSet) SetSampleCount(v float64) *StatisticSet { 4080 s.SampleCount = &v 4081 return s 4082} 4083 4084// SetSum sets the Sum field's value. 4085func (s *StatisticSet) SetSum(v float64) *StatisticSet { 4086 s.Sum = &v 4087 return s 4088} 4089 4090const ( 4091 // ComparisonOperatorGreaterThanOrEqualToThreshold is a ComparisonOperator enum value 4092 ComparisonOperatorGreaterThanOrEqualToThreshold = "GreaterThanOrEqualToThreshold" 4093 4094 // ComparisonOperatorGreaterThanThreshold is a ComparisonOperator enum value 4095 ComparisonOperatorGreaterThanThreshold = "GreaterThanThreshold" 4096 4097 // ComparisonOperatorLessThanThreshold is a ComparisonOperator enum value 4098 ComparisonOperatorLessThanThreshold = "LessThanThreshold" 4099 4100 // ComparisonOperatorLessThanOrEqualToThreshold is a ComparisonOperator enum value 4101 ComparisonOperatorLessThanOrEqualToThreshold = "LessThanOrEqualToThreshold" 4102) 4103 4104const ( 4105 // HistoryItemTypeConfigurationUpdate is a HistoryItemType enum value 4106 HistoryItemTypeConfigurationUpdate = "ConfigurationUpdate" 4107 4108 // HistoryItemTypeStateUpdate is a HistoryItemType enum value 4109 HistoryItemTypeStateUpdate = "StateUpdate" 4110 4111 // HistoryItemTypeAction is a HistoryItemType enum value 4112 HistoryItemTypeAction = "Action" 4113) 4114 4115const ( 4116 // StandardUnitSeconds is a StandardUnit enum value 4117 StandardUnitSeconds = "Seconds" 4118 4119 // StandardUnitMicroseconds is a StandardUnit enum value 4120 StandardUnitMicroseconds = "Microseconds" 4121 4122 // StandardUnitMilliseconds is a StandardUnit enum value 4123 StandardUnitMilliseconds = "Milliseconds" 4124 4125 // StandardUnitBytes is a StandardUnit enum value 4126 StandardUnitBytes = "Bytes" 4127 4128 // StandardUnitKilobytes is a StandardUnit enum value 4129 StandardUnitKilobytes = "Kilobytes" 4130 4131 // StandardUnitMegabytes is a StandardUnit enum value 4132 StandardUnitMegabytes = "Megabytes" 4133 4134 // StandardUnitGigabytes is a StandardUnit enum value 4135 StandardUnitGigabytes = "Gigabytes" 4136 4137 // StandardUnitTerabytes is a StandardUnit enum value 4138 StandardUnitTerabytes = "Terabytes" 4139 4140 // StandardUnitBits is a StandardUnit enum value 4141 StandardUnitBits = "Bits" 4142 4143 // StandardUnitKilobits is a StandardUnit enum value 4144 StandardUnitKilobits = "Kilobits" 4145 4146 // StandardUnitMegabits is a StandardUnit enum value 4147 StandardUnitMegabits = "Megabits" 4148 4149 // StandardUnitGigabits is a StandardUnit enum value 4150 StandardUnitGigabits = "Gigabits" 4151 4152 // StandardUnitTerabits is a StandardUnit enum value 4153 StandardUnitTerabits = "Terabits" 4154 4155 // StandardUnitPercent is a StandardUnit enum value 4156 StandardUnitPercent = "Percent" 4157 4158 // StandardUnitCount is a StandardUnit enum value 4159 StandardUnitCount = "Count" 4160 4161 // StandardUnitBytesSecond is a StandardUnit enum value 4162 StandardUnitBytesSecond = "Bytes/Second" 4163 4164 // StandardUnitKilobytesSecond is a StandardUnit enum value 4165 StandardUnitKilobytesSecond = "Kilobytes/Second" 4166 4167 // StandardUnitMegabytesSecond is a StandardUnit enum value 4168 StandardUnitMegabytesSecond = "Megabytes/Second" 4169 4170 // StandardUnitGigabytesSecond is a StandardUnit enum value 4171 StandardUnitGigabytesSecond = "Gigabytes/Second" 4172 4173 // StandardUnitTerabytesSecond is a StandardUnit enum value 4174 StandardUnitTerabytesSecond = "Terabytes/Second" 4175 4176 // StandardUnitBitsSecond is a StandardUnit enum value 4177 StandardUnitBitsSecond = "Bits/Second" 4178 4179 // StandardUnitKilobitsSecond is a StandardUnit enum value 4180 StandardUnitKilobitsSecond = "Kilobits/Second" 4181 4182 // StandardUnitMegabitsSecond is a StandardUnit enum value 4183 StandardUnitMegabitsSecond = "Megabits/Second" 4184 4185 // StandardUnitGigabitsSecond is a StandardUnit enum value 4186 StandardUnitGigabitsSecond = "Gigabits/Second" 4187 4188 // StandardUnitTerabitsSecond is a StandardUnit enum value 4189 StandardUnitTerabitsSecond = "Terabits/Second" 4190 4191 // StandardUnitCountSecond is a StandardUnit enum value 4192 StandardUnitCountSecond = "Count/Second" 4193 4194 // StandardUnitNone is a StandardUnit enum value 4195 StandardUnitNone = "None" 4196) 4197 4198const ( 4199 // StateValueOk is a StateValue enum value 4200 StateValueOk = "OK" 4201 4202 // StateValueAlarm is a StateValue enum value 4203 StateValueAlarm = "ALARM" 4204 4205 // StateValueInsufficientData is a StateValue enum value 4206 StateValueInsufficientData = "INSUFFICIENT_DATA" 4207) 4208 4209const ( 4210 // StatisticSampleCount is a Statistic enum value 4211 StatisticSampleCount = "SampleCount" 4212 4213 // StatisticAverage is a Statistic enum value 4214 StatisticAverage = "Average" 4215 4216 // StatisticSum is a Statistic enum value 4217 StatisticSum = "Sum" 4218 4219 // StatisticMinimum is a Statistic enum value 4220 StatisticMinimum = "Minimum" 4221 4222 // StatisticMaximum is a Statistic enum value 4223 StatisticMaximum = "Maximum" 4224) 4225