Skip to content

CloudWatchClient.put_anomaly_detector

rboto-cloudwatch==0.4.0 · Service index · Types

Model summary (excerpt): 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...

Install and imports

python -m pip install "rboto[cloudwatch]==0.4.0"
from rboto import CloudWatchClient
from collections.abc import Sequence
from rboto_cloudwatch.types import (
    AnomalyDetectorConfiguration,
    Dimension,
    MetricCharacteristics,
    MetricMathAnomalyDetector,
    PutAnomalyDetectorOutput,
    SingleMetricAnomalyDetector,
)

Signature

async def put_anomaly_detector(
    *,
    namespace: str | None = None,
    metric_name: str | None = None,
    dimensions: Sequence[Dimension] | None = None,
    stat: str | None = None,
    configuration: AnomalyDetectorConfiguration | None = None,
    metric_characteristics: MetricCharacteristics | None = None,
    single_metric_anomaly_detector: SingleMetricAnomalyDetector | None = None,
    metric_math_anomaly_detector: MetricMathAnomalyDetector | None = None,
) -> PutAnomalyDetectorOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
namespace No The namespace of the metric to create the anomaly detection model for.
metric_name No The name of the metric to create the anomaly detection model for.
dimensions No The metric dimensions to create the anomaly detection model for.
stat No The statistic to use for the metric and the anomaly detection model.
configuration No 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 No 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 PeriodicSpikes parameter.
single_metric_anomaly_detector No 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 MetricMathAnomalyDetector parameters of PutAnomalyDetectorInput Instead, specify the single metric anomaly detector attributes as part of the property SingleMetricAnomalyDetector .
metric_math_anomaly_detector No 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 SingleMetricAnomalyDetector parameters of PutAnomalyDetectorInput Instead, specify the metric math anomaly detector attributes as part of the property MetricMathAnomalyDetector .

Output

PutAnomalyDetectorOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
anomaly_detector_id str | None Always present —

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

AnomalyDetectorConfiguration, Dimension, MetricCharacteristics, MetricMathAnomalyDetector, PutAnomalyDetectorOutput, SingleMetricAnomalyDetector

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

Import from rboto_cloudwatch.exceptions:

InternalServiceFaultError, InvalidParameterCombinationError, InvalidParameterValueError, LimitExceededError, MissingRequiredParameterError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model