forked from aws/aws-sdk-go-v2
/
api.go
1476 lines (1225 loc) · 48.1 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-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
const opCreateScalingPlan = "CreateScalingPlan"
// CreateScalingPlanRequest is a API request type for the CreateScalingPlan API operation.
type CreateScalingPlanRequest struct {
*aws.Request
Input *CreateScalingPlanInput
Copy func(*CreateScalingPlanInput) CreateScalingPlanRequest
}
// Send marshals and sends the CreateScalingPlan API request.
func (r CreateScalingPlanRequest) Send() (*CreateScalingPlanOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*CreateScalingPlanOutput), nil
}
// CreateScalingPlanRequest returns a request value for making API operation for
// AWS Auto Scaling Plans.
//
// Creates a scaling plan.
//
// A scaling plan contains a set of instructions used to configure dynamic scaling
// for the scalable resources in your application. AWS Auto Scaling creates
// target tracking scaling policies based on the scaling instructions in your
// scaling plan.
//
// // Example sending a request using the CreateScalingPlanRequest method.
// req := client.CreateScalingPlanRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/CreateScalingPlan
func (c *AutoScalingPlans) CreateScalingPlanRequest(input *CreateScalingPlanInput) CreateScalingPlanRequest {
op := &aws.Operation{
Name: opCreateScalingPlan,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateScalingPlanInput{}
}
output := &CreateScalingPlanOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return CreateScalingPlanRequest{Request: req, Input: input, Copy: c.CreateScalingPlanRequest}
}
const opDeleteScalingPlan = "DeleteScalingPlan"
// DeleteScalingPlanRequest is a API request type for the DeleteScalingPlan API operation.
type DeleteScalingPlanRequest struct {
*aws.Request
Input *DeleteScalingPlanInput
Copy func(*DeleteScalingPlanInput) DeleteScalingPlanRequest
}
// Send marshals and sends the DeleteScalingPlan API request.
func (r DeleteScalingPlanRequest) Send() (*DeleteScalingPlanOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteScalingPlanOutput), nil
}
// DeleteScalingPlanRequest returns a request value for making API operation for
// AWS Auto Scaling Plans.
//
// Deletes the specified scaling plan.
//
// // Example sending a request using the DeleteScalingPlanRequest method.
// req := client.DeleteScalingPlanRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DeleteScalingPlan
func (c *AutoScalingPlans) DeleteScalingPlanRequest(input *DeleteScalingPlanInput) DeleteScalingPlanRequest {
op := &aws.Operation{
Name: opDeleteScalingPlan,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteScalingPlanInput{}
}
output := &DeleteScalingPlanOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DeleteScalingPlanRequest{Request: req, Input: input, Copy: c.DeleteScalingPlanRequest}
}
const opDescribeScalingPlanResources = "DescribeScalingPlanResources"
// DescribeScalingPlanResourcesRequest is a API request type for the DescribeScalingPlanResources API operation.
type DescribeScalingPlanResourcesRequest struct {
*aws.Request
Input *DescribeScalingPlanResourcesInput
Copy func(*DescribeScalingPlanResourcesInput) DescribeScalingPlanResourcesRequest
}
// Send marshals and sends the DescribeScalingPlanResources API request.
func (r DescribeScalingPlanResourcesRequest) Send() (*DescribeScalingPlanResourcesOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DescribeScalingPlanResourcesOutput), nil
}
// DescribeScalingPlanResourcesRequest returns a request value for making API operation for
// AWS Auto Scaling Plans.
//
// Describes the scalable resources in the specified scaling plan.
//
// // Example sending a request using the DescribeScalingPlanResourcesRequest method.
// req := client.DescribeScalingPlanResourcesRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DescribeScalingPlanResources
func (c *AutoScalingPlans) DescribeScalingPlanResourcesRequest(input *DescribeScalingPlanResourcesInput) DescribeScalingPlanResourcesRequest {
op := &aws.Operation{
Name: opDescribeScalingPlanResources,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeScalingPlanResourcesInput{}
}
output := &DescribeScalingPlanResourcesOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DescribeScalingPlanResourcesRequest{Request: req, Input: input, Copy: c.DescribeScalingPlanResourcesRequest}
}
const opDescribeScalingPlans = "DescribeScalingPlans"
// DescribeScalingPlansRequest is a API request type for the DescribeScalingPlans API operation.
type DescribeScalingPlansRequest struct {
*aws.Request
Input *DescribeScalingPlansInput
Copy func(*DescribeScalingPlansInput) DescribeScalingPlansRequest
}
// Send marshals and sends the DescribeScalingPlans API request.
func (r DescribeScalingPlansRequest) Send() (*DescribeScalingPlansOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DescribeScalingPlansOutput), nil
}
// DescribeScalingPlansRequest returns a request value for making API operation for
// AWS Auto Scaling Plans.
//
// Describes the specified scaling plans or all of your scaling plans.
//
// // Example sending a request using the DescribeScalingPlansRequest method.
// req := client.DescribeScalingPlansRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DescribeScalingPlans
func (c *AutoScalingPlans) DescribeScalingPlansRequest(input *DescribeScalingPlansInput) DescribeScalingPlansRequest {
op := &aws.Operation{
Name: opDescribeScalingPlans,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeScalingPlansInput{}
}
output := &DescribeScalingPlansOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DescribeScalingPlansRequest{Request: req, Input: input, Copy: c.DescribeScalingPlansRequest}
}
const opUpdateScalingPlan = "UpdateScalingPlan"
// UpdateScalingPlanRequest is a API request type for the UpdateScalingPlan API operation.
type UpdateScalingPlanRequest struct {
*aws.Request
Input *UpdateScalingPlanInput
Copy func(*UpdateScalingPlanInput) UpdateScalingPlanRequest
}
// Send marshals and sends the UpdateScalingPlan API request.
func (r UpdateScalingPlanRequest) Send() (*UpdateScalingPlanOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*UpdateScalingPlanOutput), nil
}
// UpdateScalingPlanRequest returns a request value for making API operation for
// AWS Auto Scaling Plans.
//
// Updates the scaling plan for the specified scaling plan.
//
// You cannot update a scaling plan if it is in the process of being created,
// updated, or deleted.
//
// // Example sending a request using the UpdateScalingPlanRequest method.
// req := client.UpdateScalingPlanRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/UpdateScalingPlan
func (c *AutoScalingPlans) UpdateScalingPlanRequest(input *UpdateScalingPlanInput) UpdateScalingPlanRequest {
op := &aws.Operation{
Name: opUpdateScalingPlan,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &UpdateScalingPlanInput{}
}
output := &UpdateScalingPlanOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return UpdateScalingPlanRequest{Request: req, Input: input, Copy: c.UpdateScalingPlanRequest}
}
// Represents an application source.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/ApplicationSource
type ApplicationSource struct {
_ struct{} `type:"structure"`
// The Amazon Resource Name (ARN) of a CloudFormation stack.
CloudFormationStackARN *string `type:"string"`
// A set of tags (up to 50).
TagFilters []TagFilter `type:"list"`
}
// String returns the string representation
func (s ApplicationSource) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
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 := aws.ErrInvalidParams{Context: "ApplicationSource"}
if s.TagFilters != nil {
for i, v := range s.TagFilters {
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagFilters", i), err.(aws.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/CreateScalingPlanRequest
type CreateScalingPlanInput struct {
_ struct{} `type:"structure"`
// A CloudFormation stack or set of tags. You can create one scaling plan per
// application source.
//
// ApplicationSource is a required field
ApplicationSource *ApplicationSource `type:"structure" required:"true"`
// The scaling instructions.
//
// 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
func (s CreateScalingPlanInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
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 := aws.ErrInvalidParams{Context: "CreateScalingPlanInput"}
if s.ApplicationSource == nil {
invalidParams.Add(aws.NewErrParamRequired("ApplicationSource"))
}
if s.ScalingInstructions == nil {
invalidParams.Add(aws.NewErrParamRequired("ScalingInstructions"))
}
if s.ScalingPlanName == nil {
invalidParams.Add(aws.NewErrParamRequired("ScalingPlanName"))
}
if s.ScalingPlanName != nil && len(*s.ScalingPlanName) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("ScalingPlanName", 1))
}
if s.ApplicationSource != nil {
if err := s.ApplicationSource.Validate(); err != nil {
invalidParams.AddNested("ApplicationSource", err.(aws.ErrInvalidParams))
}
}
if s.ScalingInstructions != nil {
for i, v := range s.ScalingInstructions {
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ScalingInstructions", i), err.(aws.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/CreateScalingPlanResponse
type CreateScalingPlanOutput struct {
_ struct{} `type:"structure"`
responseMetadata aws.Response
// The version of the scaling plan. This value is always 1.
//
// ScalingPlanVersion is a required field
ScalingPlanVersion *int64 `type:"long" required:"true"`
}
// String returns the string representation
func (s CreateScalingPlanOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s CreateScalingPlanOutput) GoString() string {
return s.String()
}
// SDKResponseMetdata return sthe response metadata for the API.
func (s CreateScalingPlanOutput) SDKResponseMetadata() aws.Response {
return s.responseMetadata
}
// Represents a customized metric for a target tracking policy.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/CustomizedScalingMetricSpecification
type CustomizedScalingMetricSpecification struct {
_ struct{} `type:"structure"`
// The dimensions of the metric.
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 MetricStatistic `type:"string" required:"true" enum:"true"`
// The unit of the metric.
Unit *string `type:"string"`
}
// String returns the string representation
func (s CustomizedScalingMetricSpecification) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s CustomizedScalingMetricSpecification) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CustomizedScalingMetricSpecification) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "CustomizedScalingMetricSpecification"}
if s.MetricName == nil {
invalidParams.Add(aws.NewErrParamRequired("MetricName"))
}
if s.Namespace == nil {
invalidParams.Add(aws.NewErrParamRequired("Namespace"))
}
if len(s.Statistic) == 0 {
invalidParams.Add(aws.NewErrParamRequired("Statistic"))
}
if s.Dimensions != nil {
for i, v := range s.Dimensions {
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(aws.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DeleteScalingPlanRequest
type DeleteScalingPlanInput struct {
_ struct{} `type:"structure"`
// The name of the scaling plan.
//
// ScalingPlanName is a required field
ScalingPlanName *string `min:"1" type:"string" required:"true"`
// The version of the scaling plan.
//
// ScalingPlanVersion is a required field
ScalingPlanVersion *int64 `type:"long" required:"true"`
}
// String returns the string representation
func (s DeleteScalingPlanInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DeleteScalingPlanInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteScalingPlanInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "DeleteScalingPlanInput"}
if s.ScalingPlanName == nil {
invalidParams.Add(aws.NewErrParamRequired("ScalingPlanName"))
}
if s.ScalingPlanName != nil && len(*s.ScalingPlanName) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("ScalingPlanName", 1))
}
if s.ScalingPlanVersion == nil {
invalidParams.Add(aws.NewErrParamRequired("ScalingPlanVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DeleteScalingPlanResponse
type DeleteScalingPlanOutput struct {
_ struct{} `type:"structure"`
responseMetadata aws.Response
}
// String returns the string representation
func (s DeleteScalingPlanOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DeleteScalingPlanOutput) GoString() string {
return s.String()
}
// SDKResponseMetdata return sthe response metadata for the API.
func (s DeleteScalingPlanOutput) SDKResponseMetadata() aws.Response {
return s.responseMetadata
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DescribeScalingPlanResourcesRequest
type DescribeScalingPlanResourcesInput struct {
_ struct{} `type:"structure"`
// The maximum number of scalable resources to return. This value can be between
// 1 and 50. The default value is 50.
MaxResults *int64 `type:"integer"`
// The token for the next set of results.
NextToken *string `type:"string"`
// The name of the scaling plan.
//
// ScalingPlanName is a required field
ScalingPlanName *string `min:"1" type:"string" required:"true"`
// The version of the scaling plan.
//
// ScalingPlanVersion is a required field
ScalingPlanVersion *int64 `type:"long" required:"true"`
}
// String returns the string representation
func (s DescribeScalingPlanResourcesInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DescribeScalingPlanResourcesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeScalingPlanResourcesInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "DescribeScalingPlanResourcesInput"}
if s.ScalingPlanName == nil {
invalidParams.Add(aws.NewErrParamRequired("ScalingPlanName"))
}
if s.ScalingPlanName != nil && len(*s.ScalingPlanName) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("ScalingPlanName", 1))
}
if s.ScalingPlanVersion == nil {
invalidParams.Add(aws.NewErrParamRequired("ScalingPlanVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DescribeScalingPlanResourcesResponse
type DescribeScalingPlanResourcesOutput struct {
_ struct{} `type:"structure"`
responseMetadata aws.Response
// The token required to get the next set of results. This value is null if
// there are no more results to return.
NextToken *string `type:"string"`
// Information about the scalable resources.
ScalingPlanResources []ScalingPlanResource `type:"list"`
}
// String returns the string representation
func (s DescribeScalingPlanResourcesOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DescribeScalingPlanResourcesOutput) GoString() string {
return s.String()
}
// SDKResponseMetdata return sthe response metadata for the API.
func (s DescribeScalingPlanResourcesOutput) SDKResponseMetadata() aws.Response {
return s.responseMetadata
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DescribeScalingPlansRequest
type DescribeScalingPlansInput struct {
_ struct{} `type:"structure"`
// The sources for the applications (up to 10). If you specify scaling plan
// names, you cannot specify application sources.
ApplicationSources []ApplicationSource `type:"list"`
// The maximum number of scalable resources to return. This value can be between
// 1 and 50. The default value is 50.
MaxResults *int64 `type:"integer"`
// The token for the next set of results.
NextToken *string `type:"string"`
// The names of the scaling plans (up to 10). If you specify application sources,
// you cannot specify scaling plan names.
ScalingPlanNames []string `type:"list"`
// The version of the scaling plan. If you specify a scaling plan version, you
// must also specify a scaling plan name.
ScalingPlanVersion *int64 `type:"long"`
}
// String returns the string representation
func (s DescribeScalingPlansInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DescribeScalingPlansInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeScalingPlansInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "DescribeScalingPlansInput"}
if s.ApplicationSources != nil {
for i, v := range s.ApplicationSources {
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ApplicationSources", i), err.(aws.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DescribeScalingPlansResponse
type DescribeScalingPlansOutput struct {
_ struct{} `type:"structure"`
responseMetadata aws.Response
// The token required to get the next set of results. This value is null if
// there are no more results to return.
NextToken *string `type:"string"`
// Information about the scaling plans.
ScalingPlans []ScalingPlan `type:"list"`
}
// String returns the string representation
func (s DescribeScalingPlansOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DescribeScalingPlansOutput) GoString() string {
return s.String()
}
// SDKResponseMetdata return sthe response metadata for the API.
func (s DescribeScalingPlansOutput) SDKResponseMetadata() aws.Response {
return s.responseMetadata
}
// Represents a dimension for a customized metric.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/MetricDimension
type MetricDimension struct {
_ struct{} `type:"structure"`
// The name of the dimension.
//
// Name is a required field
Name *string `type:"string" required:"true"`
// The value of the dimension.
//
// Value is a required field
Value *string `type:"string" required:"true"`
}
// String returns the string representation
func (s MetricDimension) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s MetricDimension) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *MetricDimension) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "MetricDimension"}
if s.Name == nil {
invalidParams.Add(aws.NewErrParamRequired("Name"))
}
if s.Value == nil {
invalidParams.Add(aws.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents a predefined metric for a target tracking policy.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/PredefinedScalingMetricSpecification
type PredefinedScalingMetricSpecification struct {
_ struct{} `type:"structure"`
// The metric type. The ALBRequestCountPerTarget metric type applies only to
// Auto Scaling groups, Sport Fleet requests, and ECS services.
//
// PredefinedScalingMetricType is a required field
PredefinedScalingMetricType ScalingMetricType `type:"string" required:"true" enum:"true"`
// Identifies the resource associated with the metric type. You can't specify
// a resource label unless the metric type is ALBRequestCountPerTarget and there
// is a target group for an Application Load Balancer attached to the Auto Scaling
// group, Spot Fleet request, or ECS service.
//
// The format is app/<load-balancer-name>/<load-balancer-id>/targetgroup/<target-group-name>/<target-group-id>,
// where:
//
// * app/<load-balancer-name>/<load-balancer-id> is the final portion of
// the load balancer ARN
//
// * targetgroup/<target-group-name>/<target-group-id> is the final portion
// of the target group ARN.
ResourceLabel *string `min:"1" type:"string"`
}
// String returns the string representation
func (s PredefinedScalingMetricSpecification) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s PredefinedScalingMetricSpecification) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PredefinedScalingMetricSpecification) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "PredefinedScalingMetricSpecification"}
if len(s.PredefinedScalingMetricType) == 0 {
invalidParams.Add(aws.NewErrParamRequired("PredefinedScalingMetricType"))
}
if s.ResourceLabel != nil && len(*s.ResourceLabel) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("ResourceLabel", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Specifies the scaling configuration for a scalable resource.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/ScalingInstruction
type ScalingInstruction struct {
_ struct{} `type:"structure"`
// The maximum value to scale to in response to a scale out event.
//
// MaxCapacity is a required field
MaxCapacity *int64 `type:"integer" required:"true"`
// The minimum value to scale to in response to a scale in event.
//
// MinCapacity is a required field
MinCapacity *int64 `type:"integer" required:"true"`
// The ID of the resource. This string consists of the resource type and unique
// identifier.
//
// * Auto Scaling group - The resource type is autoScalingGroup and the unique
// identifier is the name of the Auto Scaling group. Example: autoScalingGroup/my-asg.
//
// * ECS service - The resource type is service and the unique identifier
// is the cluster name and service name. Example: service/default/sample-webapp.
//
// * Spot fleet request - The resource type is spot-fleet-request and the
// unique identifier is the Spot fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE.
//
// * DynamoDB table - The resource type is table and the unique identifier
// is the resource ID. Example: table/my-table.
//
// * DynamoDB global secondary index - The resource type is index and the
// unique identifier is the resource ID. Example: table/my-table/index/my-table-index.
//
// * Aurora DB cluster - The resource type is cluster and the unique identifier
// is the cluster name. Example: cluster:my-db-cluster.
//
// ResourceId is a required field
ResourceId *string `min:"1" type:"string" required:"true"`
// The scalable dimension associated with the resource.
//
// * autoscaling:autoScalingGroup:DesiredCapacity - The desired capacity
// of an Auto Scaling group.
//
// * ecs:service:DesiredCount - The desired task count of an ECS service.
//
// * ec2:spot-fleet-request:TargetCapacity - The target capacity of a Spot
// fleet request.
//
// * dynamodb:table:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB table.
//
// * dynamodb:table:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB table.
//
// * dynamodb:index:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB global secondary index.
//
// * dynamodb:index:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB global secondary index.
//
// * rds:cluster:ReadReplicaCount - The count of Aurora Replicas in an Aurora
// DB cluster. Available for Aurora MySQL-compatible edition.
//
// ScalableDimension is a required field
ScalableDimension ScalableDimension `type:"string" required:"true" enum:"true"`
// The namespace of the AWS service.
//
// ServiceNamespace is a required field
ServiceNamespace ServiceNamespace `type:"string" required:"true" enum:"true"`
// The target tracking scaling policies (up to 10).
//
// TargetTrackingConfigurations is a required field
TargetTrackingConfigurations []TargetTrackingConfiguration `type:"list" required:"true"`
}
// String returns the string representation
func (s ScalingInstruction) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s ScalingInstruction) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ScalingInstruction) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "ScalingInstruction"}
if s.MaxCapacity == nil {
invalidParams.Add(aws.NewErrParamRequired("MaxCapacity"))
}
if s.MinCapacity == nil {
invalidParams.Add(aws.NewErrParamRequired("MinCapacity"))
}
if s.ResourceId == nil {
invalidParams.Add(aws.NewErrParamRequired("ResourceId"))
}
if s.ResourceId != nil && len(*s.ResourceId) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("ResourceId", 1))
}
if len(s.ScalableDimension) == 0 {
invalidParams.Add(aws.NewErrParamRequired("ScalableDimension"))
}
if len(s.ServiceNamespace) == 0 {
invalidParams.Add(aws.NewErrParamRequired("ServiceNamespace"))
}
if s.TargetTrackingConfigurations == nil {
invalidParams.Add(aws.NewErrParamRequired("TargetTrackingConfigurations"))
}
if s.TargetTrackingConfigurations != nil {
for i, v := range s.TargetTrackingConfigurations {
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TargetTrackingConfigurations", i), err.(aws.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents a scaling plan.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/ScalingPlan
type ScalingPlan struct {
_ struct{} `type:"structure"`
// The application source.
//
// ApplicationSource is a required field
ApplicationSource *ApplicationSource `type:"structure" required:"true"`
// The Unix timestamp when the scaling plan was created.
CreationTime *time.Time `type:"timestamp" timestampFormat:"unix"`
// The scaling instructions.
//
// ScalingInstructions is a required field
ScalingInstructions []ScalingInstruction `type:"list" required:"true"`
// The name of the scaling plan.
//
// ScalingPlanName is a required field
ScalingPlanName *string `min:"1" type:"string" required:"true"`
// The version of the scaling plan.
//
// ScalingPlanVersion is a required field
ScalingPlanVersion *int64 `type:"long" required:"true"`
// The status of the scaling plan.
//
// * Active - The scaling plan is active.
//
// * ActiveWithProblems - The scaling plan is active, but the scaling configuration
// for one or more resources could not be applied.
//
// * CreationInProgress - The scaling plan is being created.
//
// * CreationFailed - The scaling plan could not be created.
//
// * DeletionInProgress - The scaling plan is being deleted.
//
// * DeletionFailed - The scaling plan could not be deleted.
//
// StatusCode is a required field
StatusCode ScalingPlanStatusCode `type:"string" required:"true" enum:"true"`
// A simple message about the current status of the scaling plan.
StatusMessage *string `type:"string"`
// The Unix timestamp when the scaling plan entered the current status.
StatusStartTime *time.Time `type:"timestamp" timestampFormat:"unix"`
}
// String returns the string representation
func (s ScalingPlan) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s ScalingPlan) GoString() string {
return s.String()
}
// Represents a scalable resource.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/ScalingPlanResource
type ScalingPlanResource struct {
_ struct{} `type:"structure"`
// The ID of the resource. This string consists of the resource type and unique
// identifier.
//
// * Auto Scaling group - The resource type is autoScalingGroup and the unique
// identifier is the name of the Auto Scaling group. Example: autoScalingGroup/my-asg.