forked from aws/aws-sdk-go-v2
/
api.go
3317 lines (2894 loc) · 124 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 applicationautoscaling
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
const opDeleteScalingPolicy = "DeleteScalingPolicy"
// DeleteScalingPolicyRequest is a API request type for the DeleteScalingPolicy API operation.
type DeleteScalingPolicyRequest struct {
*aws.Request
Input *DeleteScalingPolicyInput
Copy func(*DeleteScalingPolicyInput) DeleteScalingPolicyRequest
}
// Send marshals and sends the DeleteScalingPolicy API request.
func (r DeleteScalingPolicyRequest) Send() (*DeleteScalingPolicyOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteScalingPolicyOutput), nil
}
// DeleteScalingPolicyRequest returns a request value for making API operation for
// Application Auto Scaling.
//
// Deletes the specified Application Auto Scaling scaling policy.
//
// Deleting a policy deletes the underlying alarm action, but does not delete
// the CloudWatch alarm associated with the scaling policy, even if it no longer
// has an associated action.
//
// To create a scaling policy or update an existing one, see PutScalingPolicy.
//
// // Example sending a request using the DeleteScalingPolicyRequest method.
// req := client.DeleteScalingPolicyRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DeleteScalingPolicy
func (c *ApplicationAutoScaling) DeleteScalingPolicyRequest(input *DeleteScalingPolicyInput) DeleteScalingPolicyRequest {
op := &aws.Operation{
Name: opDeleteScalingPolicy,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteScalingPolicyInput{}
}
output := &DeleteScalingPolicyOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DeleteScalingPolicyRequest{Request: req, Input: input, Copy: c.DeleteScalingPolicyRequest}
}
const opDeleteScheduledAction = "DeleteScheduledAction"
// DeleteScheduledActionRequest is a API request type for the DeleteScheduledAction API operation.
type DeleteScheduledActionRequest struct {
*aws.Request
Input *DeleteScheduledActionInput
Copy func(*DeleteScheduledActionInput) DeleteScheduledActionRequest
}
// Send marshals and sends the DeleteScheduledAction API request.
func (r DeleteScheduledActionRequest) Send() (*DeleteScheduledActionOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteScheduledActionOutput), nil
}
// DeleteScheduledActionRequest returns a request value for making API operation for
// Application Auto Scaling.
//
// Deletes the specified Application Auto Scaling scheduled action.
//
// // Example sending a request using the DeleteScheduledActionRequest method.
// req := client.DeleteScheduledActionRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DeleteScheduledAction
func (c *ApplicationAutoScaling) DeleteScheduledActionRequest(input *DeleteScheduledActionInput) DeleteScheduledActionRequest {
op := &aws.Operation{
Name: opDeleteScheduledAction,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteScheduledActionInput{}
}
output := &DeleteScheduledActionOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DeleteScheduledActionRequest{Request: req, Input: input, Copy: c.DeleteScheduledActionRequest}
}
const opDeregisterScalableTarget = "DeregisterScalableTarget"
// DeregisterScalableTargetRequest is a API request type for the DeregisterScalableTarget API operation.
type DeregisterScalableTargetRequest struct {
*aws.Request
Input *DeregisterScalableTargetInput
Copy func(*DeregisterScalableTargetInput) DeregisterScalableTargetRequest
}
// Send marshals and sends the DeregisterScalableTarget API request.
func (r DeregisterScalableTargetRequest) Send() (*DeregisterScalableTargetOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeregisterScalableTargetOutput), nil
}
// DeregisterScalableTargetRequest returns a request value for making API operation for
// Application Auto Scaling.
//
// Deregisters a scalable target.
//
// Deregistering a scalable target deletes the scaling policies that are associated
// with it.
//
// To create a scalable target or update an existing one, see RegisterScalableTarget.
//
// // Example sending a request using the DeregisterScalableTargetRequest method.
// req := client.DeregisterScalableTargetRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DeregisterScalableTarget
func (c *ApplicationAutoScaling) DeregisterScalableTargetRequest(input *DeregisterScalableTargetInput) DeregisterScalableTargetRequest {
op := &aws.Operation{
Name: opDeregisterScalableTarget,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeregisterScalableTargetInput{}
}
output := &DeregisterScalableTargetOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DeregisterScalableTargetRequest{Request: req, Input: input, Copy: c.DeregisterScalableTargetRequest}
}
const opDescribeScalableTargets = "DescribeScalableTargets"
// DescribeScalableTargetsRequest is a API request type for the DescribeScalableTargets API operation.
type DescribeScalableTargetsRequest struct {
*aws.Request
Input *DescribeScalableTargetsInput
Copy func(*DescribeScalableTargetsInput) DescribeScalableTargetsRequest
}
// Send marshals and sends the DescribeScalableTargets API request.
func (r DescribeScalableTargetsRequest) Send() (*DescribeScalableTargetsOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DescribeScalableTargetsOutput), nil
}
// DescribeScalableTargetsRequest returns a request value for making API operation for
// Application Auto Scaling.
//
// Gets information about the scalable targets in the specified namespace.
//
// You can filter the results using the ResourceIds and ScalableDimension parameters.
//
// To create a scalable target or update an existing one, see RegisterScalableTarget.
// If you are no longer using a scalable target, you can deregister it using
// DeregisterScalableTarget.
//
// // Example sending a request using the DescribeScalableTargetsRequest method.
// req := client.DescribeScalableTargetsRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalableTargets
func (c *ApplicationAutoScaling) DescribeScalableTargetsRequest(input *DescribeScalableTargetsInput) DescribeScalableTargetsRequest {
op := &aws.Operation{
Name: opDescribeScalableTargets,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &aws.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeScalableTargetsInput{}
}
output := &DescribeScalableTargetsOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DescribeScalableTargetsRequest{Request: req, Input: input, Copy: c.DescribeScalableTargetsRequest}
}
// Paginate pages iterates over the pages of a DescribeScalableTargetsRequest operation,
// calling the Next method for each page. Using the paginators Next
// method will depict whether or not there are more pages.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a DescribeScalableTargets operation.
// req := client.DescribeScalableTargetsRequest(input)
// p := req.Paginate()
// for p.Next() {
// page := p.CurrentPage()
// }
//
// if err := p.Err(); err != nil {
// return err
// }
//
func (p *DescribeScalableTargetsRequest) Paginate(opts ...aws.Option) DescribeScalableTargetsPager {
return DescribeScalableTargetsPager{
Pager: aws.Pager{
NewRequest: func() (*aws.Request, error) {
var inCpy *DescribeScalableTargetsInput
if p.Input != nil {
tmp := *p.Input
inCpy = &tmp
}
req := p.Copy(inCpy)
req.ApplyOptions(opts...)
return req.Request, nil
},
},
}
}
// DescribeScalableTargetsPager is used to paginate the request. This can be done by
// calling Next and CurrentPage.
type DescribeScalableTargetsPager struct {
aws.Pager
}
func (p *DescribeScalableTargetsPager) CurrentPage() *DescribeScalableTargetsOutput {
return p.Pager.CurrentPage().(*DescribeScalableTargetsOutput)
}
const opDescribeScalingActivities = "DescribeScalingActivities"
// DescribeScalingActivitiesRequest is a API request type for the DescribeScalingActivities API operation.
type DescribeScalingActivitiesRequest struct {
*aws.Request
Input *DescribeScalingActivitiesInput
Copy func(*DescribeScalingActivitiesInput) DescribeScalingActivitiesRequest
}
// Send marshals and sends the DescribeScalingActivities API request.
func (r DescribeScalingActivitiesRequest) Send() (*DescribeScalingActivitiesOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DescribeScalingActivitiesOutput), nil
}
// DescribeScalingActivitiesRequest returns a request value for making API operation for
// Application Auto Scaling.
//
// Provides descriptive information about the scaling activities in the specified
// namespace from the previous six weeks.
//
// You can filter the results using the ResourceId and ScalableDimension parameters.
//
// Scaling activities are triggered by CloudWatch alarms that are associated
// with scaling policies. To view the scaling policies for a service namespace,
// see DescribeScalingPolicies. To create a scaling policy or update an existing
// one, see PutScalingPolicy.
//
// // Example sending a request using the DescribeScalingActivitiesRequest method.
// req := client.DescribeScalingActivitiesRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalingActivities
func (c *ApplicationAutoScaling) DescribeScalingActivitiesRequest(input *DescribeScalingActivitiesInput) DescribeScalingActivitiesRequest {
op := &aws.Operation{
Name: opDescribeScalingActivities,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &aws.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeScalingActivitiesInput{}
}
output := &DescribeScalingActivitiesOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DescribeScalingActivitiesRequest{Request: req, Input: input, Copy: c.DescribeScalingActivitiesRequest}
}
// Paginate pages iterates over the pages of a DescribeScalingActivitiesRequest operation,
// calling the Next method for each page. Using the paginators Next
// method will depict whether or not there are more pages.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a DescribeScalingActivities operation.
// req := client.DescribeScalingActivitiesRequest(input)
// p := req.Paginate()
// for p.Next() {
// page := p.CurrentPage()
// }
//
// if err := p.Err(); err != nil {
// return err
// }
//
func (p *DescribeScalingActivitiesRequest) Paginate(opts ...aws.Option) DescribeScalingActivitiesPager {
return DescribeScalingActivitiesPager{
Pager: aws.Pager{
NewRequest: func() (*aws.Request, error) {
var inCpy *DescribeScalingActivitiesInput
if p.Input != nil {
tmp := *p.Input
inCpy = &tmp
}
req := p.Copy(inCpy)
req.ApplyOptions(opts...)
return req.Request, nil
},
},
}
}
// DescribeScalingActivitiesPager is used to paginate the request. This can be done by
// calling Next and CurrentPage.
type DescribeScalingActivitiesPager struct {
aws.Pager
}
func (p *DescribeScalingActivitiesPager) CurrentPage() *DescribeScalingActivitiesOutput {
return p.Pager.CurrentPage().(*DescribeScalingActivitiesOutput)
}
const opDescribeScalingPolicies = "DescribeScalingPolicies"
// DescribeScalingPoliciesRequest is a API request type for the DescribeScalingPolicies API operation.
type DescribeScalingPoliciesRequest struct {
*aws.Request
Input *DescribeScalingPoliciesInput
Copy func(*DescribeScalingPoliciesInput) DescribeScalingPoliciesRequest
}
// Send marshals and sends the DescribeScalingPolicies API request.
func (r DescribeScalingPoliciesRequest) Send() (*DescribeScalingPoliciesOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DescribeScalingPoliciesOutput), nil
}
// DescribeScalingPoliciesRequest returns a request value for making API operation for
// Application Auto Scaling.
//
// Describes the scaling policies for the specified service namespace.
//
// You can filter the results using the ResourceId, ScalableDimension, and PolicyNames
// parameters.
//
// To create a scaling policy or update an existing one, see PutScalingPolicy.
// If you are no longer using a scaling policy, you can delete it using DeleteScalingPolicy.
//
// // Example sending a request using the DescribeScalingPoliciesRequest method.
// req := client.DescribeScalingPoliciesRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalingPolicies
func (c *ApplicationAutoScaling) DescribeScalingPoliciesRequest(input *DescribeScalingPoliciesInput) DescribeScalingPoliciesRequest {
op := &aws.Operation{
Name: opDescribeScalingPolicies,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &aws.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeScalingPoliciesInput{}
}
output := &DescribeScalingPoliciesOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DescribeScalingPoliciesRequest{Request: req, Input: input, Copy: c.DescribeScalingPoliciesRequest}
}
// Paginate pages iterates over the pages of a DescribeScalingPoliciesRequest operation,
// calling the Next method for each page. Using the paginators Next
// method will depict whether or not there are more pages.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a DescribeScalingPolicies operation.
// req := client.DescribeScalingPoliciesRequest(input)
// p := req.Paginate()
// for p.Next() {
// page := p.CurrentPage()
// }
//
// if err := p.Err(); err != nil {
// return err
// }
//
func (p *DescribeScalingPoliciesRequest) Paginate(opts ...aws.Option) DescribeScalingPoliciesPager {
return DescribeScalingPoliciesPager{
Pager: aws.Pager{
NewRequest: func() (*aws.Request, error) {
var inCpy *DescribeScalingPoliciesInput
if p.Input != nil {
tmp := *p.Input
inCpy = &tmp
}
req := p.Copy(inCpy)
req.ApplyOptions(opts...)
return req.Request, nil
},
},
}
}
// DescribeScalingPoliciesPager is used to paginate the request. This can be done by
// calling Next and CurrentPage.
type DescribeScalingPoliciesPager struct {
aws.Pager
}
func (p *DescribeScalingPoliciesPager) CurrentPage() *DescribeScalingPoliciesOutput {
return p.Pager.CurrentPage().(*DescribeScalingPoliciesOutput)
}
const opDescribeScheduledActions = "DescribeScheduledActions"
// DescribeScheduledActionsRequest is a API request type for the DescribeScheduledActions API operation.
type DescribeScheduledActionsRequest struct {
*aws.Request
Input *DescribeScheduledActionsInput
Copy func(*DescribeScheduledActionsInput) DescribeScheduledActionsRequest
}
// Send marshals and sends the DescribeScheduledActions API request.
func (r DescribeScheduledActionsRequest) Send() (*DescribeScheduledActionsOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DescribeScheduledActionsOutput), nil
}
// DescribeScheduledActionsRequest returns a request value for making API operation for
// Application Auto Scaling.
//
// Describes the scheduled actions for the specified service namespace.
//
// You can filter the results using the ResourceId, ScalableDimension, and ScheduledActionNames
// parameters.
//
// To create a scheduled action or update an existing one, see PutScheduledAction.
// If you are no longer using a scheduled action, you can delete it using DeleteScheduledAction.
//
// // Example sending a request using the DescribeScheduledActionsRequest method.
// req := client.DescribeScheduledActionsRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScheduledActions
func (c *ApplicationAutoScaling) DescribeScheduledActionsRequest(input *DescribeScheduledActionsInput) DescribeScheduledActionsRequest {
op := &aws.Operation{
Name: opDescribeScheduledActions,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeScheduledActionsInput{}
}
output := &DescribeScheduledActionsOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DescribeScheduledActionsRequest{Request: req, Input: input, Copy: c.DescribeScheduledActionsRequest}
}
const opPutScalingPolicy = "PutScalingPolicy"
// PutScalingPolicyRequest is a API request type for the PutScalingPolicy API operation.
type PutScalingPolicyRequest struct {
*aws.Request
Input *PutScalingPolicyInput
Copy func(*PutScalingPolicyInput) PutScalingPolicyRequest
}
// Send marshals and sends the PutScalingPolicy API request.
func (r PutScalingPolicyRequest) Send() (*PutScalingPolicyOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*PutScalingPolicyOutput), nil
}
// PutScalingPolicyRequest returns a request value for making API operation for
// Application Auto Scaling.
//
// Creates or updates a policy for an Application Auto Scaling scalable target.
//
// Each scalable target is identified by a service namespace, resource ID, and
// scalable dimension. A scaling policy applies to the scalable target identified
// by those three attributes. You cannot create a scaling policy until you register
// the scalable target using RegisterScalableTarget.
//
// To update a policy, specify its policy name and the parameters that you want
// to change. Any parameters that you don't specify are not changed by this
// update request.
//
// You can view the scaling policies for a service namespace using DescribeScalingPolicies.
// If you are no longer using a scaling policy, you can delete it using DeleteScalingPolicy.
//
// // Example sending a request using the PutScalingPolicyRequest method.
// req := client.PutScalingPolicyRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/PutScalingPolicy
func (c *ApplicationAutoScaling) PutScalingPolicyRequest(input *PutScalingPolicyInput) PutScalingPolicyRequest {
op := &aws.Operation{
Name: opPutScalingPolicy,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &PutScalingPolicyInput{}
}
output := &PutScalingPolicyOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return PutScalingPolicyRequest{Request: req, Input: input, Copy: c.PutScalingPolicyRequest}
}
const opPutScheduledAction = "PutScheduledAction"
// PutScheduledActionRequest is a API request type for the PutScheduledAction API operation.
type PutScheduledActionRequest struct {
*aws.Request
Input *PutScheduledActionInput
Copy func(*PutScheduledActionInput) PutScheduledActionRequest
}
// Send marshals and sends the PutScheduledAction API request.
func (r PutScheduledActionRequest) Send() (*PutScheduledActionOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*PutScheduledActionOutput), nil
}
// PutScheduledActionRequest returns a request value for making API operation for
// Application Auto Scaling.
//
// Creates or updates a scheduled action for an Application Auto Scaling scalable
// target.
//
// Each scalable target is identified by a service namespace, resource ID, and
// scalable dimension. A scheduled action applies to the scalable target identified
// by those three attributes. You cannot create a scheduled action until you
// register the scalable target using RegisterScalableTarget.
//
// To update an action, specify its name and the parameters that you want to
// change. If you don't specify start and end times, the old values are deleted.
// Any other parameters that you don't specify are not changed by this update
// request.
//
// You can view the scheduled actions using DescribeScheduledActions. If you
// are no longer using a scheduled action, you can delete it using DeleteScheduledAction.
//
// // Example sending a request using the PutScheduledActionRequest method.
// req := client.PutScheduledActionRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/PutScheduledAction
func (c *ApplicationAutoScaling) PutScheduledActionRequest(input *PutScheduledActionInput) PutScheduledActionRequest {
op := &aws.Operation{
Name: opPutScheduledAction,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &PutScheduledActionInput{}
}
output := &PutScheduledActionOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return PutScheduledActionRequest{Request: req, Input: input, Copy: c.PutScheduledActionRequest}
}
const opRegisterScalableTarget = "RegisterScalableTarget"
// RegisterScalableTargetRequest is a API request type for the RegisterScalableTarget API operation.
type RegisterScalableTargetRequest struct {
*aws.Request
Input *RegisterScalableTargetInput
Copy func(*RegisterScalableTargetInput) RegisterScalableTargetRequest
}
// Send marshals and sends the RegisterScalableTarget API request.
func (r RegisterScalableTargetRequest) Send() (*RegisterScalableTargetOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*RegisterScalableTargetOutput), nil
}
// RegisterScalableTargetRequest returns a request value for making API operation for
// Application Auto Scaling.
//
// Registers or updates a scalable target. A scalable target is a resource that
// Application Auto Scaling can scale out or scale in. After you have registered
// a scalable target, you can use this operation to update the minimum and maximum
// values for its scalable dimension.
//
// After you register a scalable target, you can create and apply scaling policies
// using PutScalingPolicy. You can view the scaling policies for a service namespace
// using DescribeScalableTargets. If you no longer need a scalable target, you
// can deregister it using DeregisterScalableTarget.
//
// // Example sending a request using the RegisterScalableTargetRequest method.
// req := client.RegisterScalableTargetRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/RegisterScalableTarget
func (c *ApplicationAutoScaling) RegisterScalableTargetRequest(input *RegisterScalableTargetInput) RegisterScalableTargetRequest {
op := &aws.Operation{
Name: opRegisterScalableTarget,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &RegisterScalableTargetInput{}
}
output := &RegisterScalableTargetOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return RegisterScalableTargetRequest{Request: req, Input: input, Copy: c.RegisterScalableTargetRequest}
}
// Represents a CloudWatch alarm associated with a scaling policy.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/Alarm
type Alarm struct {
_ struct{} `type:"structure"`
// The Amazon Resource Name (ARN) of the alarm.
//
// AlarmARN is a required field
AlarmARN *string `type:"string" required:"true"`
// The name of the alarm.
//
// AlarmName is a required field
AlarmName *string `type:"string" required:"true"`
}
// String returns the string representation
func (s Alarm) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s Alarm) GoString() string {
return s.String()
}
// Configures a customized metric for a target tracking policy.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/CustomizedMetricSpecification
type CustomizedMetricSpecification 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 CustomizedMetricSpecification) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s CustomizedMetricSpecification) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CustomizedMetricSpecification) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "CustomizedMetricSpecification"}
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/application-autoscaling-2016-02-06/DeleteScalingPolicyRequest
type DeleteScalingPolicyInput struct {
_ struct{} `type:"structure"`
// The name of the scaling policy.
//
// PolicyName is a required field
PolicyName *string `min:"1" type:"string" required:"true"`
// The identifier of the resource associated with the scalable target. This
// string consists of the resource type and unique identifier.
//
// * 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.
//
// * EMR cluster - The resource type is instancegroup and the unique identifier
// is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0.
//
// * AppStream 2.0 fleet - The resource type is fleet and the unique identifier
// is the fleet name. Example: fleet/sample-fleet.
//
// * 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.
//
// * Amazon SageMaker endpoint variants - The resource type is variant and
// the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering.
//
// ResourceId is a required field
ResourceId *string `min:"1" type:"string" required:"true"`
// The scalable dimension. This string consists of the service namespace, resource
// type, and scaling property.
//
// * ecs:service:DesiredCount - The desired task count of an ECS service.
//
// * ec2:spot-fleet-request:TargetCapacity - The target capacity of a Spot
// fleet request.
//
// * elasticmapreduce:instancegroup:InstanceCount - The instance count of
// an EMR Instance Group.
//
// * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream
// 2.0 fleet.
//
// * 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.
//
// * sagemaker:variant:DesiredInstanceCount - The number of EC2 instances
// for an Amazon SageMaker model endpoint variant.
//
// ScalableDimension is a required field
ScalableDimension ScalableDimension `type:"string" required:"true" enum:"true"`
// The namespace of the AWS service. For more information, see AWS Service Namespaces
// (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// in the Amazon Web Services General Reference.
//
// ServiceNamespace is a required field
ServiceNamespace ServiceNamespace `type:"string" required:"true" enum:"true"`
}
// String returns the string representation
func (s DeleteScalingPolicyInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DeleteScalingPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteScalingPolicyInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "DeleteScalingPolicyInput"}
if s.PolicyName == nil {
invalidParams.Add(aws.NewErrParamRequired("PolicyName"))
}
if s.PolicyName != nil && len(*s.PolicyName) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("PolicyName", 1))
}
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 invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DeleteScalingPolicyResponse
type DeleteScalingPolicyOutput struct {
_ struct{} `type:"structure"`
responseMetadata aws.Response
}
// String returns the string representation
func (s DeleteScalingPolicyOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DeleteScalingPolicyOutput) GoString() string {
return s.String()
}
// SDKResponseMetdata return sthe response metadata for the API.
func (s DeleteScalingPolicyOutput) SDKResponseMetadata() aws.Response {
return s.responseMetadata
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DeleteScheduledActionRequest
type DeleteScheduledActionInput struct {
_ struct{} `type:"structure"`
// The identifier of the resource associated with the scheduled action. This
// string consists of the resource type and unique identifier.
//
// * 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.
//
// * EMR cluster - The resource type is instancegroup and the unique identifier
// is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0.
//
// * AppStream 2.0 fleet - The resource type is fleet and the unique identifier
// is the fleet name. Example: fleet/sample-fleet.
//
// * 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