put_anomaly_detector
async
¶
put_anomaly_detector(
*,
config_overrides: Optional[AsyncCloudWatchClientConfig] = 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/async_cloud_watch.py
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 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 | |