put_anomaly_detector
¶
put_anomaly_detector(
*,
config_overrides: Optional[CloudWatchClientConfig] = None,
namespace: Optional[Namespace] = None,
metric_name: Optional[MetricName] = None,
dimensions: Optional[Dimensions] = None,
stat: Optional[AnomalyDetectorMetricStat] = None,
configuration: Optional[AnomalyDetectorConfiguration] = None,
metric_characteristics: Optional[MetricCharacteristics] = None,
single_metric_anomaly_detector: Optional[SingleMetricAnomalyDetector] = None,
metric_math_anomaly_detector: Optional[MetricMathAnomalyDetector] = None,
) -> PutAnomalyDetectorOutput
Creates an anomaly detection model for a CloudWatch metric. You can use the model to display a band of expected normal values when the metric is graphed.
If you have enabled unified cross-account observability, and this account is a monitoring account, the metric can be in the same account or a source account. You can specify the account ID in the object you specify in the SingleMetricAnomalyDetector parameter.
For more information, see CloudWatch Anomaly Detection.
Parameters:
-
namespace(Optional[Namespace], default:None) –The namespace of the metric to create the anomaly detection model for.
-
metric_name(Optional[MetricName], default:None) –The name of the metric to create the anomaly detection model for.
-
dimensions(Optional[Dimensions], default:None) –The metric dimensions to create the anomaly detection model for.
-
stat(Optional[AnomalyDetectorMetricStat], default:None) –The statistic to use for the metric and the anomaly detection model.
-
configuration(Optional[AnomalyDetectorConfiguration], default:None) –The configuration specifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model. You can specify as many as 10 time ranges.
The configuration can also include the time zone to use for the metric.
-
metric_characteristics(Optional[MetricCharacteristics], default:None) –Use this object to include parameters to provide information about your metric to CloudWatch to help it build more accurate anomaly detection models. Currently, it includes the
PeriodicSpikesparameter. -
single_metric_anomaly_detector(Optional[SingleMetricAnomalyDetector], default:None) –A single metric anomaly detector to be created.
When using
SingleMetricAnomalyDetector, you cannot include the following parameters in the same operation:-
Dimensions -
MetricName -
Namespace -
Stat -
the
MetricMathAnomalyDetectorparameters ofPutAnomalyDetectorInput
Instead, specify the single metric anomaly detector attributes as part of the property
SingleMetricAnomalyDetector. -
-
metric_math_anomaly_detector(Optional[MetricMathAnomalyDetector], default:None) –The metric math anomaly detector to be created.
When using
MetricMathAnomalyDetector, you cannot include the following parameters in the same operation:-
Dimensions -
MetricName -
Namespace -
Stat -
the
SingleMetricAnomalyDetectorparameters ofPutAnomalyDetectorInput
Instead, specify the metric math anomaly detector attributes as part of the property
MetricMathAnomalyDetector. -
Raises:
-
InternalServiceFault–Request processing has failed due to some unknown error, exception, or failure.
-
InvalidParameterCombinationException–Parameters were used together that cannot be used together.
-
InvalidParameterValueException–The value of an input parameter is bad or out-of-range.
-
LimitExceededException–The operation exceeded one or more limits.
-
MissingRequiredParameterException–An input parameter that is required is missing.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cloudwatch/_services/cloud_watch.py
2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 | |