-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
api.go
5773 lines (5083 loc) · 202 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 cloudwatchrum
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 opBatchCreateRumMetricDefinitions = "BatchCreateRumMetricDefinitions"
// BatchCreateRumMetricDefinitionsRequest generates a "aws/request.Request" representing the
// client's request for the BatchCreateRumMetricDefinitions 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 BatchCreateRumMetricDefinitions for more information on using the BatchCreateRumMetricDefinitions
// 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 BatchCreateRumMetricDefinitionsRequest method.
// req, resp := client.BatchCreateRumMetricDefinitionsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/rum-2018-05-10/BatchCreateRumMetricDefinitions
func (c *CloudWatchRUM) BatchCreateRumMetricDefinitionsRequest(input *BatchCreateRumMetricDefinitionsInput) (req *request.Request, output *BatchCreateRumMetricDefinitionsOutput) {
op := &request.Operation{
Name: opBatchCreateRumMetricDefinitions,
HTTPMethod: "POST",
HTTPPath: "/rummetrics/{AppMonitorName}/metrics",
}
if input == nil {
input = &BatchCreateRumMetricDefinitionsInput{}
}
output = &BatchCreateRumMetricDefinitionsOutput{}
req = c.newRequest(op, input, output)
return
}
// BatchCreateRumMetricDefinitions API operation for CloudWatch RUM.
//
// Specifies the extended metrics and custom metrics that you want a CloudWatch
// RUM app monitor to send to a destination. Valid destinations include CloudWatch
// and Evidently.
//
// By default, RUM app monitors send some metrics to CloudWatch. These default
// metrics are listed in CloudWatch metrics that you can collect with CloudWatch
// RUM (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-metrics.html).
//
// In addition to these default metrics, you can choose to send extended metrics
// or custom metrics or both.
//
// - Extended metrics enable you to send metrics with additional dimensions
// not included in the default metrics. You can also send extended metrics
// to Evidently as well as CloudWatch. The valid dimension names for the
// additional dimensions for extended metrics are BrowserName, CountryCode,
// DeviceType, FileType, OSName, and PageId. For more information, see Extended
// metrics that you can send to CloudWatch and CloudWatch Evidently (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-vended-metrics.html).
//
// - Custom metrics are metrics that you define. You can send custom metrics
// to CloudWatch or to CloudWatch Evidently or to both. With custom metrics,
// you can use any metric name and namespace, and to derive the metrics you
// can use any custom events, built-in events, custom attributes, or default
// attributes. You can't send custom metrics to the AWS/RUM namespace. You
// must send custom metrics to a custom namespace that you define. The namespace
// that you use can't start with AWS/. CloudWatch RUM prepends RUM/CustomMetrics/
// to the custom namespace that you define, so the final namespace for your
// metrics in CloudWatch is RUM/CustomMetrics/your-custom-namespace .
//
// The maximum number of metric definitions that you can specify in one BatchCreateRumMetricDefinitions
// operation is 200.
//
// The maximum number of metric definitions that one destination can contain
// is 2000.
//
// Extended metrics sent to CloudWatch and RUM custom metrics are charged as
// CloudWatch custom metrics. Each combination of additional dimension name
// and dimension value counts as a custom metric. For more information, see
// Amazon CloudWatch Pricing (https://aws.amazon.com/cloudwatch/pricing/).
//
// You must have already created a destination for the metrics before you send
// them. For more information, see PutRumMetricsDestination (https://docs.aws.amazon.com/cloudwatchrum/latest/APIReference/API_PutRumMetricsDestination.html).
//
// If some metric definitions specified in a BatchCreateRumMetricDefinitions
// operations are not valid, those metric definitions fail and return errors,
// but all valid metric definitions in the same operation still succeed.
//
// 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 CloudWatch RUM's
// API operation BatchCreateRumMetricDefinitions for usage and error information.
//
// Returned Error Types:
//
// - ConflictException
// This operation attempted to create a resource that already exists.
//
// - ServiceQuotaExceededException
// This request exceeds a service quota.
//
// - ResourceNotFoundException
// Resource not found.
//
// - InternalServerException
// Internal service exception.
//
// - ValidationException
// One of the arguments for the request is not valid.
//
// - ThrottlingException
// The request was throttled because of quota limits.
//
// - AccessDeniedException
// You don't have sufficient permissions to perform this action.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/rum-2018-05-10/BatchCreateRumMetricDefinitions
func (c *CloudWatchRUM) BatchCreateRumMetricDefinitions(input *BatchCreateRumMetricDefinitionsInput) (*BatchCreateRumMetricDefinitionsOutput, error) {
req, out := c.BatchCreateRumMetricDefinitionsRequest(input)
return out, req.Send()
}
// BatchCreateRumMetricDefinitionsWithContext is the same as BatchCreateRumMetricDefinitions with the addition of
// the ability to pass a context and additional request options.
//
// See BatchCreateRumMetricDefinitions 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 *CloudWatchRUM) BatchCreateRumMetricDefinitionsWithContext(ctx aws.Context, input *BatchCreateRumMetricDefinitionsInput, opts ...request.Option) (*BatchCreateRumMetricDefinitionsOutput, error) {
req, out := c.BatchCreateRumMetricDefinitionsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opBatchDeleteRumMetricDefinitions = "BatchDeleteRumMetricDefinitions"
// BatchDeleteRumMetricDefinitionsRequest generates a "aws/request.Request" representing the
// client's request for the BatchDeleteRumMetricDefinitions 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 BatchDeleteRumMetricDefinitions for more information on using the BatchDeleteRumMetricDefinitions
// 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 BatchDeleteRumMetricDefinitionsRequest method.
// req, resp := client.BatchDeleteRumMetricDefinitionsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/rum-2018-05-10/BatchDeleteRumMetricDefinitions
func (c *CloudWatchRUM) BatchDeleteRumMetricDefinitionsRequest(input *BatchDeleteRumMetricDefinitionsInput) (req *request.Request, output *BatchDeleteRumMetricDefinitionsOutput) {
op := &request.Operation{
Name: opBatchDeleteRumMetricDefinitions,
HTTPMethod: "DELETE",
HTTPPath: "/rummetrics/{AppMonitorName}/metrics",
}
if input == nil {
input = &BatchDeleteRumMetricDefinitionsInput{}
}
output = &BatchDeleteRumMetricDefinitionsOutput{}
req = c.newRequest(op, input, output)
return
}
// BatchDeleteRumMetricDefinitions API operation for CloudWatch RUM.
//
// Removes the specified metrics from being sent to an extended metrics destination.
//
// If some metric definition IDs specified in a BatchDeleteRumMetricDefinitions
// operations are not valid, those metric definitions fail and return errors,
// but all valid metric definition IDs in the same operation are still deleted.
//
// The maximum number of metric definitions that you can specify in one BatchDeleteRumMetricDefinitions
// operation is 200.
//
// 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 CloudWatch RUM's
// API operation BatchDeleteRumMetricDefinitions for usage and error information.
//
// Returned Error Types:
//
// - ConflictException
// This operation attempted to create a resource that already exists.
//
// - ResourceNotFoundException
// Resource not found.
//
// - InternalServerException
// Internal service exception.
//
// - ValidationException
// One of the arguments for the request is not valid.
//
// - ThrottlingException
// The request was throttled because of quota limits.
//
// - AccessDeniedException
// You don't have sufficient permissions to perform this action.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/rum-2018-05-10/BatchDeleteRumMetricDefinitions
func (c *CloudWatchRUM) BatchDeleteRumMetricDefinitions(input *BatchDeleteRumMetricDefinitionsInput) (*BatchDeleteRumMetricDefinitionsOutput, error) {
req, out := c.BatchDeleteRumMetricDefinitionsRequest(input)
return out, req.Send()
}
// BatchDeleteRumMetricDefinitionsWithContext is the same as BatchDeleteRumMetricDefinitions with the addition of
// the ability to pass a context and additional request options.
//
// See BatchDeleteRumMetricDefinitions 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 *CloudWatchRUM) BatchDeleteRumMetricDefinitionsWithContext(ctx aws.Context, input *BatchDeleteRumMetricDefinitionsInput, opts ...request.Option) (*BatchDeleteRumMetricDefinitionsOutput, error) {
req, out := c.BatchDeleteRumMetricDefinitionsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opBatchGetRumMetricDefinitions = "BatchGetRumMetricDefinitions"
// BatchGetRumMetricDefinitionsRequest generates a "aws/request.Request" representing the
// client's request for the BatchGetRumMetricDefinitions 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 BatchGetRumMetricDefinitions for more information on using the BatchGetRumMetricDefinitions
// 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 BatchGetRumMetricDefinitionsRequest method.
// req, resp := client.BatchGetRumMetricDefinitionsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/rum-2018-05-10/BatchGetRumMetricDefinitions
func (c *CloudWatchRUM) BatchGetRumMetricDefinitionsRequest(input *BatchGetRumMetricDefinitionsInput) (req *request.Request, output *BatchGetRumMetricDefinitionsOutput) {
op := &request.Operation{
Name: opBatchGetRumMetricDefinitions,
HTTPMethod: "GET",
HTTPPath: "/rummetrics/{AppMonitorName}/metrics",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &BatchGetRumMetricDefinitionsInput{}
}
output = &BatchGetRumMetricDefinitionsOutput{}
req = c.newRequest(op, input, output)
return
}
// BatchGetRumMetricDefinitions API operation for CloudWatch RUM.
//
// Retrieves the list of metrics and dimensions that a RUM app monitor is sending
// to a single destination.
//
// 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 CloudWatch RUM's
// API operation BatchGetRumMetricDefinitions for usage and error information.
//
// Returned Error Types:
//
// - ResourceNotFoundException
// Resource not found.
//
// - InternalServerException
// Internal service exception.
//
// - ValidationException
// One of the arguments for the request is not valid.
//
// - AccessDeniedException
// You don't have sufficient permissions to perform this action.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/rum-2018-05-10/BatchGetRumMetricDefinitions
func (c *CloudWatchRUM) BatchGetRumMetricDefinitions(input *BatchGetRumMetricDefinitionsInput) (*BatchGetRumMetricDefinitionsOutput, error) {
req, out := c.BatchGetRumMetricDefinitionsRequest(input)
return out, req.Send()
}
// BatchGetRumMetricDefinitionsWithContext is the same as BatchGetRumMetricDefinitions with the addition of
// the ability to pass a context and additional request options.
//
// See BatchGetRumMetricDefinitions 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 *CloudWatchRUM) BatchGetRumMetricDefinitionsWithContext(ctx aws.Context, input *BatchGetRumMetricDefinitionsInput, opts ...request.Option) (*BatchGetRumMetricDefinitionsOutput, error) {
req, out := c.BatchGetRumMetricDefinitionsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// BatchGetRumMetricDefinitionsPages iterates over the pages of a BatchGetRumMetricDefinitions operation,
// calling the "fn" function with the response data for each page. To stop
// iterating, return false from the fn function.
//
// See BatchGetRumMetricDefinitions 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 BatchGetRumMetricDefinitions operation.
// pageNum := 0
// err := client.BatchGetRumMetricDefinitionsPages(params,
// func(page *cloudwatchrum.BatchGetRumMetricDefinitionsOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
// })
func (c *CloudWatchRUM) BatchGetRumMetricDefinitionsPages(input *BatchGetRumMetricDefinitionsInput, fn func(*BatchGetRumMetricDefinitionsOutput, bool) bool) error {
return c.BatchGetRumMetricDefinitionsPagesWithContext(aws.BackgroundContext(), input, fn)
}
// BatchGetRumMetricDefinitionsPagesWithContext same as BatchGetRumMetricDefinitionsPages 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 *CloudWatchRUM) BatchGetRumMetricDefinitionsPagesWithContext(ctx aws.Context, input *BatchGetRumMetricDefinitionsInput, fn func(*BatchGetRumMetricDefinitionsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *BatchGetRumMetricDefinitionsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.BatchGetRumMetricDefinitionsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*BatchGetRumMetricDefinitionsOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
}
const opCreateAppMonitor = "CreateAppMonitor"
// CreateAppMonitorRequest generates a "aws/request.Request" representing the
// client's request for the CreateAppMonitor 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 CreateAppMonitor for more information on using the CreateAppMonitor
// 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 CreateAppMonitorRequest method.
// req, resp := client.CreateAppMonitorRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/rum-2018-05-10/CreateAppMonitor
func (c *CloudWatchRUM) CreateAppMonitorRequest(input *CreateAppMonitorInput) (req *request.Request, output *CreateAppMonitorOutput) {
op := &request.Operation{
Name: opCreateAppMonitor,
HTTPMethod: "POST",
HTTPPath: "/appmonitor",
}
if input == nil {
input = &CreateAppMonitorInput{}
}
output = &CreateAppMonitorOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateAppMonitor API operation for CloudWatch RUM.
//
// Creates a Amazon CloudWatch RUM app monitor, which collects telemetry data
// from your application and sends that data to RUM. The data includes performance
// and reliability information such as page load time, client-side errors, and
// user behavior.
//
// You use this operation only to create a new app monitor. To update an existing
// app monitor, use UpdateAppMonitor (https://docs.aws.amazon.com/cloudwatchrum/latest/APIReference/API_UpdateAppMonitor.html)
// instead.
//
// After you create an app monitor, sign in to the CloudWatch RUM console to
// get the JavaScript code snippet to add to your web application. For more
// information, see How do I find a code snippet that I've already generated?
// (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-find-code-snippet.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 CloudWatch RUM's
// API operation CreateAppMonitor for usage and error information.
//
// Returned Error Types:
//
// - ConflictException
// This operation attempted to create a resource that already exists.
//
// - ServiceQuotaExceededException
// This request exceeds a service quota.
//
// - ResourceNotFoundException
// Resource not found.
//
// - InternalServerException
// Internal service exception.
//
// - ValidationException
// One of the arguments for the request is not valid.
//
// - ThrottlingException
// The request was throttled because of quota limits.
//
// - AccessDeniedException
// You don't have sufficient permissions to perform this action.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/rum-2018-05-10/CreateAppMonitor
func (c *CloudWatchRUM) CreateAppMonitor(input *CreateAppMonitorInput) (*CreateAppMonitorOutput, error) {
req, out := c.CreateAppMonitorRequest(input)
return out, req.Send()
}
// CreateAppMonitorWithContext is the same as CreateAppMonitor with the addition of
// the ability to pass a context and additional request options.
//
// See CreateAppMonitor 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 *CloudWatchRUM) CreateAppMonitorWithContext(ctx aws.Context, input *CreateAppMonitorInput, opts ...request.Option) (*CreateAppMonitorOutput, error) {
req, out := c.CreateAppMonitorRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteAppMonitor = "DeleteAppMonitor"
// DeleteAppMonitorRequest generates a "aws/request.Request" representing the
// client's request for the DeleteAppMonitor 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 DeleteAppMonitor for more information on using the DeleteAppMonitor
// 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 DeleteAppMonitorRequest method.
// req, resp := client.DeleteAppMonitorRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/rum-2018-05-10/DeleteAppMonitor
func (c *CloudWatchRUM) DeleteAppMonitorRequest(input *DeleteAppMonitorInput) (req *request.Request, output *DeleteAppMonitorOutput) {
op := &request.Operation{
Name: opDeleteAppMonitor,
HTTPMethod: "DELETE",
HTTPPath: "/appmonitor/{Name}",
}
if input == nil {
input = &DeleteAppMonitorInput{}
}
output = &DeleteAppMonitorOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// DeleteAppMonitor API operation for CloudWatch RUM.
//
// Deletes an existing app monitor. This immediately stops the collection of
// data.
//
// 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 CloudWatch RUM's
// API operation DeleteAppMonitor for usage and error information.
//
// Returned Error Types:
//
// - ConflictException
// This operation attempted to create a resource that already exists.
//
// - ResourceNotFoundException
// Resource not found.
//
// - InternalServerException
// Internal service exception.
//
// - ValidationException
// One of the arguments for the request is not valid.
//
// - ThrottlingException
// The request was throttled because of quota limits.
//
// - AccessDeniedException
// You don't have sufficient permissions to perform this action.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/rum-2018-05-10/DeleteAppMonitor
func (c *CloudWatchRUM) DeleteAppMonitor(input *DeleteAppMonitorInput) (*DeleteAppMonitorOutput, error) {
req, out := c.DeleteAppMonitorRequest(input)
return out, req.Send()
}
// DeleteAppMonitorWithContext is the same as DeleteAppMonitor with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteAppMonitor 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 *CloudWatchRUM) DeleteAppMonitorWithContext(ctx aws.Context, input *DeleteAppMonitorInput, opts ...request.Option) (*DeleteAppMonitorOutput, error) {
req, out := c.DeleteAppMonitorRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteRumMetricsDestination = "DeleteRumMetricsDestination"
// DeleteRumMetricsDestinationRequest generates a "aws/request.Request" representing the
// client's request for the DeleteRumMetricsDestination 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 DeleteRumMetricsDestination for more information on using the DeleteRumMetricsDestination
// 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 DeleteRumMetricsDestinationRequest method.
// req, resp := client.DeleteRumMetricsDestinationRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/rum-2018-05-10/DeleteRumMetricsDestination
func (c *CloudWatchRUM) DeleteRumMetricsDestinationRequest(input *DeleteRumMetricsDestinationInput) (req *request.Request, output *DeleteRumMetricsDestinationOutput) {
op := &request.Operation{
Name: opDeleteRumMetricsDestination,
HTTPMethod: "DELETE",
HTTPPath: "/rummetrics/{AppMonitorName}/metricsdestination",
}
if input == nil {
input = &DeleteRumMetricsDestinationInput{}
}
output = &DeleteRumMetricsDestinationOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// DeleteRumMetricsDestination API operation for CloudWatch RUM.
//
// Deletes a destination for CloudWatch RUM extended metrics, so that the specified
// app monitor stops sending extended metrics to that destination.
//
// 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 CloudWatch RUM's
// API operation DeleteRumMetricsDestination for usage and error information.
//
// Returned Error Types:
//
// - ConflictException
// This operation attempted to create a resource that already exists.
//
// - ResourceNotFoundException
// Resource not found.
//
// - InternalServerException
// Internal service exception.
//
// - ValidationException
// One of the arguments for the request is not valid.
//
// - ThrottlingException
// The request was throttled because of quota limits.
//
// - AccessDeniedException
// You don't have sufficient permissions to perform this action.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/rum-2018-05-10/DeleteRumMetricsDestination
func (c *CloudWatchRUM) DeleteRumMetricsDestination(input *DeleteRumMetricsDestinationInput) (*DeleteRumMetricsDestinationOutput, error) {
req, out := c.DeleteRumMetricsDestinationRequest(input)
return out, req.Send()
}
// DeleteRumMetricsDestinationWithContext is the same as DeleteRumMetricsDestination with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteRumMetricsDestination 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 *CloudWatchRUM) DeleteRumMetricsDestinationWithContext(ctx aws.Context, input *DeleteRumMetricsDestinationInput, opts ...request.Option) (*DeleteRumMetricsDestinationOutput, error) {
req, out := c.DeleteRumMetricsDestinationRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opGetAppMonitor = "GetAppMonitor"
// GetAppMonitorRequest generates a "aws/request.Request" representing the
// client's request for the GetAppMonitor 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 GetAppMonitor for more information on using the GetAppMonitor
// 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 GetAppMonitorRequest method.
// req, resp := client.GetAppMonitorRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/rum-2018-05-10/GetAppMonitor
func (c *CloudWatchRUM) GetAppMonitorRequest(input *GetAppMonitorInput) (req *request.Request, output *GetAppMonitorOutput) {
op := &request.Operation{
Name: opGetAppMonitor,
HTTPMethod: "GET",
HTTPPath: "/appmonitor/{Name}",
}
if input == nil {
input = &GetAppMonitorInput{}
}
output = &GetAppMonitorOutput{}
req = c.newRequest(op, input, output)
return
}
// GetAppMonitor API operation for CloudWatch RUM.
//
// Retrieves the complete configuration information for one app monitor.
//
// 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 CloudWatch RUM's
// API operation GetAppMonitor for usage and error information.
//
// Returned Error Types:
//
// - ResourceNotFoundException
// Resource not found.
//
// - InternalServerException
// Internal service exception.
//
// - ValidationException
// One of the arguments for the request is not valid.
//
// - ThrottlingException
// The request was throttled because of quota limits.
//
// - AccessDeniedException
// You don't have sufficient permissions to perform this action.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/rum-2018-05-10/GetAppMonitor
func (c *CloudWatchRUM) GetAppMonitor(input *GetAppMonitorInput) (*GetAppMonitorOutput, error) {
req, out := c.GetAppMonitorRequest(input)
return out, req.Send()
}
// GetAppMonitorWithContext is the same as GetAppMonitor with the addition of
// the ability to pass a context and additional request options.
//
// See GetAppMonitor 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 *CloudWatchRUM) GetAppMonitorWithContext(ctx aws.Context, input *GetAppMonitorInput, opts ...request.Option) (*GetAppMonitorOutput, error) {
req, out := c.GetAppMonitorRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opGetAppMonitorData = "GetAppMonitorData"
// GetAppMonitorDataRequest generates a "aws/request.Request" representing the
// client's request for the GetAppMonitorData 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 GetAppMonitorData for more information on using the GetAppMonitorData
// 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 GetAppMonitorDataRequest method.
// req, resp := client.GetAppMonitorDataRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/rum-2018-05-10/GetAppMonitorData
func (c *CloudWatchRUM) GetAppMonitorDataRequest(input *GetAppMonitorDataInput) (req *request.Request, output *GetAppMonitorDataOutput) {
op := &request.Operation{
Name: opGetAppMonitorData,
HTTPMethod: "POST",
HTTPPath: "/appmonitor/{Name}/data",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &GetAppMonitorDataInput{}
}
output = &GetAppMonitorDataOutput{}
req = c.newRequest(op, input, output)
return
}
// GetAppMonitorData API operation for CloudWatch RUM.
//
// Retrieves the raw performance events that RUM has collected from your web
// application, so that you can do your own processing or analysis of this data.
//
// 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 CloudWatch RUM's
// API operation GetAppMonitorData for usage and error information.
//
// Returned Error Types:
//
// - ResourceNotFoundException
// Resource not found.
//
// - InternalServerException
// Internal service exception.
//
// - ValidationException
// One of the arguments for the request is not valid.
//
// - ThrottlingException
// The request was throttled because of quota limits.
//
// - AccessDeniedException
// You don't have sufficient permissions to perform this action.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/rum-2018-05-10/GetAppMonitorData
func (c *CloudWatchRUM) GetAppMonitorData(input *GetAppMonitorDataInput) (*GetAppMonitorDataOutput, error) {
req, out := c.GetAppMonitorDataRequest(input)
return out, req.Send()
}
// GetAppMonitorDataWithContext is the same as GetAppMonitorData with the addition of
// the ability to pass a context and additional request options.
//
// See GetAppMonitorData 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 *CloudWatchRUM) GetAppMonitorDataWithContext(ctx aws.Context, input *GetAppMonitorDataInput, opts ...request.Option) (*GetAppMonitorDataOutput, error) {
req, out := c.GetAppMonitorDataRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// GetAppMonitorDataPages iterates over the pages of a GetAppMonitorData operation,
// calling the "fn" function with the response data for each page. To stop
// iterating, return false from the fn function.
//
// See GetAppMonitorData 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 GetAppMonitorData operation.
// pageNum := 0
// err := client.GetAppMonitorDataPages(params,
// func(page *cloudwatchrum.GetAppMonitorDataOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
// })
func (c *CloudWatchRUM) GetAppMonitorDataPages(input *GetAppMonitorDataInput, fn func(*GetAppMonitorDataOutput, bool) bool) error {
return c.GetAppMonitorDataPagesWithContext(aws.BackgroundContext(), input, fn)
}
// GetAppMonitorDataPagesWithContext same as GetAppMonitorDataPages 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 *CloudWatchRUM) GetAppMonitorDataPagesWithContext(ctx aws.Context, input *GetAppMonitorDataInput, fn func(*GetAppMonitorDataOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *GetAppMonitorDataInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.GetAppMonitorDataRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*GetAppMonitorDataOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
}
const opListAppMonitors = "ListAppMonitors"
// ListAppMonitorsRequest generates a "aws/request.Request" representing the
// client's request for the ListAppMonitors 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 ListAppMonitors for more information on using the ListAppMonitors
// 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 ListAppMonitorsRequest method.
// req, resp := client.ListAppMonitorsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/rum-2018-05-10/ListAppMonitors
func (c *CloudWatchRUM) ListAppMonitorsRequest(input *ListAppMonitorsInput) (req *request.Request, output *ListAppMonitorsOutput) {
op := &request.Operation{
Name: opListAppMonitors,
HTTPMethod: "POST",
HTTPPath: "/appmonitors",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &ListAppMonitorsInput{}
}
output = &ListAppMonitorsOutput{}
req = c.newRequest(op, input, output)
return
}
// ListAppMonitors API operation for CloudWatch RUM.
//
// Returns a list of the Amazon CloudWatch RUM app monitors in the account.
//
// 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 CloudWatch RUM's