Skip to content

update_monitor

update_monitor(
    monitor_name: ResourceName,
    *,
    config_overrides: Optional[NetworkFlowMonitorClientConfig] = None,
    local_resources_to_add: Optional[MonitorLocalResources] = None,
    local_resources_to_remove: Optional[MonitorLocalResources] = None,
    remote_resources_to_add: Optional[MonitorRemoteResources] = None,
    remote_resources_to_remove: Optional[MonitorRemoteResources] = None,
    client_token: Optional[UuidString] = None,
) -> UpdateMonitorOutput

Update a monitor to add or remove local or remote resources.

Parameters:

  • monitor_name (ResourceName) –

    The name of the monitor.

  • local_resources_to_add (Optional[MonitorLocalResources], default: None ) –

    Additional local resources to specify network flows for a monitor, as an array of resources with identifiers and types. A local resource in a workload is the location of hosts where the Network Flow Monitor agent is installed.

  • local_resources_to_remove (Optional[MonitorLocalResources], default: None ) –

    The local resources to remove, as an array of resources with identifiers and types.

  • remote_resources_to_add (Optional[MonitorRemoteResources], default: None ) –

    The remote resources to add, as an array of resources with identifiers and types.

    A remote resource is the other endpoint in the flow of a workload, with a local resource. For example, Amazon Dynamo DB can be a remote resource.

  • remote_resources_to_remove (Optional[MonitorRemoteResources], default: None ) –

    The remote resources to remove, as an array of resources with identifiers and types.

    A remote resource is the other endpoint specified for the network flow of a workload, with a local resource. For example, Amazon Dynamo DB can be a remote resource.

  • 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. Don't reuse the same client token for other API requests.

Raises:

Source code in docs_src/capo_networkflowmonitor/_services/network_flow_monitor.py
def update_monitor(
    self,
    monitor_name: "capo_networkflowmonitor.types.resource_name.ResourceName",
    *,
    config_overrides: Optional[NetworkFlowMonitorClientConfig] = None,
    local_resources_to_add: Optional[
        "capo_networkflowmonitor.types.monitor_local_resources.MonitorLocalResources"
    ] = None,
    local_resources_to_remove: Optional[
        "capo_networkflowmonitor.types.monitor_local_resources.MonitorLocalResources"
    ] = None,
    remote_resources_to_add: Optional[
        "capo_networkflowmonitor.types.monitor_remote_resources.MonitorRemoteResources"
    ] = None,
    remote_resources_to_remove: Optional[
        "capo_networkflowmonitor.types.monitor_remote_resources.MonitorRemoteResources"
    ] = None,
    client_token: Optional[
        "capo_networkflowmonitor.types.uuid_string.UuidString"
    ] = None,
) -> "capo_networkflowmonitor.types.update_monitor_output.UpdateMonitorOutput":
    """<p>Update a monitor to add or remove local or remote resources.</p>

    Args:
        monitor_name: <p>The name of the monitor.</p>
        local_resources_to_add: <p>Additional local resources to specify network flows for a monitor, as an array of resources with identifiers and types. A local resource in a workload is the location of hosts where the Network Flow Monitor agent is installed. </p>
        local_resources_to_remove: <p>The local resources to remove, as an array of resources with identifiers and types.</p>
        remote_resources_to_add: <p>The remote resources to add, as an array of resources with identifiers and types.</p> <p>A remote resource is the other endpoint in the flow of a workload, with a local resource. For example, Amazon Dynamo DB can be a remote resource. </p>
        remote_resources_to_remove: <p>The remote resources to remove, as an array of resources with identifiers and types.</p> <p>A remote resource is the other endpoint specified for the network flow of a workload, with a local resource. For example, Amazon Dynamo DB can be a remote resource. </p>
        client_token: <p>A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. 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.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.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.
    """

    def _handler(
        req: "OperationRequest[capo_networkflowmonitor.types.update_monitor_input.UpdateMonitorInput]",
    ) -> OperationResponse[
        "capo_networkflowmonitor.types.update_monitor_output.UpdateMonitorOutput"
    ]:
        import capo_networkflowmonitor._operations.network_flow_monitor.update_monitor

        output, http_response = (
            capo_networkflowmonitor._operations.network_flow_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_networkflowmonitor.types.update_monitor_input.UpdateMonitorInput = {
        "monitor_name": monitor_name
    }
    if local_resources_to_add is not None:
        input_["local_resources_to_add"] = local_resources_to_add
    if local_resources_to_remove is not None:
        input_["local_resources_to_remove"] = local_resources_to_remove
    if remote_resources_to_add is not None:
        input_["remote_resources_to_add"] = remote_resources_to_add
    if remote_resources_to_remove is not None:
        input_["remote_resources_to_remove"] = remote_resources_to_remove
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output