update_anomaly_subscription
¶
update_anomaly_subscription(
subscription_arn: GenericString,
*,
config_overrides: Optional[CostExplorerClientConfig] = None,
threshold: Optional[NullableNonNegativeDouble] = None,
frequency: Optional[AnomalySubscriptionFrequency] = None,
monitor_arn_list: Optional[MonitorArnList] = None,
subscribers: Optional[Subscribers] = None,
subscription_name: Optional[GenericString] = None,
threshold_expression: Optional[Expression] = None,
) -> UpdateAnomalySubscriptionResponse
Updates an existing cost anomaly subscription. Specify the fields that you want to update. Omitted fields are unchanged.
The JSON below describes the generic construct for each type. See Request Parameters for possible values as they apply to AnomalySubscription.
Parameters:
-
subscription_arn(GenericString) –A cost anomaly subscription Amazon Resource Name (ARN).
-
threshold(Optional[NullableNonNegativeDouble], default:None) –(deprecated)
The update to the threshold value for receiving notifications.
This field has been deprecated. To update a threshold, use ThresholdExpression. Continued use of Threshold will be treated as shorthand syntax for a ThresholdExpression.
You can specify either Threshold or ThresholdExpression, but not both.
-
frequency(Optional[AnomalySubscriptionFrequency], default:None) –The update to the frequency value that subscribers receive notifications.
-
monitor_arn_list(Optional[MonitorArnList], default:None) –A list of cost anomaly monitor ARNs.
-
subscribers(Optional[Subscribers], default:None) –The update to the subscriber list.
-
subscription_name(Optional[GenericString], default:None) –The new name of the subscription.
-
threshold_expression(Optional[Expression], default:None) –The update to the Expression object used to specify the anomalies that you want to generate alerts for. This supports dimensions and nested expressions. The supported dimensions are
ANOMALY_TOTAL_IMPACT_ABSOLUTEandANOMALY_TOTAL_IMPACT_PERCENTAGE, corresponding to an anomaly’s TotalImpact and TotalImpactPercentage, respectively (see Impact for more details). The supported nested expression types areANDandOR. The match optionGREATER_THAN_OR_EQUALis required. Values must be numbers between 0 and 10,000,000,000 in string format.You can specify either Threshold or ThresholdExpression, but not both.
The following are examples of valid ThresholdExpressions:
-
Absolute threshold:
{ "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } -
Percentage threshold:
{ "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } -
ANDtwo thresholds together:{ "And": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] } -
ORtwo thresholds together:{ "Or": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }
-
Raises:
-
LimitExceededException–You made too many calls in a short period of time. Try again later.
-
UnknownMonitorException–The cost anomaly monitor does not exist for the account.
-
UnknownSubscriptionException–The cost anomaly subscription does not exist for the account.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cost_explorer/_services/cost_explorer.py
3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 | |