Updates the aggregationPeriod for a monitor. Monitors support an aggregationPeriod of either 30 or 60 seconds. This action requires the monitorName and probeId parameter. Run ListMonitors to get a list of monitor names.
Parameters:
-
monitor_name
(ResourceName)
–
The name of the monitor to update.
-
aggregation_period
(AggregationPeriod)
–
The aggregation time, in seconds, to change to. This must be either 30 or 60.
Raises:
Source code in docs_src/capo_networkmonitor/_services/network_monitor.py
| def update_monitor(
self,
monitor_name: "capo_networkmonitor.types.resource_name.ResourceName",
aggregation_period: "capo_networkmonitor.types.aggregation_period.AggregationPeriod",
*,
config_overrides: Optional[NetworkMonitorClientConfig] = None,
) -> "capo_networkmonitor.types.update_monitor_output.UpdateMonitorOutput":
"""<p>Updates the <code>aggregationPeriod</code> for a monitor. Monitors support an <code>aggregationPeriod</code> of either <code>30</code> or <code>60</code> seconds. This action requires the <code>monitorName</code> and <code>probeId</code> parameter. Run <code>ListMonitors</code> to get a list of monitor names. </p>
Args:
monitor_name: <p>The name of the monitor to update. </p>
aggregation_period: <p>The aggregation time, in seconds, to change to. This must be either <code>30</code> or <code>60</code>. </p>
Raises:
capo_networkmonitor.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
capo_networkmonitor.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
capo_networkmonitor.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
capo_networkmonitor.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>This request exceeds a service quota.</p>
capo_networkmonitor.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling</p>
capo_networkmonitor.errors.validation_exception.ValidationException: <p>One of the parameters for the request is not valid.</p>
capo_networkmonitor.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_networkmonitor.types.update_monitor_input.UpdateMonitorInput]",
) -> OperationResponse[
"capo_networkmonitor.types.update_monitor_output.UpdateMonitorOutput"
]:
import capo_networkmonitor._operations.network_monitor.update_monitor
output, http_response = (
capo_networkmonitor._operations.network_monitor.update_monitor.update_monitor(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateMonitor")
)
input_: capo_networkmonitor.types.update_monitor_input.UpdateMonitorInput = {
"monitor_name": monitor_name,
"aggregation_period": aggregation_period,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|