/
cloudwatch.jl
2204 lines (2061 loc) · 105 KB
/
cloudwatch.jl
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
# This file is auto-generated by AWSMetadata.jl
using AWS
using AWS.AWSServices: cloudwatch
using AWS.Compat
using AWS.UUIDs
"""
delete_alarms(alarm_names)
delete_alarms(alarm_names, params::Dict{String,<:Any})
Deletes the specified alarms. You can delete up to 100 alarms in one operation. However,
this total can include no more than one composite alarm. For example, you could delete 99
metric alarms and one composite alarms with one operation, but you can't delete two
composite alarms with one operation. If you specify an incorrect alarm name or make any
other error in the operation, no alarms are deleted. To confirm that alarms were deleted
successfully, you can use the DescribeAlarms operation after using DeleteAlarms. It is
possible to create a loop or cycle of composite alarms, where composite alarm A depends on
composite alarm B, and composite alarm B also depends on composite alarm A. In this
scenario, you can't delete any composite alarm that is part of the cycle because there is
always still a composite alarm that depends on that alarm that you want to delete. To get
out of such a situation, you must break the cycle by changing the rule of one of the
composite alarms in the cycle to remove a dependency that creates the cycle. The simplest
change to make to break a cycle is to change the AlarmRule of one of the alarms to false.
Additionally, the evaluation of composite alarms stops if CloudWatch detects a cycle in the
evaluation path.
# Arguments
- `alarm_names`: The alarms to be deleted. Do not enclose the alarm names in quote marks.
"""
function delete_alarms(AlarmNames; aws_config::AbstractAWSConfig=global_aws_config())
return cloudwatch(
"DeleteAlarms",
Dict{String,Any}("AlarmNames" => AlarmNames);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function delete_alarms(
AlarmNames,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return cloudwatch(
"DeleteAlarms",
Dict{String,Any}(
mergewith(_merge, Dict{String,Any}("AlarmNames" => AlarmNames), params)
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
delete_anomaly_detector()
delete_anomaly_detector(params::Dict{String,<:Any})
Deletes the specified anomaly detection model from your account. For more information
about how to delete an anomaly detection model, see Deleting an anomaly detection model in
the CloudWatch User Guide.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"Dimensions"`: The metric dimensions associated with the anomaly detection model to
delete.
- `"MetricMathAnomalyDetector"`: The metric math anomaly detector to be deleted. When using
MetricMathAnomalyDetector, you cannot include following parameters in the same operation:
Dimensions, MetricName Namespace Stat the SingleMetricAnomalyDetector
parameters of DeleteAnomalyDetectorInput Instead, specify the metric math anomaly
detector attributes as part of the MetricMathAnomalyDetector property.
- `"MetricName"`: The metric name associated with the anomaly detection model to delete.
- `"Namespace"`: The namespace associated with the anomaly detection model to delete.
- `"SingleMetricAnomalyDetector"`: A single metric anomaly detector to be deleted. When
using SingleMetricAnomalyDetector, you cannot include the following parameters in the same
operation: Dimensions, MetricName Namespace Stat the
MetricMathAnomalyDetector parameters of DeleteAnomalyDetectorInput Instead, specify the
single metric anomaly detector attributes as part of the SingleMetricAnomalyDetector
property.
- `"Stat"`: The statistic associated with the anomaly detection model to delete.
"""
function delete_anomaly_detector(; aws_config::AbstractAWSConfig=global_aws_config())
return cloudwatch(
"DeleteAnomalyDetector"; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
)
end
function delete_anomaly_detector(
params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
return cloudwatch(
"DeleteAnomalyDetector",
params;
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
delete_dashboards(dashboard_names)
delete_dashboards(dashboard_names, params::Dict{String,<:Any})
Deletes all dashboards that you specify. You can specify up to 100 dashboards to delete. If
there is an error during this call, no dashboards are deleted.
# Arguments
- `dashboard_names`: The dashboards to be deleted. This parameter is required.
"""
function delete_dashboards(
DashboardNames; aws_config::AbstractAWSConfig=global_aws_config()
)
return cloudwatch(
"DeleteDashboards",
Dict{String,Any}("DashboardNames" => DashboardNames);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function delete_dashboards(
DashboardNames,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return cloudwatch(
"DeleteDashboards",
Dict{String,Any}(
mergewith(_merge, Dict{String,Any}("DashboardNames" => DashboardNames), params)
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
delete_insight_rules(rule_names)
delete_insight_rules(rule_names, params::Dict{String,<:Any})
Permanently deletes the specified Contributor Insights rules. If you create a rule, delete
it, and then re-create it with the same name, historical data from the first time the rule
was created might not be available.
# Arguments
- `rule_names`: An array of the rule names to delete. If you need to find out the names of
your rules, use DescribeInsightRules.
"""
function delete_insight_rules(RuleNames; aws_config::AbstractAWSConfig=global_aws_config())
return cloudwatch(
"DeleteInsightRules",
Dict{String,Any}("RuleNames" => RuleNames);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function delete_insight_rules(
RuleNames,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return cloudwatch(
"DeleteInsightRules",
Dict{String,Any}(
mergewith(_merge, Dict{String,Any}("RuleNames" => RuleNames), params)
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
delete_metric_stream(name)
delete_metric_stream(name, params::Dict{String,<:Any})
Permanently deletes the metric stream that you specify.
# Arguments
- `name`: The name of the metric stream to delete.
"""
function delete_metric_stream(Name; aws_config::AbstractAWSConfig=global_aws_config())
return cloudwatch(
"DeleteMetricStream",
Dict{String,Any}("Name" => Name);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function delete_metric_stream(
Name, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
return cloudwatch(
"DeleteMetricStream",
Dict{String,Any}(mergewith(_merge, Dict{String,Any}("Name" => Name), params));
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
describe_alarm_history()
describe_alarm_history(params::Dict{String,<:Any})
Retrieves the history for the specified alarm. You can filter the results by date range or
item type. If an alarm name is not specified, the histories for either all metric alarms or
all composite alarms are returned. CloudWatch retains the history of an alarm even if you
delete the alarm. To use this operation and return information about a composite alarm, you
must be signed on with the cloudwatch:DescribeAlarmHistory permission that is scoped to *.
You can't return information about composite alarms if your cloudwatch:DescribeAlarmHistory
permission has a narrower scope.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"AlarmName"`: The name of the alarm.
- `"AlarmTypes"`: Use this parameter to specify whether you want the operation to return
metric alarms or composite alarms. If you omit this parameter, only metric alarms are
returned.
- `"EndDate"`: The ending date to retrieve alarm history.
- `"HistoryItemType"`: The type of alarm histories to retrieve.
- `"MaxRecords"`: The maximum number of alarm history records to retrieve.
- `"NextToken"`: The token returned by a previous call to indicate that there is more data
available.
- `"ScanBy"`: Specified whether to return the newest or oldest alarm history first. Specify
TimestampDescending to have the newest event history returned first, and specify
TimestampAscending to have the oldest history returned first.
- `"StartDate"`: The starting date to retrieve alarm history.
"""
function describe_alarm_history(; aws_config::AbstractAWSConfig=global_aws_config())
return cloudwatch(
"DescribeAlarmHistory"; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
)
end
function describe_alarm_history(
params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
return cloudwatch(
"DescribeAlarmHistory",
params;
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
describe_alarms()
describe_alarms(params::Dict{String,<:Any})
Retrieves the specified alarms. You can filter the results by specifying a prefix for the
alarm name, the alarm state, or a prefix for any action. To use this operation and return
information about composite alarms, you must be signed on with the
cloudwatch:DescribeAlarms permission that is scoped to *. You can't return information
about composite alarms if your cloudwatch:DescribeAlarms permission has a narrower scope.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"ActionPrefix"`: Use this parameter to filter the results of the operation to only those
alarms that use a certain alarm action. For example, you could specify the ARN of an SNS
topic to find all alarms that send notifications to that topic.
- `"AlarmNamePrefix"`: An alarm name prefix. If you specify this parameter, you receive
information about all alarms that have names that start with this prefix. If this parameter
is specified, you cannot specify AlarmNames.
- `"AlarmNames"`: The names of the alarms to retrieve information about.
- `"AlarmTypes"`: Use this parameter to specify whether you want the operation to return
metric alarms or composite alarms. If you omit this parameter, only metric alarms are
returned.
- `"ChildrenOfAlarmName"`: If you use this parameter and specify the name of a composite
alarm, the operation returns information about the \"children\" alarms of the alarm you
specify. These are the metric alarms and composite alarms referenced in the AlarmRule field
of the composite alarm that you specify in ChildrenOfAlarmName. Information about the
composite alarm that you name in ChildrenOfAlarmName is not returned. If you specify
ChildrenOfAlarmName, you cannot specify any other parameters in the request except for
MaxRecords and NextToken. If you do so, you receive a validation error. Only the Alarm
Name, ARN, StateValue (OK/ALARM/INSUFFICIENT_DATA), and StateUpdatedTimestamp information
are returned by this operation when you use this parameter. To get complete information
about these alarms, perform another DescribeAlarms operation and specify the parent alarm
names in the AlarmNames parameter.
- `"MaxRecords"`: The maximum number of alarm descriptions to retrieve.
- `"NextToken"`: The token returned by a previous call to indicate that there is more data
available.
- `"ParentsOfAlarmName"`: If you use this parameter and specify the name of a metric or
composite alarm, the operation returns information about the \"parent\" alarms of the alarm
you specify. These are the composite alarms that have AlarmRule parameters that reference
the alarm named in ParentsOfAlarmName. Information about the alarm that you specify in
ParentsOfAlarmName is not returned. If you specify ParentsOfAlarmName, you cannot specify
any other parameters in the request except for MaxRecords and NextToken. If you do so, you
receive a validation error. Only the Alarm Name and ARN are returned by this operation
when you use this parameter. To get complete information about these alarms, perform
another DescribeAlarms operation and specify the parent alarm names in the AlarmNames
parameter.
- `"StateValue"`: Specify this parameter to receive information only about alarms that are
currently in the state that you specify.
"""
function describe_alarms(; aws_config::AbstractAWSConfig=global_aws_config())
return cloudwatch(
"DescribeAlarms"; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
)
end
function describe_alarms(
params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
return cloudwatch(
"DescribeAlarms", params; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
)
end
"""
describe_alarms_for_metric(metric_name, namespace)
describe_alarms_for_metric(metric_name, namespace, params::Dict{String,<:Any})
Retrieves the alarms for the specified metric. To filter the results, specify a statistic,
period, or unit. This operation retrieves only standard alarms that are based on the
specified metric. It does not return alarms based on math expressions that use the
specified metric, or composite alarms that use the specified metric.
# Arguments
- `metric_name`: The name of the metric.
- `namespace`: The namespace of the metric.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"Dimensions"`: The dimensions associated with the metric. If the metric has any
associated dimensions, you must specify them in order for the call to succeed.
- `"ExtendedStatistic"`: The percentile statistic for the metric. Specify a value between
p0.0 and p100.
- `"Period"`: The period, in seconds, over which the statistic is applied.
- `"Statistic"`: The statistic for the metric, other than percentiles. For percentile
statistics, use ExtendedStatistics.
- `"Unit"`: The unit for the metric.
"""
function describe_alarms_for_metric(
MetricName, Namespace; aws_config::AbstractAWSConfig=global_aws_config()
)
return cloudwatch(
"DescribeAlarmsForMetric",
Dict{String,Any}("MetricName" => MetricName, "Namespace" => Namespace);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function describe_alarms_for_metric(
MetricName,
Namespace,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return cloudwatch(
"DescribeAlarmsForMetric",
Dict{String,Any}(
mergewith(
_merge,
Dict{String,Any}("MetricName" => MetricName, "Namespace" => Namespace),
params,
),
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
describe_anomaly_detectors()
describe_anomaly_detectors(params::Dict{String,<:Any})
Lists the anomaly detection models that you have created in your account. For single metric
anomaly detectors, you can list all of the models in your account or filter the results to
only the models that are related to a certain namespace, metric name, or metric dimension.
For metric math anomaly detectors, you can list them by adding METRIC_MATH to the
AnomalyDetectorTypes array. This will return all metric math anomaly detectors in your
account.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"AnomalyDetectorTypes"`: The anomaly detector types to request when using
DescribeAnomalyDetectorsInput. If empty, defaults to SINGLE_METRIC.
- `"Dimensions"`: Limits the results to only the anomaly detection models that are
associated with the specified metric dimensions. If there are multiple metrics that have
these dimensions and have anomaly detection models associated, they're all returned.
- `"MaxResults"`: The maximum number of results to return in one operation. The maximum
value that you can specify is 100. To retrieve the remaining results, make another call
with the returned NextToken value.
- `"MetricName"`: Limits the results to only the anomaly detection models that are
associated with the specified metric name. If there are multiple metrics with this name in
different namespaces that have anomaly detection models, they're all returned.
- `"Namespace"`: Limits the results to only the anomaly detection models that are
associated with the specified namespace.
- `"NextToken"`: Use the token returned by the previous operation to request the next page
of results.
"""
function describe_anomaly_detectors(; aws_config::AbstractAWSConfig=global_aws_config())
return cloudwatch(
"DescribeAnomalyDetectors"; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
)
end
function describe_anomaly_detectors(
params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
return cloudwatch(
"DescribeAnomalyDetectors",
params;
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
describe_insight_rules()
describe_insight_rules(params::Dict{String,<:Any})
Returns a list of all the Contributor Insights rules in your account. For more information
about Contributor Insights, see Using Contributor Insights to Analyze High-Cardinality Data.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"MaxResults"`: The maximum number of results to return in one operation. If you omit
this parameter, the default of 500 is used.
- `"NextToken"`: Include this value, if it was returned by the previous operation, to get
the next set of rules.
"""
function describe_insight_rules(; aws_config::AbstractAWSConfig=global_aws_config())
return cloudwatch(
"DescribeInsightRules"; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
)
end
function describe_insight_rules(
params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
return cloudwatch(
"DescribeInsightRules",
params;
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
disable_alarm_actions(alarm_names)
disable_alarm_actions(alarm_names, params::Dict{String,<:Any})
Disables the actions for the specified alarms. When an alarm's actions are disabled, the
alarm actions do not execute when the alarm state changes.
# Arguments
- `alarm_names`: The names of the alarms.
"""
function disable_alarm_actions(
AlarmNames; aws_config::AbstractAWSConfig=global_aws_config()
)
return cloudwatch(
"DisableAlarmActions",
Dict{String,Any}("AlarmNames" => AlarmNames);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function disable_alarm_actions(
AlarmNames,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return cloudwatch(
"DisableAlarmActions",
Dict{String,Any}(
mergewith(_merge, Dict{String,Any}("AlarmNames" => AlarmNames), params)
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
disable_insight_rules(rule_names)
disable_insight_rules(rule_names, params::Dict{String,<:Any})
Disables the specified Contributor Insights rules. When rules are disabled, they do not
analyze log groups and do not incur costs.
# Arguments
- `rule_names`: An array of the rule names to disable. If you need to find out the names of
your rules, use DescribeInsightRules.
"""
function disable_insight_rules(RuleNames; aws_config::AbstractAWSConfig=global_aws_config())
return cloudwatch(
"DisableInsightRules",
Dict{String,Any}("RuleNames" => RuleNames);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function disable_insight_rules(
RuleNames,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return cloudwatch(
"DisableInsightRules",
Dict{String,Any}(
mergewith(_merge, Dict{String,Any}("RuleNames" => RuleNames), params)
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
enable_alarm_actions(alarm_names)
enable_alarm_actions(alarm_names, params::Dict{String,<:Any})
Enables the actions for the specified alarms.
# Arguments
- `alarm_names`: The names of the alarms.
"""
function enable_alarm_actions(AlarmNames; aws_config::AbstractAWSConfig=global_aws_config())
return cloudwatch(
"EnableAlarmActions",
Dict{String,Any}("AlarmNames" => AlarmNames);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function enable_alarm_actions(
AlarmNames,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return cloudwatch(
"EnableAlarmActions",
Dict{String,Any}(
mergewith(_merge, Dict{String,Any}("AlarmNames" => AlarmNames), params)
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
enable_insight_rules(rule_names)
enable_insight_rules(rule_names, params::Dict{String,<:Any})
Enables the specified Contributor Insights rules. When rules are enabled, they immediately
begin analyzing log data.
# Arguments
- `rule_names`: An array of the rule names to enable. If you need to find out the names of
your rules, use DescribeInsightRules.
"""
function enable_insight_rules(RuleNames; aws_config::AbstractAWSConfig=global_aws_config())
return cloudwatch(
"EnableInsightRules",
Dict{String,Any}("RuleNames" => RuleNames);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function enable_insight_rules(
RuleNames,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return cloudwatch(
"EnableInsightRules",
Dict{String,Any}(
mergewith(_merge, Dict{String,Any}("RuleNames" => RuleNames), params)
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
get_dashboard(dashboard_name)
get_dashboard(dashboard_name, params::Dict{String,<:Any})
Displays the details of the dashboard that you specify. To copy an existing dashboard, use
GetDashboard, and then use the data returned within DashboardBody as the template for the
new dashboard when you call PutDashboard to create the copy.
# Arguments
- `dashboard_name`: The name of the dashboard to be described.
"""
function get_dashboard(DashboardName; aws_config::AbstractAWSConfig=global_aws_config())
return cloudwatch(
"GetDashboard",
Dict{String,Any}("DashboardName" => DashboardName);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function get_dashboard(
DashboardName,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return cloudwatch(
"GetDashboard",
Dict{String,Any}(
mergewith(_merge, Dict{String,Any}("DashboardName" => DashboardName), params)
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
get_insight_rule_report(end_time, period, rule_name, start_time)
get_insight_rule_report(end_time, period, rule_name, start_time, params::Dict{String,<:Any})
This operation returns the time series data collected by a Contributor Insights rule. The
data includes the identity and number of contributors to the log group. You can also
optionally return one or more statistics about each data point in the time series. These
statistics can include the following: UniqueContributors -- the number of unique
contributors for each data point. MaxContributorValue -- the value of the top
contributor for each data point. The identity of the contributor might change for each data
point in the graph. If this rule aggregates by COUNT, the top contributor for each data
point is the contributor with the most occurrences in that period. If the rule aggregates
by SUM, the top contributor is the contributor with the highest sum in the log field
specified by the rule's Value, during that period. SampleCount -- the number of data
points matched by the rule. Sum -- the sum of the values from all contributors during
the time period represented by that data point. Minimum -- the minimum value from a
single observation during the time period represented by that data point. Maximum -- the
maximum value from a single observation during the time period represented by that data
point. Average -- the average value from all contributors during the time period
represented by that data point.
# Arguments
- `end_time`: The end time of the data to use in the report. When used in a raw HTTP Query
API, it is formatted as yyyy-MM-dd'T'HH:mm:ss. For example, 2019-07-01T23:59:59.
- `period`: The period, in seconds, to use for the statistics in the
InsightRuleMetricDatapoint results.
- `rule_name`: The name of the rule that you want to see data from.
- `start_time`: The start time of the data to use in the report. When used in a raw HTTP
Query API, it is formatted as yyyy-MM-dd'T'HH:mm:ss. For example, 2019-07-01T23:59:59.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"MaxContributorCount"`: The maximum number of contributors to include in the report. The
range is 1 to 100. If you omit this, the default of 10 is used.
- `"Metrics"`: Specifies which metrics to use for aggregation of contributor values for the
report. You can specify one or more of the following metrics: UniqueContributors -- the
number of unique contributors for each data point. MaxContributorValue -- the value of
the top contributor for each data point. The identity of the contributor might change for
each data point in the graph. If this rule aggregates by COUNT, the top contributor for
each data point is the contributor with the most occurrences in that period. If the rule
aggregates by SUM, the top contributor is the contributor with the highest sum in the log
field specified by the rule's Value, during that period. SampleCount -- the number of
data points matched by the rule. Sum -- the sum of the values from all contributors
during the time period represented by that data point. Minimum -- the minimum value from
a single observation during the time period represented by that data point. Maximum --
the maximum value from a single observation during the time period represented by that data
point. Average -- the average value from all contributors during the time period
represented by that data point.
- `"OrderBy"`: Determines what statistic to use to rank the contributors. Valid values are
SUM and MAXIMUM.
"""
function get_insight_rule_report(
EndTime, Period, RuleName, StartTime; aws_config::AbstractAWSConfig=global_aws_config()
)
return cloudwatch(
"GetInsightRuleReport",
Dict{String,Any}(
"EndTime" => EndTime,
"Period" => Period,
"RuleName" => RuleName,
"StartTime" => StartTime,
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function get_insight_rule_report(
EndTime,
Period,
RuleName,
StartTime,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return cloudwatch(
"GetInsightRuleReport",
Dict{String,Any}(
mergewith(
_merge,
Dict{String,Any}(
"EndTime" => EndTime,
"Period" => Period,
"RuleName" => RuleName,
"StartTime" => StartTime,
),
params,
),
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
get_metric_data(end_time, metric_data_queries, start_time)
get_metric_data(end_time, metric_data_queries, start_time, params::Dict{String,<:Any})
You can use the GetMetricData API to retrieve CloudWatch metric values. The operation can
also include a CloudWatch Metrics Insights query, and one or more metric math functions. A
GetMetricData operation that does not include a query can retrieve as many as 500 different
metrics in a single request, with a total of as many as 100,800 data points. You can also
optionally perform metric math expressions on the values of the returned statistics, to
create new time series that represent new insights into your data. For example, using
Lambda metrics, you could divide the Errors metric by the Invocations metric to get an
error rate time series. For more information about metric math expressions, see Metric Math
Syntax and Functions in the Amazon CloudWatch User Guide. If you include a Metrics Insights
query, each GetMetricData operation can include only one query. But the same GetMetricData
operation can also retrieve other metrics. Metrics Insights queries can query only the most
recent three hours of metric data. For more information about Metrics Insights, see Query
your metrics with CloudWatch Metrics Insights. Calls to the GetMetricData API have a
different pricing structure than calls to GetMetricStatistics. For more information about
pricing, see Amazon CloudWatch Pricing. Amazon CloudWatch retains metric data as follows:
Data points with a period of less than 60 seconds are available for 3 hours. These data
points are high-resolution metrics and are available only for custom metrics that have been
defined with a StorageResolution of 1. Data points with a period of 60 seconds (1-minute)
are available for 15 days. Data points with a period of 300 seconds (5-minute) are
available for 63 days. Data points with a period of 3600 seconds (1 hour) are available
for 455 days (15 months). Data points that are initially published with a shorter period
are aggregated together for long-term storage. For example, if you collect data using a
period of 1 minute, the data remains available for 15 days with 1-minute resolution. After
15 days, this data is still available, but is aggregated and retrievable only with a
resolution of 5 minutes. After 63 days, the data is further aggregated and is available
with a resolution of 1 hour. If you omit Unit in your request, all data that was collected
with any unit is returned, along with the corresponding units that were specified when the
data was reported to CloudWatch. If you specify a unit, the operation returns only data
that was collected with that unit specified. If you specify a unit that does not match the
data collected, the results of the operation are null. CloudWatch does not perform unit
conversions. Using Metrics Insights queries with metric math You can't mix a Metric
Insights query and metric math syntax in the same expression, but you can reference results
from a Metrics Insights query within other Metric math expressions. A Metrics Insights
query without a GROUP BY clause returns a single time-series (TS), and can be used as input
for a metric math expression that expects a single time series. A Metrics Insights query
with a GROUP BY clause returns an array of time-series (TS[]), and can be used as input for
a metric math expression that expects an array of time series.
# Arguments
- `end_time`: The time stamp indicating the latest data to be returned. The value specified
is exclusive; results include data points up to the specified time stamp. For better
performance, specify StartTime and EndTime values that align with the value of the metric's
Period and sync up with the beginning and end of an hour. For example, if the Period of a
metric is 5 minutes, specifying 12:05 or 12:30 as EndTime can get a faster response from
CloudWatch than setting 12:07 or 12:29 as the EndTime.
- `metric_data_queries`: The metric queries to be returned. A single GetMetricData call can
include as many as 500 MetricDataQuery structures. Each of these structures can specify
either a metric to retrieve, a Metrics Insights query, or a math expression to perform on
retrieved data.
- `start_time`: The time stamp indicating the earliest data to be returned. The value
specified is inclusive; results include data points with the specified time stamp.
CloudWatch rounds the specified time stamp as follows: Start time less than 15 days ago -
Round down to the nearest whole minute. For example, 12:32:34 is rounded down to 12:32:00.
Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval.
For example, 12:32:34 is rounded down to 12:30:00. Start time greater than 63 days ago -
Round down to the nearest 1-hour clock interval. For example, 12:32:34 is rounded down to
12:00:00. If you set Period to 5, 10, or 30, the start time of your request is rounded
down to the nearest time that corresponds to even 5-, 10-, or 30-second divisions of a
minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for the previous 10-second
period, the start time of your request is rounded down and you receive data from 01:05:10
to 01:05:20. If you make a query at 15:07:17 for the previous 5 minutes of data, using a
period of 5 seconds, you receive data timestamped between 15:02:15 and 15:07:15. For
better performance, specify StartTime and EndTime values that align with the value of the
metric's Period and sync up with the beginning and end of an hour. For example, if the
Period of a metric is 5 minutes, specifying 12:05 or 12:30 as StartTime can get a faster
response from CloudWatch than setting 12:07 or 12:29 as the StartTime.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"LabelOptions"`: This structure includes the Timezone parameter, which you can use to
specify your time zone so that the labels of returned data display the correct time for
your time zone.
- `"MaxDatapoints"`: The maximum number of data points the request should return before
paginating. If you omit this, the default of 100,800 is used.
- `"NextToken"`: Include this value, if it was returned by the previous GetMetricData
operation, to get the next set of data points.
- `"ScanBy"`: The order in which data points should be returned. TimestampDescending
returns the newest data first and paginates when the MaxDatapoints limit is reached.
TimestampAscending returns the oldest data first and paginates when the MaxDatapoints limit
is reached.
"""
function get_metric_data(
EndTime, MetricDataQueries, StartTime; aws_config::AbstractAWSConfig=global_aws_config()
)
return cloudwatch(
"GetMetricData",
Dict{String,Any}(
"EndTime" => EndTime,
"MetricDataQueries" => MetricDataQueries,
"StartTime" => StartTime,
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function get_metric_data(
EndTime,
MetricDataQueries,
StartTime,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return cloudwatch(
"GetMetricData",
Dict{String,Any}(
mergewith(
_merge,
Dict{String,Any}(
"EndTime" => EndTime,
"MetricDataQueries" => MetricDataQueries,
"StartTime" => StartTime,
),
params,
),
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
get_metric_statistics(end_time, metric_name, namespace, period, start_time)
get_metric_statistics(end_time, metric_name, namespace, period, start_time, params::Dict{String,<:Any})
Gets statistics for the specified metric. The maximum number of data points returned from a
single call is 1,440. If you request more than 1,440 data points, CloudWatch returns an
error. To reduce the number of data points, you can narrow the specified time range and
make multiple requests across adjacent time ranges, or you can increase the specified
period. Data points are not returned in chronological order. CloudWatch aggregates data
points based on the length of the period that you specify. For example, if you request
statistics with a one-hour period, CloudWatch aggregates all data points with time stamps
that fall within each one-hour period. Therefore, the number of values aggregated by
CloudWatch is larger than the number of data points returned. CloudWatch needs raw data
points to calculate percentile statistics. If you publish data using a statistic set
instead, you can only retrieve percentile statistics for this data if one of the following
conditions is true: The SampleCount value of the statistic set is 1. The Min and the
Max values of the statistic set are equal. Percentile statistics are not available for
metrics when any of the metric values are negative numbers. Amazon CloudWatch retains
metric data as follows: Data points with a period of less than 60 seconds are available
for 3 hours. These data points are high-resolution metrics and are available only for
custom metrics that have been defined with a StorageResolution of 1. Data points with a
period of 60 seconds (1-minute) are available for 15 days. Data points with a period of
300 seconds (5-minute) are available for 63 days. Data points with a period of 3600
seconds (1 hour) are available for 455 days (15 months). Data points that are initially
published with a shorter period are aggregated together for long-term storage. For example,
if you collect data using a period of 1 minute, the data remains available for 15 days with
1-minute resolution. After 15 days, this data is still available, but is aggregated and
retrievable only with a resolution of 5 minutes. After 63 days, the data is further
aggregated and is available with a resolution of 1 hour. CloudWatch started retaining
5-minute and 1-hour metric data as of July 9, 2016. For information about metrics and
dimensions supported by Amazon Web Services services, see the Amazon CloudWatch Metrics and
Dimensions Reference in the Amazon CloudWatch User Guide.
# Arguments
- `end_time`: The time stamp that determines the last data point to return. The value
specified is exclusive; results include data points up to the specified time stamp. In a
raw HTTP query, the time stamp must be in ISO 8601 UTC format (for example,
2016-10-10T23:00:00Z).
- `metric_name`: The name of the metric, with or without spaces.
- `namespace`: The namespace of the metric, with or without spaces.
- `period`: The granularity, in seconds, of the returned data points. For metrics with
regular resolution, a period can be as short as one minute (60 seconds) and must be a
multiple of 60. For high-resolution metrics that are collected at intervals of less than
one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution
metrics are those metrics stored by a PutMetricData call that includes a StorageResolution
of 1 second. If the StartTime parameter specifies a time stamp that is greater than 3 hours
ago, you must specify the period as follows or no data points in that time range is
returned: Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1
minute). Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5
minutes). Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).
- `start_time`: The time stamp that determines the first data point to return. Start times
are evaluated relative to the time that CloudWatch receives the request. The value
specified is inclusive; results include data points with the specified time stamp. In a raw
HTTP query, the time stamp must be in ISO 8601 UTC format (for example,
2016-10-03T23:00:00Z). CloudWatch rounds the specified time stamp as follows: Start time
less than 15 days ago - Round down to the nearest whole minute. For example, 12:32:34 is
rounded down to 12:32:00. Start time between 15 and 63 days ago - Round down to the
nearest 5-minute clock interval. For example, 12:32:34 is rounded down to 12:30:00. Start
time greater than 63 days ago - Round down to the nearest 1-hour clock interval. For
example, 12:32:34 is rounded down to 12:00:00. If you set Period to 5, 10, or 30, the
start time of your request is rounded down to the nearest time that corresponds to even 5-,
10-, or 30-second divisions of a minute. For example, if you make a query at (HH:mm:ss)
01:05:23 for the previous 10-second period, the start time of your request is rounded down
and you receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the
previous 5 minutes of data, using a period of 5 seconds, you receive data timestamped
between 15:02:15 and 15:07:15.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"Dimensions"`: The dimensions. If the metric contains multiple dimensions, you must
include a value for each dimension. CloudWatch treats each unique combination of dimensions
as a separate metric. If a specific combination of dimensions was not published, you can't
retrieve statistics for it. You must specify the same dimensions that were used when the
metrics were created. For an example, see Dimension Combinations in the Amazon CloudWatch
User Guide. For more information about specifying dimensions, see Publishing Metrics in the
Amazon CloudWatch User Guide.
- `"ExtendedStatistics"`: The percentile statistics. Specify values between p0.0 and p100.
When calling GetMetricStatistics, you must specify either Statistics or ExtendedStatistics,
but not both. Percentile statistics are not available for metrics when any of the metric
values are negative numbers.
- `"Statistics"`: The metric statistics, other than percentile. For percentile statistics,
use ExtendedStatistics. When calling GetMetricStatistics, you must specify either
Statistics or ExtendedStatistics, but not both.
- `"Unit"`: The unit for a given metric. If you omit Unit, all data that was collected with
any unit is returned, along with the corresponding units that were specified when the data
was reported to CloudWatch. If you specify a unit, the operation returns only data that was
collected with that unit specified. If you specify a unit that does not match the data
collected, the results of the operation are null. CloudWatch does not perform unit
conversions.
"""
function get_metric_statistics(
EndTime,
MetricName,
Namespace,
Period,
StartTime;
aws_config::AbstractAWSConfig=global_aws_config(),
)
return cloudwatch(
"GetMetricStatistics",
Dict{String,Any}(
"EndTime" => EndTime,
"MetricName" => MetricName,
"Namespace" => Namespace,
"Period" => Period,
"StartTime" => StartTime,
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function get_metric_statistics(
EndTime,
MetricName,
Namespace,
Period,
StartTime,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return cloudwatch(
"GetMetricStatistics",
Dict{String,Any}(
mergewith(
_merge,
Dict{String,Any}(
"EndTime" => EndTime,
"MetricName" => MetricName,
"Namespace" => Namespace,
"Period" => Period,
"StartTime" => StartTime,
),
params,
),
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
get_metric_stream(name)
get_metric_stream(name, params::Dict{String,<:Any})
Returns information about the metric stream that you specify.
# Arguments
- `name`: The name of the metric stream to retrieve information about.
"""
function get_metric_stream(Name; aws_config::AbstractAWSConfig=global_aws_config())
return cloudwatch(
"GetMetricStream",
Dict{String,Any}("Name" => Name);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function get_metric_stream(
Name, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
return cloudwatch(
"GetMetricStream",
Dict{String,Any}(mergewith(_merge, Dict{String,Any}("Name" => Name), params));
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
get_metric_widget_image(metric_widget)
get_metric_widget_image(metric_widget, params::Dict{String,<:Any})
You can use the GetMetricWidgetImage API to retrieve a snapshot graph of one or more Amazon
CloudWatch metrics as a bitmap image. You can then embed this image into your services and
products, such as wiki pages, reports, and documents. You could also retrieve images
regularly, such as every minute, and create your own custom live dashboard. The graph you