-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
Copy pathapi.go
7094 lines (6216 loc) · 243 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 synthetics
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/restjson"
)
const opAssociateResource = "AssociateResource"
// AssociateResourceRequest generates a "aws/request.Request" representing the
// client's request for the AssociateResource 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 AssociateResource for more information on using the AssociateResource
// 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 AssociateResourceRequest method.
// req, resp := client.AssociateResourceRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/synthetics-2017-10-11/AssociateResource
func (c *Synthetics) AssociateResourceRequest(input *AssociateResourceInput) (req *request.Request, output *AssociateResourceOutput) {
op := &request.Operation{
Name: opAssociateResource,
HTTPMethod: "PATCH",
HTTPPath: "/group/{groupIdentifier}/associate",
}
if input == nil {
input = &AssociateResourceInput{}
}
output = &AssociateResourceOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// AssociateResource API operation for Synthetics.
//
// Associates a canary with a group. Using groups can help you with managing
// and automating your canaries, and you can also view aggregated run results
// and statistics for all canaries in a group.
//
// You must run this operation in the Region where the canary exists.
//
// 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 Synthetics's
// API operation AssociateResource for usage and error information.
//
// Returned Error Types:
//
// - InternalServerException
// An unknown internal error occurred.
//
// - ValidationException
// A parameter could not be validated.
//
// - ResourceNotFoundException
// One of the specified resources was not found.
//
// - ConflictException
// A conflicting operation is already in progress.
//
// - ServiceQuotaExceededException
// The request exceeded a service quota value.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/synthetics-2017-10-11/AssociateResource
func (c *Synthetics) AssociateResource(input *AssociateResourceInput) (*AssociateResourceOutput, error) {
req, out := c.AssociateResourceRequest(input)
return out, req.Send()
}
// AssociateResourceWithContext is the same as AssociateResource with the addition of
// the ability to pass a context and additional request options.
//
// See AssociateResource 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 *Synthetics) AssociateResourceWithContext(ctx aws.Context, input *AssociateResourceInput, opts ...request.Option) (*AssociateResourceOutput, error) {
req, out := c.AssociateResourceRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateCanary = "CreateCanary"
// CreateCanaryRequest generates a "aws/request.Request" representing the
// client's request for the CreateCanary 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 CreateCanary for more information on using the CreateCanary
// 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 CreateCanaryRequest method.
// req, resp := client.CreateCanaryRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/synthetics-2017-10-11/CreateCanary
func (c *Synthetics) CreateCanaryRequest(input *CreateCanaryInput) (req *request.Request, output *CreateCanaryOutput) {
op := &request.Operation{
Name: opCreateCanary,
HTTPMethod: "POST",
HTTPPath: "/canary",
}
if input == nil {
input = &CreateCanaryInput{}
}
output = &CreateCanaryOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateCanary API operation for Synthetics.
//
// Creates a canary. Canaries are scripts that monitor your endpoints and APIs
// from the outside-in. Canaries help you check the availability and latency
// of your web services and troubleshoot anomalies by investigating load time
// data, screenshots of the UI, logs, and metrics. You can set up a canary to
// run continuously or just once.
//
// Do not use CreateCanary to modify an existing canary. Use UpdateCanary (https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_UpdateCanary.html)
// instead.
//
// To create canaries, you must have the CloudWatchSyntheticsFullAccess policy.
// If you are creating a new IAM role for the canary, you also need the iam:CreateRole,
// iam:CreatePolicy and iam:AttachRolePolicy permissions. For more information,
// see Necessary Roles and Permissions (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Roles).
//
// Do not include secrets or proprietary information in your canary names. The
// canary name makes up part of the Amazon Resource Name (ARN) for the canary,
// and the ARN is included in outbound calls over the internet. For more information,
// see Security Considerations for Synthetics Canaries (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/servicelens_canaries_security.html).
//
// 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 Synthetics's
// API operation CreateCanary for usage and error information.
//
// Returned Error Types:
//
// - InternalServerException
// An unknown internal error occurred.
//
// - ValidationException
// A parameter could not be validated.
//
// - RequestEntityTooLargeException
// One of the input resources is larger than is allowed.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/synthetics-2017-10-11/CreateCanary
func (c *Synthetics) CreateCanary(input *CreateCanaryInput) (*CreateCanaryOutput, error) {
req, out := c.CreateCanaryRequest(input)
return out, req.Send()
}
// CreateCanaryWithContext is the same as CreateCanary with the addition of
// the ability to pass a context and additional request options.
//
// See CreateCanary 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 *Synthetics) CreateCanaryWithContext(ctx aws.Context, input *CreateCanaryInput, opts ...request.Option) (*CreateCanaryOutput, error) {
req, out := c.CreateCanaryRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateGroup = "CreateGroup"
// CreateGroupRequest generates a "aws/request.Request" representing the
// client's request for the CreateGroup 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 CreateGroup for more information on using the CreateGroup
// 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 CreateGroupRequest method.
// req, resp := client.CreateGroupRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/synthetics-2017-10-11/CreateGroup
func (c *Synthetics) CreateGroupRequest(input *CreateGroupInput) (req *request.Request, output *CreateGroupOutput) {
op := &request.Operation{
Name: opCreateGroup,
HTTPMethod: "POST",
HTTPPath: "/group",
}
if input == nil {
input = &CreateGroupInput{}
}
output = &CreateGroupOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateGroup API operation for Synthetics.
//
// Creates a group which you can use to associate canaries with each other,
// including cross-Region canaries. Using groups can help you with managing
// and automating your canaries, and you can also view aggregated run results
// and statistics for all canaries in a group.
//
// Groups are global resources. When you create a group, it is replicated across
// Amazon Web Services Regions, and you can view it and add canaries to it from
// any Region. Although the group ARN format reflects the Region name where
// it was created, a group is not constrained to any Region. This means that
// you can put canaries from multiple Regions into the same group, and then
// use that group to view and manage all of those canaries in a single view.
//
// Groups are supported in all Regions except the Regions that are disabled
// by default. For more information about these Regions, see Enabling a Region
// (https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable).
//
// Each group can contain as many as 10 canaries. You can have as many as 20
// groups in your account. Any single canary can be a member of up to 10 groups.
//
// 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 Synthetics's
// API operation CreateGroup for usage and error information.
//
// Returned Error Types:
//
// - InternalServerException
// An unknown internal error occurred.
//
// - ValidationException
// A parameter could not be validated.
//
// - ConflictException
// A conflicting operation is already in progress.
//
// - ServiceQuotaExceededException
// The request exceeded a service quota value.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/synthetics-2017-10-11/CreateGroup
func (c *Synthetics) CreateGroup(input *CreateGroupInput) (*CreateGroupOutput, error) {
req, out := c.CreateGroupRequest(input)
return out, req.Send()
}
// CreateGroupWithContext is the same as CreateGroup with the addition of
// the ability to pass a context and additional request options.
//
// See CreateGroup 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 *Synthetics) CreateGroupWithContext(ctx aws.Context, input *CreateGroupInput, opts ...request.Option) (*CreateGroupOutput, error) {
req, out := c.CreateGroupRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteCanary = "DeleteCanary"
// DeleteCanaryRequest generates a "aws/request.Request" representing the
// client's request for the DeleteCanary 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 DeleteCanary for more information on using the DeleteCanary
// 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 DeleteCanaryRequest method.
// req, resp := client.DeleteCanaryRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/synthetics-2017-10-11/DeleteCanary
func (c *Synthetics) DeleteCanaryRequest(input *DeleteCanaryInput) (req *request.Request, output *DeleteCanaryOutput) {
op := &request.Operation{
Name: opDeleteCanary,
HTTPMethod: "DELETE",
HTTPPath: "/canary/{name}",
}
if input == nil {
input = &DeleteCanaryInput{}
}
output = &DeleteCanaryOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// DeleteCanary API operation for Synthetics.
//
// Permanently deletes the specified canary.
//
// If you specify DeleteLambda to true, CloudWatch Synthetics also deletes the
// Lambda functions and layers that are used by the canary.
//
// Other resources used and created by the canary are not automatically deleted.
// After you delete a canary that you do not intend to use again, you should
// also delete the following:
//
// - The CloudWatch alarms created for this canary. These alarms have a name
// of Synthetics-SharpDrop-Alarm-MyCanaryName .
//
// - Amazon S3 objects and buckets, such as the canary's artifact location.
//
// - IAM roles created for the canary. If they were created in the console,
// these roles have the name role/service-role/CloudWatchSyntheticsRole-MyCanaryName .
//
// - CloudWatch Logs log groups created for the canary. These logs groups
// have the name /aws/lambda/cwsyn-MyCanaryName .
//
// Before you delete a canary, you might want to use GetCanary to display the
// information about this canary. Make note of the information returned by this
// operation so that you can delete these resources after you delete the canary.
//
// 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 Synthetics's
// API operation DeleteCanary for usage and error information.
//
// Returned Error Types:
//
// - InternalServerException
// An unknown internal error occurred.
//
// - ValidationException
// A parameter could not be validated.
//
// - ResourceNotFoundException
// One of the specified resources was not found.
//
// - ConflictException
// A conflicting operation is already in progress.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/synthetics-2017-10-11/DeleteCanary
func (c *Synthetics) DeleteCanary(input *DeleteCanaryInput) (*DeleteCanaryOutput, error) {
req, out := c.DeleteCanaryRequest(input)
return out, req.Send()
}
// DeleteCanaryWithContext is the same as DeleteCanary with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteCanary 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 *Synthetics) DeleteCanaryWithContext(ctx aws.Context, input *DeleteCanaryInput, opts ...request.Option) (*DeleteCanaryOutput, error) {
req, out := c.DeleteCanaryRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteGroup = "DeleteGroup"
// DeleteGroupRequest generates a "aws/request.Request" representing the
// client's request for the DeleteGroup 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 DeleteGroup for more information on using the DeleteGroup
// 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 DeleteGroupRequest method.
// req, resp := client.DeleteGroupRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/synthetics-2017-10-11/DeleteGroup
func (c *Synthetics) DeleteGroupRequest(input *DeleteGroupInput) (req *request.Request, output *DeleteGroupOutput) {
op := &request.Operation{
Name: opDeleteGroup,
HTTPMethod: "DELETE",
HTTPPath: "/group/{groupIdentifier}",
}
if input == nil {
input = &DeleteGroupInput{}
}
output = &DeleteGroupOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// DeleteGroup API operation for Synthetics.
//
// Deletes a group. The group doesn't need to be empty to be deleted. If there
// are canaries in the group, they are not deleted when you delete the group.
//
// Groups are a global resource that appear in all Regions, but the request
// to delete a group must be made from its home Region. You can find the home
// Region of a group within its ARN.
//
// 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 Synthetics's
// API operation DeleteGroup for usage and error information.
//
// Returned Error Types:
//
// - InternalServerException
// An unknown internal error occurred.
//
// - ValidationException
// A parameter could not be validated.
//
// - ResourceNotFoundException
// One of the specified resources was not found.
//
// - ConflictException
// A conflicting operation is already in progress.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/synthetics-2017-10-11/DeleteGroup
func (c *Synthetics) DeleteGroup(input *DeleteGroupInput) (*DeleteGroupOutput, error) {
req, out := c.DeleteGroupRequest(input)
return out, req.Send()
}
// DeleteGroupWithContext is the same as DeleteGroup with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteGroup 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 *Synthetics) DeleteGroupWithContext(ctx aws.Context, input *DeleteGroupInput, opts ...request.Option) (*DeleteGroupOutput, error) {
req, out := c.DeleteGroupRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDescribeCanaries = "DescribeCanaries"
// DescribeCanariesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeCanaries 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 DescribeCanaries for more information on using the DescribeCanaries
// 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 DescribeCanariesRequest method.
// req, resp := client.DescribeCanariesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/synthetics-2017-10-11/DescribeCanaries
func (c *Synthetics) DescribeCanariesRequest(input *DescribeCanariesInput) (req *request.Request, output *DescribeCanariesOutput) {
op := &request.Operation{
Name: opDescribeCanaries,
HTTPMethod: "POST",
HTTPPath: "/canaries",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeCanariesInput{}
}
output = &DescribeCanariesOutput{}
req = c.newRequest(op, input, output)
return
}
// DescribeCanaries API operation for Synthetics.
//
// This operation returns a list of the canaries in your account, along with
// full details about each canary.
//
// This operation supports resource-level authorization using an IAM policy
// and the Names parameter. If you specify the Names parameter, the operation
// is successful only if you have authorization to view all the canaries that
// you specify in your request. If you do not have permission to view any of
// the canaries, the request fails with a 403 response.
//
// You are required to use the Names parameter if you are logged on to a user
// or role that has an IAM policy that restricts which canaries that you are
// allowed to view. For more information, see Limiting a user to viewing specific
// canaries (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Restricted.html).
//
// 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 Synthetics's
// API operation DescribeCanaries for usage and error information.
//
// Returned Error Types:
//
// - InternalServerException
// An unknown internal error occurred.
//
// - ValidationException
// A parameter could not be validated.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/synthetics-2017-10-11/DescribeCanaries
func (c *Synthetics) DescribeCanaries(input *DescribeCanariesInput) (*DescribeCanariesOutput, error) {
req, out := c.DescribeCanariesRequest(input)
return out, req.Send()
}
// DescribeCanariesWithContext is the same as DescribeCanaries with the addition of
// the ability to pass a context and additional request options.
//
// See DescribeCanaries 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 *Synthetics) DescribeCanariesWithContext(ctx aws.Context, input *DescribeCanariesInput, opts ...request.Option) (*DescribeCanariesOutput, error) {
req, out := c.DescribeCanariesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// DescribeCanariesPages iterates over the pages of a DescribeCanaries operation,
// calling the "fn" function with the response data for each page. To stop
// iterating, return false from the fn function.
//
// See DescribeCanaries method for more information on how to use this operation.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a DescribeCanaries operation.
// pageNum := 0
// err := client.DescribeCanariesPages(params,
// func(page *synthetics.DescribeCanariesOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
// })
func (c *Synthetics) DescribeCanariesPages(input *DescribeCanariesInput, fn func(*DescribeCanariesOutput, bool) bool) error {
return c.DescribeCanariesPagesWithContext(aws.BackgroundContext(), input, fn)
}
// DescribeCanariesPagesWithContext same as DescribeCanariesPages except
// it takes a Context and allows setting request options on the pages.
//
// 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 *Synthetics) DescribeCanariesPagesWithContext(ctx aws.Context, input *DescribeCanariesInput, fn func(*DescribeCanariesOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *DescribeCanariesInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeCanariesRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*DescribeCanariesOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
}
const opDescribeCanariesLastRun = "DescribeCanariesLastRun"
// DescribeCanariesLastRunRequest generates a "aws/request.Request" representing the
// client's request for the DescribeCanariesLastRun 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 DescribeCanariesLastRun for more information on using the DescribeCanariesLastRun
// 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 DescribeCanariesLastRunRequest method.
// req, resp := client.DescribeCanariesLastRunRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/synthetics-2017-10-11/DescribeCanariesLastRun
func (c *Synthetics) DescribeCanariesLastRunRequest(input *DescribeCanariesLastRunInput) (req *request.Request, output *DescribeCanariesLastRunOutput) {
op := &request.Operation{
Name: opDescribeCanariesLastRun,
HTTPMethod: "POST",
HTTPPath: "/canaries/last-run",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeCanariesLastRunInput{}
}
output = &DescribeCanariesLastRunOutput{}
req = c.newRequest(op, input, output)
return
}
// DescribeCanariesLastRun API operation for Synthetics.
//
// Use this operation to see information from the most recent run of each canary
// that you have created.
//
// This operation supports resource-level authorization using an IAM policy
// and the Names parameter. If you specify the Names parameter, the operation
// is successful only if you have authorization to view all the canaries that
// you specify in your request. If you do not have permission to view any of
// the canaries, the request fails with a 403 response.
//
// You are required to use the Names parameter if you are logged on to a user
// or role that has an IAM policy that restricts which canaries that you are
// allowed to view. For more information, see Limiting a user to viewing specific
// canaries (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Restricted.html).
//
// 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 Synthetics's
// API operation DescribeCanariesLastRun for usage and error information.
//
// Returned Error Types:
//
// - InternalServerException
// An unknown internal error occurred.
//
// - ValidationException
// A parameter could not be validated.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/synthetics-2017-10-11/DescribeCanariesLastRun
func (c *Synthetics) DescribeCanariesLastRun(input *DescribeCanariesLastRunInput) (*DescribeCanariesLastRunOutput, error) {
req, out := c.DescribeCanariesLastRunRequest(input)
return out, req.Send()
}
// DescribeCanariesLastRunWithContext is the same as DescribeCanariesLastRun with the addition of
// the ability to pass a context and additional request options.
//
// See DescribeCanariesLastRun 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 *Synthetics) DescribeCanariesLastRunWithContext(ctx aws.Context, input *DescribeCanariesLastRunInput, opts ...request.Option) (*DescribeCanariesLastRunOutput, error) {
req, out := c.DescribeCanariesLastRunRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// DescribeCanariesLastRunPages iterates over the pages of a DescribeCanariesLastRun operation,
// calling the "fn" function with the response data for each page. To stop
// iterating, return false from the fn function.
//
// See DescribeCanariesLastRun method for more information on how to use this operation.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a DescribeCanariesLastRun operation.
// pageNum := 0
// err := client.DescribeCanariesLastRunPages(params,
// func(page *synthetics.DescribeCanariesLastRunOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
// })
func (c *Synthetics) DescribeCanariesLastRunPages(input *DescribeCanariesLastRunInput, fn func(*DescribeCanariesLastRunOutput, bool) bool) error {
return c.DescribeCanariesLastRunPagesWithContext(aws.BackgroundContext(), input, fn)
}
// DescribeCanariesLastRunPagesWithContext same as DescribeCanariesLastRunPages except
// it takes a Context and allows setting request options on the pages.
//
// 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 *Synthetics) DescribeCanariesLastRunPagesWithContext(ctx aws.Context, input *DescribeCanariesLastRunInput, fn func(*DescribeCanariesLastRunOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *DescribeCanariesLastRunInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeCanariesLastRunRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*DescribeCanariesLastRunOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
}
const opDescribeRuntimeVersions = "DescribeRuntimeVersions"
// DescribeRuntimeVersionsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeRuntimeVersions 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 DescribeRuntimeVersions for more information on using the DescribeRuntimeVersions
// 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 DescribeRuntimeVersionsRequest method.
// req, resp := client.DescribeRuntimeVersionsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/synthetics-2017-10-11/DescribeRuntimeVersions
func (c *Synthetics) DescribeRuntimeVersionsRequest(input *DescribeRuntimeVersionsInput) (req *request.Request, output *DescribeRuntimeVersionsOutput) {
op := &request.Operation{
Name: opDescribeRuntimeVersions,
HTTPMethod: "POST",
HTTPPath: "/runtime-versions",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeRuntimeVersionsInput{}
}
output = &DescribeRuntimeVersionsOutput{}
req = c.newRequest(op, input, output)
return
}
// DescribeRuntimeVersions API operation for Synthetics.
//
// Returns a list of Synthetics canary runtime versions. For more information,
// see Canary Runtime Versions (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html).
//
// 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 Synthetics's
// API operation DescribeRuntimeVersions for usage and error information.
//
// Returned Error Types:
//
// - InternalServerException
// An unknown internal error occurred.
//
// - ValidationException
// A parameter could not be validated.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/synthetics-2017-10-11/DescribeRuntimeVersions
func (c *Synthetics) DescribeRuntimeVersions(input *DescribeRuntimeVersionsInput) (*DescribeRuntimeVersionsOutput, error) {
req, out := c.DescribeRuntimeVersionsRequest(input)
return out, req.Send()
}
// DescribeRuntimeVersionsWithContext is the same as DescribeRuntimeVersions with the addition of
// the ability to pass a context and additional request options.
//
// See DescribeRuntimeVersions 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 *Synthetics) DescribeRuntimeVersionsWithContext(ctx aws.Context, input *DescribeRuntimeVersionsInput, opts ...request.Option) (*DescribeRuntimeVersionsOutput, error) {
req, out := c.DescribeRuntimeVersionsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// DescribeRuntimeVersionsPages iterates over the pages of a DescribeRuntimeVersions operation,
// calling the "fn" function with the response data for each page. To stop
// iterating, return false from the fn function.
//
// See DescribeRuntimeVersions method for more information on how to use this operation.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a DescribeRuntimeVersions operation.
// pageNum := 0
// err := client.DescribeRuntimeVersionsPages(params,
// func(page *synthetics.DescribeRuntimeVersionsOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
// })
func (c *Synthetics) DescribeRuntimeVersionsPages(input *DescribeRuntimeVersionsInput, fn func(*DescribeRuntimeVersionsOutput, bool) bool) error {
return c.DescribeRuntimeVersionsPagesWithContext(aws.BackgroundContext(), input, fn)
}
// DescribeRuntimeVersionsPagesWithContext same as DescribeRuntimeVersionsPages except
// it takes a Context and allows setting request options on the pages.
//
// 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 *Synthetics) DescribeRuntimeVersionsPagesWithContext(ctx aws.Context, input *DescribeRuntimeVersionsInput, fn func(*DescribeRuntimeVersionsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *DescribeRuntimeVersionsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeRuntimeVersionsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*DescribeRuntimeVersionsOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
}
const opDisassociateResource = "DisassociateResource"
// DisassociateResourceRequest generates a "aws/request.Request" representing the
// client's request for the DisassociateResource 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 DisassociateResource for more information on using the DisassociateResource
// 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 DisassociateResourceRequest method.
// req, resp := client.DisassociateResourceRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/synthetics-2017-10-11/DisassociateResource
func (c *Synthetics) DisassociateResourceRequest(input *DisassociateResourceInput) (req *request.Request, output *DisassociateResourceOutput) {
op := &request.Operation{
Name: opDisassociateResource,
HTTPMethod: "PATCH",
HTTPPath: "/group/{groupIdentifier}/disassociate",
}
if input == nil {
input = &DisassociateResourceInput{}
}