/
api.go
3540 lines (3072 loc) · 127 KB
/
api.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package autoscalingplans
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
)
const opCreateScalingPlan = "CreateScalingPlan"
// CreateScalingPlanRequest generates a "aws/request.Request" representing the
// client's request for the CreateScalingPlan operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See CreateScalingPlan for more information on using the CreateScalingPlan
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// // Example sending a request using the CreateScalingPlanRequest method.
// req, resp := client.CreateScalingPlanRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/CreateScalingPlan
func (c *AutoScalingPlans) CreateScalingPlanRequest(input *CreateScalingPlanInput) (req *request.Request, output *CreateScalingPlanOutput) {
op := &request.Operation{
Name: opCreateScalingPlan,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateScalingPlanInput{}
}
output = &CreateScalingPlanOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateScalingPlan API operation for AWS Auto Scaling Plans.
//
// Creates a scaling plan.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS Auto Scaling Plans's
// API operation CreateScalingPlan for usage and error information.
//
// Returned Error Types:
//
// - ValidationException
// An exception was thrown for a validation issue. Review the parameters provided.
//
// - LimitExceededException
// Your account exceeded a limit. This exception is thrown when a per-account
// resource limit is exceeded.
//
// - ConcurrentUpdateException
// Concurrent updates caused an exception, for example, if you request an update
// to a scaling plan that already has a pending update.
//
// - InternalServiceException
// The service encountered an internal error.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/CreateScalingPlan
func (c *AutoScalingPlans) CreateScalingPlan(input *CreateScalingPlanInput) (*CreateScalingPlanOutput, error) {
req, out := c.CreateScalingPlanRequest(input)
return out, req.Send()
}
// CreateScalingPlanWithContext is the same as CreateScalingPlan with the addition of
// the ability to pass a context and additional request options.
//
// See CreateScalingPlan for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *AutoScalingPlans) CreateScalingPlanWithContext(ctx aws.Context, input *CreateScalingPlanInput, opts ...request.Option) (*CreateScalingPlanOutput, error) {
req, out := c.CreateScalingPlanRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteScalingPlan = "DeleteScalingPlan"
// DeleteScalingPlanRequest generates a "aws/request.Request" representing the
// client's request for the DeleteScalingPlan operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DeleteScalingPlan for more information on using the DeleteScalingPlan
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// // Example sending a request using the DeleteScalingPlanRequest method.
// req, resp := client.DeleteScalingPlanRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DeleteScalingPlan
func (c *AutoScalingPlans) DeleteScalingPlanRequest(input *DeleteScalingPlanInput) (req *request.Request, output *DeleteScalingPlanOutput) {
op := &request.Operation{
Name: opDeleteScalingPlan,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteScalingPlanInput{}
}
output = &DeleteScalingPlanOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// DeleteScalingPlan API operation for AWS Auto Scaling Plans.
//
// Deletes the specified scaling plan.
//
// Deleting a scaling plan deletes the underlying ScalingInstruction for all
// of the scalable resources that are covered by the plan.
//
// If the plan has launched resources or has scaling activities in progress,
// you must delete those resources separately.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS Auto Scaling Plans's
// API operation DeleteScalingPlan for usage and error information.
//
// Returned Error Types:
//
// - ValidationException
// An exception was thrown for a validation issue. Review the parameters provided.
//
// - ObjectNotFoundException
// The specified object could not be found.
//
// - ConcurrentUpdateException
// Concurrent updates caused an exception, for example, if you request an update
// to a scaling plan that already has a pending update.
//
// - InternalServiceException
// The service encountered an internal error.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DeleteScalingPlan
func (c *AutoScalingPlans) DeleteScalingPlan(input *DeleteScalingPlanInput) (*DeleteScalingPlanOutput, error) {
req, out := c.DeleteScalingPlanRequest(input)
return out, req.Send()
}
// DeleteScalingPlanWithContext is the same as DeleteScalingPlan with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteScalingPlan for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *AutoScalingPlans) DeleteScalingPlanWithContext(ctx aws.Context, input *DeleteScalingPlanInput, opts ...request.Option) (*DeleteScalingPlanOutput, error) {
req, out := c.DeleteScalingPlanRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDescribeScalingPlanResources = "DescribeScalingPlanResources"
// DescribeScalingPlanResourcesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeScalingPlanResources operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DescribeScalingPlanResources for more information on using the DescribeScalingPlanResources
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// // Example sending a request using the DescribeScalingPlanResourcesRequest method.
// req, resp := client.DescribeScalingPlanResourcesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DescribeScalingPlanResources
func (c *AutoScalingPlans) DescribeScalingPlanResourcesRequest(input *DescribeScalingPlanResourcesInput) (req *request.Request, output *DescribeScalingPlanResourcesOutput) {
op := &request.Operation{
Name: opDescribeScalingPlanResources,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeScalingPlanResourcesInput{}
}
output = &DescribeScalingPlanResourcesOutput{}
req = c.newRequest(op, input, output)
return
}
// DescribeScalingPlanResources API operation for AWS Auto Scaling Plans.
//
// Describes the scalable resources in the specified scaling plan.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS Auto Scaling Plans's
// API operation DescribeScalingPlanResources for usage and error information.
//
// Returned Error Types:
//
// - ValidationException
// An exception was thrown for a validation issue. Review the parameters provided.
//
// - InvalidNextTokenException
// The token provided is not valid.
//
// - ConcurrentUpdateException
// Concurrent updates caused an exception, for example, if you request an update
// to a scaling plan that already has a pending update.
//
// - InternalServiceException
// The service encountered an internal error.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DescribeScalingPlanResources
func (c *AutoScalingPlans) DescribeScalingPlanResources(input *DescribeScalingPlanResourcesInput) (*DescribeScalingPlanResourcesOutput, error) {
req, out := c.DescribeScalingPlanResourcesRequest(input)
return out, req.Send()
}
// DescribeScalingPlanResourcesWithContext is the same as DescribeScalingPlanResources with the addition of
// the ability to pass a context and additional request options.
//
// See DescribeScalingPlanResources for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *AutoScalingPlans) DescribeScalingPlanResourcesWithContext(ctx aws.Context, input *DescribeScalingPlanResourcesInput, opts ...request.Option) (*DescribeScalingPlanResourcesOutput, error) {
req, out := c.DescribeScalingPlanResourcesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDescribeScalingPlans = "DescribeScalingPlans"
// DescribeScalingPlansRequest generates a "aws/request.Request" representing the
// client's request for the DescribeScalingPlans operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DescribeScalingPlans for more information on using the DescribeScalingPlans
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// // Example sending a request using the DescribeScalingPlansRequest method.
// req, resp := client.DescribeScalingPlansRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DescribeScalingPlans
func (c *AutoScalingPlans) DescribeScalingPlansRequest(input *DescribeScalingPlansInput) (req *request.Request, output *DescribeScalingPlansOutput) {
op := &request.Operation{
Name: opDescribeScalingPlans,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeScalingPlansInput{}
}
output = &DescribeScalingPlansOutput{}
req = c.newRequest(op, input, output)
return
}
// DescribeScalingPlans API operation for AWS Auto Scaling Plans.
//
// Describes one or more of your scaling plans.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS Auto Scaling Plans's
// API operation DescribeScalingPlans for usage and error information.
//
// Returned Error Types:
//
// - ValidationException
// An exception was thrown for a validation issue. Review the parameters provided.
//
// - InvalidNextTokenException
// The token provided is not valid.
//
// - ConcurrentUpdateException
// Concurrent updates caused an exception, for example, if you request an update
// to a scaling plan that already has a pending update.
//
// - InternalServiceException
// The service encountered an internal error.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DescribeScalingPlans
func (c *AutoScalingPlans) DescribeScalingPlans(input *DescribeScalingPlansInput) (*DescribeScalingPlansOutput, error) {
req, out := c.DescribeScalingPlansRequest(input)
return out, req.Send()
}
// DescribeScalingPlansWithContext is the same as DescribeScalingPlans with the addition of
// the ability to pass a context and additional request options.
//
// See DescribeScalingPlans for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *AutoScalingPlans) DescribeScalingPlansWithContext(ctx aws.Context, input *DescribeScalingPlansInput, opts ...request.Option) (*DescribeScalingPlansOutput, error) {
req, out := c.DescribeScalingPlansRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opGetScalingPlanResourceForecastData = "GetScalingPlanResourceForecastData"
// GetScalingPlanResourceForecastDataRequest generates a "aws/request.Request" representing the
// client's request for the GetScalingPlanResourceForecastData operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GetScalingPlanResourceForecastData for more information on using the GetScalingPlanResourceForecastData
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// // Example sending a request using the GetScalingPlanResourceForecastDataRequest method.
// req, resp := client.GetScalingPlanResourceForecastDataRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/GetScalingPlanResourceForecastData
func (c *AutoScalingPlans) GetScalingPlanResourceForecastDataRequest(input *GetScalingPlanResourceForecastDataInput) (req *request.Request, output *GetScalingPlanResourceForecastDataOutput) {
op := &request.Operation{
Name: opGetScalingPlanResourceForecastData,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &GetScalingPlanResourceForecastDataInput{}
}
output = &GetScalingPlanResourceForecastDataOutput{}
req = c.newRequest(op, input, output)
return
}
// GetScalingPlanResourceForecastData API operation for AWS Auto Scaling Plans.
//
// Retrieves the forecast data for a scalable resource.
//
// Capacity forecasts are represented as predicted values, or data points, that
// are calculated using historical data points from a specified CloudWatch load
// metric. Data points are available for up to 56 days.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS Auto Scaling Plans's
// API operation GetScalingPlanResourceForecastData for usage and error information.
//
// Returned Error Types:
//
// - ValidationException
// An exception was thrown for a validation issue. Review the parameters provided.
//
// - InternalServiceException
// The service encountered an internal error.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/GetScalingPlanResourceForecastData
func (c *AutoScalingPlans) GetScalingPlanResourceForecastData(input *GetScalingPlanResourceForecastDataInput) (*GetScalingPlanResourceForecastDataOutput, error) {
req, out := c.GetScalingPlanResourceForecastDataRequest(input)
return out, req.Send()
}
// GetScalingPlanResourceForecastDataWithContext is the same as GetScalingPlanResourceForecastData with the addition of
// the ability to pass a context and additional request options.
//
// See GetScalingPlanResourceForecastData for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *AutoScalingPlans) GetScalingPlanResourceForecastDataWithContext(ctx aws.Context, input *GetScalingPlanResourceForecastDataInput, opts ...request.Option) (*GetScalingPlanResourceForecastDataOutput, error) {
req, out := c.GetScalingPlanResourceForecastDataRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opUpdateScalingPlan = "UpdateScalingPlan"
// UpdateScalingPlanRequest generates a "aws/request.Request" representing the
// client's request for the UpdateScalingPlan operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See UpdateScalingPlan for more information on using the UpdateScalingPlan
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// // Example sending a request using the UpdateScalingPlanRequest method.
// req, resp := client.UpdateScalingPlanRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/UpdateScalingPlan
func (c *AutoScalingPlans) UpdateScalingPlanRequest(input *UpdateScalingPlanInput) (req *request.Request, output *UpdateScalingPlanOutput) {
op := &request.Operation{
Name: opUpdateScalingPlan,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &UpdateScalingPlanInput{}
}
output = &UpdateScalingPlanOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// UpdateScalingPlan API operation for AWS Auto Scaling Plans.
//
// Updates the specified scaling plan.
//
// You cannot update a scaling plan if it is in the process of being created,
// updated, or deleted.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS Auto Scaling Plans's
// API operation UpdateScalingPlan for usage and error information.
//
// Returned Error Types:
//
// - ValidationException
// An exception was thrown for a validation issue. Review the parameters provided.
//
// - ConcurrentUpdateException
// Concurrent updates caused an exception, for example, if you request an update
// to a scaling plan that already has a pending update.
//
// - InternalServiceException
// The service encountered an internal error.
//
// - ObjectNotFoundException
// The specified object could not be found.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/UpdateScalingPlan
func (c *AutoScalingPlans) UpdateScalingPlan(input *UpdateScalingPlanInput) (*UpdateScalingPlanOutput, error) {
req, out := c.UpdateScalingPlanRequest(input)
return out, req.Send()
}
// UpdateScalingPlanWithContext is the same as UpdateScalingPlan with the addition of
// the ability to pass a context and additional request options.
//
// See UpdateScalingPlan for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *AutoScalingPlans) UpdateScalingPlanWithContext(ctx aws.Context, input *UpdateScalingPlanInput, opts ...request.Option) (*UpdateScalingPlanOutput, error) {
req, out := c.UpdateScalingPlanRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// Represents an application source.
type ApplicationSource struct {
_ struct{} `type:"structure"`
// The Amazon Resource Name (ARN) of a AWS CloudFormation stack.
CloudFormationStackARN *string `type:"string"`
// A set of tags (up to 50).
TagFilters []*TagFilter `type:"list"`
}
// String returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s ApplicationSource) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s ApplicationSource) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ApplicationSource) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ApplicationSource"}
if s.TagFilters != nil {
for i, v := range s.TagFilters {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagFilters", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetCloudFormationStackARN sets the CloudFormationStackARN field's value.
func (s *ApplicationSource) SetCloudFormationStackARN(v string) *ApplicationSource {
s.CloudFormationStackARN = &v
return s
}
// SetTagFilters sets the TagFilters field's value.
func (s *ApplicationSource) SetTagFilters(v []*TagFilter) *ApplicationSource {
s.TagFilters = v
return s
}
// Concurrent updates caused an exception, for example, if you request an update
// to a scaling plan that already has a pending update.
type ConcurrentUpdateException struct {
_ struct{} `type:"structure"`
RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
Message_ *string `locationName:"Message" type:"string"`
}
// String returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s ConcurrentUpdateException) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s ConcurrentUpdateException) GoString() string {
return s.String()
}
func newErrorConcurrentUpdateException(v protocol.ResponseMetadata) error {
return &ConcurrentUpdateException{
RespMetadata: v,
}
}
// Code returns the exception type name.
func (s *ConcurrentUpdateException) Code() string {
return "ConcurrentUpdateException"
}
// Message returns the exception's message.
func (s *ConcurrentUpdateException) Message() string {
if s.Message_ != nil {
return *s.Message_
}
return ""
}
// OrigErr always returns nil, satisfies awserr.Error interface.
func (s *ConcurrentUpdateException) OrigErr() error {
return nil
}
func (s *ConcurrentUpdateException) Error() string {
return fmt.Sprintf("%s: %s", s.Code(), s.Message())
}
// Status code returns the HTTP status code for the request's response error.
func (s *ConcurrentUpdateException) StatusCode() int {
return s.RespMetadata.StatusCode
}
// RequestID returns the service's response RequestID for request.
func (s *ConcurrentUpdateException) RequestID() string {
return s.RespMetadata.RequestID
}
type CreateScalingPlanInput struct {
_ struct{} `type:"structure"`
// A CloudFormation stack or set of tags. You can create one scaling plan per
// application source.
//
// For more information, see ApplicationSource (https://docs.aws.amazon.com/autoscaling/plans/APIReference/API_ApplicationSource.html)
// in the AWS Auto Scaling API Reference.
//
// ApplicationSource is a required field
ApplicationSource *ApplicationSource `type:"structure" required:"true"`
// The scaling instructions.
//
// For more information, see ScalingInstruction (https://docs.aws.amazon.com/autoscaling/plans/APIReference/API_ScalingInstruction.html)
// in the AWS Auto Scaling API Reference.
//
// ScalingInstructions is a required field
ScalingInstructions []*ScalingInstruction `type:"list" required:"true"`
// The name of the scaling plan. Names cannot contain vertical bars, colons,
// or forward slashes.
//
// ScalingPlanName is a required field
ScalingPlanName *string `min:"1" type:"string" required:"true"`
}
// String returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s CreateScalingPlanInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s CreateScalingPlanInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateScalingPlanInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateScalingPlanInput"}
if s.ApplicationSource == nil {
invalidParams.Add(request.NewErrParamRequired("ApplicationSource"))
}
if s.ScalingInstructions == nil {
invalidParams.Add(request.NewErrParamRequired("ScalingInstructions"))
}
if s.ScalingPlanName == nil {
invalidParams.Add(request.NewErrParamRequired("ScalingPlanName"))
}
if s.ScalingPlanName != nil && len(*s.ScalingPlanName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ScalingPlanName", 1))
}
if s.ApplicationSource != nil {
if err := s.ApplicationSource.Validate(); err != nil {
invalidParams.AddNested("ApplicationSource", err.(request.ErrInvalidParams))
}
}
if s.ScalingInstructions != nil {
for i, v := range s.ScalingInstructions {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ScalingInstructions", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetApplicationSource sets the ApplicationSource field's value.
func (s *CreateScalingPlanInput) SetApplicationSource(v *ApplicationSource) *CreateScalingPlanInput {
s.ApplicationSource = v
return s
}
// SetScalingInstructions sets the ScalingInstructions field's value.
func (s *CreateScalingPlanInput) SetScalingInstructions(v []*ScalingInstruction) *CreateScalingPlanInput {
s.ScalingInstructions = v
return s
}
// SetScalingPlanName sets the ScalingPlanName field's value.
func (s *CreateScalingPlanInput) SetScalingPlanName(v string) *CreateScalingPlanInput {
s.ScalingPlanName = &v
return s
}
type CreateScalingPlanOutput struct {
_ struct{} `type:"structure"`
// The version number of the scaling plan. This value is always 1. Currently,
// you cannot have multiple scaling plan versions.
//
// ScalingPlanVersion is a required field
ScalingPlanVersion *int64 `type:"long" required:"true"`
}
// String returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s CreateScalingPlanOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s CreateScalingPlanOutput) GoString() string {
return s.String()
}
// SetScalingPlanVersion sets the ScalingPlanVersion field's value.
func (s *CreateScalingPlanOutput) SetScalingPlanVersion(v int64) *CreateScalingPlanOutput {
s.ScalingPlanVersion = &v
return s
}
// Represents a CloudWatch metric of your choosing that can be used for predictive
// scaling.
//
// For predictive scaling to work with a customized load metric specification,
// AWS Auto Scaling needs access to the Sum and Average statistics that CloudWatch
// computes from metric data.
//
// When you choose a load metric, make sure that the required Sum and Average
// statistics for your metric are available in CloudWatch and that they provide
// relevant data for predictive scaling. The Sum statistic must represent the
// total load on the resource, and the Average statistic must represent the
// average load per capacity unit of the resource. For example, there is a metric
// that counts the number of requests processed by your Auto Scaling group.
// If the Sum statistic represents the total request count processed by the
// group, then the Average statistic for the specified metric must represent
// the average request count processed by each instance of the group.
//
// If you publish your own metrics, you can aggregate the data points at a given
// interval and then publish the aggregated data points to CloudWatch. Before
// AWS Auto Scaling generates the forecast, it sums up all the metric data points
// that occurred within each hour to match the granularity period that is used
// in the forecast (60 minutes).
//
// For information about terminology, available metrics, or how to publish new
// metrics, see Amazon CloudWatch Concepts (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html)
// in the Amazon CloudWatch User Guide.
//
// After creating your scaling plan, you can use the AWS Auto Scaling console
// to visualize forecasts for the specified metric. For more information, see
// View Scaling Information for a Resource (https://docs.aws.amazon.com/autoscaling/plans/userguide/gs-create-scaling-plan.html#gs-view-resource)
// in the AWS Auto Scaling User Guide.
type CustomizedLoadMetricSpecification struct {
_ struct{} `type:"structure"`
// The dimensions of the metric.
//
// Conditional: If you published your metric with dimensions, you must specify
// the same dimensions in your customized load metric specification.
Dimensions []*MetricDimension `type:"list"`
// The name of the metric.
//
// MetricName is a required field
MetricName *string `type:"string" required:"true"`
// The namespace of the metric.
//
// Namespace is a required field
Namespace *string `type:"string" required:"true"`
// The statistic of the metric. The only valid value is Sum.
//
// Statistic is a required field
Statistic *string `type:"string" required:"true" enum:"MetricStatistic"`
// The unit of the metric.
Unit *string `type:"string"`
}
// String returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s CustomizedLoadMetricSpecification) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s CustomizedLoadMetricSpecification) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CustomizedLoadMetricSpecification) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CustomizedLoadMetricSpecification"}
if s.MetricName == nil {
invalidParams.Add(request.NewErrParamRequired("MetricName"))
}
if s.Namespace == nil {
invalidParams.Add(request.NewErrParamRequired("Namespace"))
}
if s.Statistic == nil {
invalidParams.Add(request.NewErrParamRequired("Statistic"))
}
if s.Dimensions != nil {
for i, v := range s.Dimensions {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetDimensions sets the Dimensions field's value.
func (s *CustomizedLoadMetricSpecification) SetDimensions(v []*MetricDimension) *CustomizedLoadMetricSpecification {
s.Dimensions = v
return s
}
// SetMetricName sets the MetricName field's value.
func (s *CustomizedLoadMetricSpecification) SetMetricName(v string) *CustomizedLoadMetricSpecification {
s.MetricName = &v
return s
}
// SetNamespace sets the Namespace field's value.
func (s *CustomizedLoadMetricSpecification) SetNamespace(v string) *CustomizedLoadMetricSpecification {
s.Namespace = &v
return s
}
// SetStatistic sets the Statistic field's value.
func (s *CustomizedLoadMetricSpecification) SetStatistic(v string) *CustomizedLoadMetricSpecification {
s.Statistic = &v
return s
}
// SetUnit sets the Unit field's value.
func (s *CustomizedLoadMetricSpecification) SetUnit(v string) *CustomizedLoadMetricSpecification {
s.Unit = &v
return s
}
// Represents a CloudWatch metric of your choosing that can be used for dynamic
// scaling as part of a target tracking scaling policy.
//
// To create your customized scaling metric specification:
//
// - Add values for each required parameter from CloudWatch. You can use
// an existing metric, or a new metric that you create. To use your own metric,
// you must first publish the metric to CloudWatch. For more information,
// see Publish Custom Metrics (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html)
// in the Amazon CloudWatch User Guide.
//
// - Choose a metric that changes proportionally with capacity. The value
// of the metric should increase or decrease in inverse proportion to the
// number of capacity units. That is, the value of the metric should decrease
// when capacity increases.
//
// For information about terminology, available metrics, or how to publish new
// metrics, see Amazon CloudWatch Concepts (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html)
// in the Amazon CloudWatch User Guide.
type CustomizedScalingMetricSpecification struct {
_ struct{} `type:"structure"`
// The dimensions of the metric.
//
// Conditional: If you published your metric with dimensions, you must specify
// the same dimensions in your customized scaling metric specification.
Dimensions []*MetricDimension `type:"list"`
// The name of the metric.
//
// MetricName is a required field
MetricName *string `type:"string" required:"true"`
// The namespace of the metric.
//
// Namespace is a required field
Namespace *string `type:"string" required:"true"`
// The statistic of the metric.
//
// Statistic is a required field
Statistic *string `type:"string" required:"true" enum:"MetricStatistic"`
// The unit of the metric.
Unit *string `type:"string"`
}