Skip to content

update_performance_monitor async

update_performance_monitor(
    monitor_name: ResourceName,
    *,
    config_overrides: Optional[AsyncNetworkFlowMonitorClientConfig] = None,
    targets_to_add: Optional[PerformanceMonitorTargets] = None,
    targets_to_remove: Optional[PerformanceMonitorTargets] = None,
    client_token: Optional[UuidString] = None,
) -> UpdatePerformanceMonitorOutput

Update a performance monitor, to add or remove the resources that the monitor tracks network performance for.

Parameters:

  • monitor_name (ResourceName) –

    The name of the performance monitor.

  • targets_to_add (Optional[PerformanceMonitorTargets], default: None ) –

    The resources to add to the performance monitor.

  • targets_to_remove (Optional[PerformanceMonitorTargets], default: None ) –

    The resources to remove from the performance monitor.

  • client_token (Optional[UuidString], default: None ) –

    A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. If the token matches a previous request, the service ignores the request without returning an error. Don't reuse the same client token for other API requests.

Raises:

Source code in docs_src/capo_networkflowmonitor/_services/async_network_flow_monitor.py
async def update_performance_monitor(
    self,
    monitor_name: "capo_networkflowmonitor.types.resource_name.ResourceName",
    *,
    config_overrides: Optional[AsyncNetworkFlowMonitorClientConfig] = None,
    targets_to_add: Optional[
        "capo_networkflowmonitor.types.performance_monitor_targets.PerformanceMonitorTargets"
    ] = None,
    targets_to_remove: Optional[
        "capo_networkflowmonitor.types.performance_monitor_targets.PerformanceMonitorTargets"
    ] = None,
    client_token: Optional[
        "capo_networkflowmonitor.types.uuid_string.UuidString"
    ] = None,
) -> "capo_networkflowmonitor.types.update_performance_monitor_output.UpdatePerformanceMonitorOutput":
    """<p>Update a performance monitor, to add or remove the resources that the monitor tracks network performance for.</p>

    Args:
        monitor_name: <p>The name of the performance monitor.</p>
        targets_to_add: <p>The resources to add to the performance monitor.</p>
        targets_to_remove: <p>The resources to remove from the performance monitor.</p>
        client_token: <p>A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. If the token matches a previous request, the service ignores the request without returning an error. Don't reuse the same client token for other API requests.</p>

    Raises:
        capo_networkflowmonitor.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permission to perform this action.</p>
        capo_networkflowmonitor.errors.conflict_exception.ConflictException: <p>The requested resource is in use.</p>
        capo_networkflowmonitor.errors.internal_server_exception.InternalServerException: <p>An internal error occurred.</p>
        capo_networkflowmonitor.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request specifies a resource that doesn't exist.</p>
        capo_networkflowmonitor.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request exceeded a service quota.</p>
        capo_networkflowmonitor.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_networkflowmonitor.errors.validation_exception.ValidationException: <p>Invalid request.</p>
        capo_networkflowmonitor.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_networkflowmonitor.types.update_performance_monitor_input.UpdatePerformanceMonitorInput]",
    ) -> AsyncOperationResponse[
        "capo_networkflowmonitor.types.update_performance_monitor_output.UpdatePerformanceMonitorOutput"
    ]:
        import capo_networkflowmonitor._operations.network_flow_monitor.update_performance_monitor

        (
            output,
            http_response,
        ) = await capo_networkflowmonitor._operations.network_flow_monitor.update_performance_monitor.async_update_performance_monitor(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdatePerformanceMonitor")
    )
    input_: capo_networkflowmonitor.types.update_performance_monitor_input.UpdatePerformanceMonitorInput = {
        "monitor_name": monitor_name
    }
    if targets_to_add is not None:
        input_["targets_to_add"] = targets_to_add
    if targets_to_remove is not None:
        input_["targets_to_remove"] = targets_to_remove
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output