Updates an existing cost anomaly monitor. The changes made are applied going forward, and doesn't change anomalies detected in the past.
Parameters:
-
monitor_arn
(GenericString)
–
Cost anomaly monitor Amazon Resource Names (ARNs).
-
monitor_name
(Optional[GenericString], default:
None
)
–
The new name for the cost anomaly monitor.
Raises:
Source code in docs_src/capo_cost_explorer/_services/cost_explorer.py
| def update_anomaly_monitor(
self,
monitor_arn: "capo_cost_explorer.types.generic_string.GenericString",
*,
config_overrides: Optional[CostExplorerClientConfig] = None,
monitor_name: Optional[
"capo_cost_explorer.types.generic_string.GenericString"
] = None,
) -> "capo_cost_explorer.types.update_anomaly_monitor_response.UpdateAnomalyMonitorResponse":
"""<p>Updates an existing cost anomaly monitor. The changes made are applied going forward, and doesn't change anomalies detected in the past. </p>
Args:
monitor_arn: <p>Cost anomaly monitor Amazon Resource Names (ARNs). </p>
monitor_name: <p>The new name for the cost anomaly monitor. </p>
Raises:
capo_cost_explorer.errors.limit_exceeded_exception.LimitExceededException: <p>You made too many calls in a short period of time. Try again later.</p>
capo_cost_explorer.errors.unknown_monitor_exception.UnknownMonitorException: <p>The cost anomaly monitor does not exist for the account. </p>
capo_cost_explorer.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_cost_explorer.types.update_anomaly_monitor_request.UpdateAnomalyMonitorRequest]",
) -> OperationResponse[
"capo_cost_explorer.types.update_anomaly_monitor_response.UpdateAnomalyMonitorResponse"
]:
import capo_cost_explorer._operations.aws_insights_index_service.update_anomaly_monitor
output, http_response = (
capo_cost_explorer._operations.aws_insights_index_service.update_anomaly_monitor.update_anomaly_monitor(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateAnomalyMonitor")
)
input_: capo_cost_explorer.types.update_anomaly_monitor_request.UpdateAnomalyMonitorRequest = {
"monitor_arn": monitor_arn
}
if monitor_name is not None:
input_["monitor_name"] = monitor_name
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|