Skip to content

update_scope async

update_scope(
    scope_id: ScopeId,
    *,
    config_overrides: Optional[AsyncNetworkFlowMonitorClientConfig] = None,
    resources_to_add: Optional[TargetResourceList] = None,
    resources_to_delete: Optional[TargetResourceList] = None,
) -> UpdateScopeOutput

Update a scope to add or remove resources that you want to be available for Network Flow Monitor to generate metrics for, when you have active agents on those resources sending metrics reports to the Network Flow Monitor backend.

Parameters:

  • scope_id (ScopeId) –

    The identifier for the scope that includes the resources you want to get data results for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account.

  • resources_to_add (Optional[TargetResourceList], default: None ) –

    A list of resources to add to a scope.

  • resources_to_delete (Optional[TargetResourceList], default: None ) –

    A list of resources to delete from a scope.

Raises:

Source code in docs_src/capo_networkflowmonitor/_services/async_network_flow_monitor.py
async def update_scope(
    self,
    scope_id: "capo_networkflowmonitor.types.scope_id.ScopeId",
    *,
    config_overrides: Optional[AsyncNetworkFlowMonitorClientConfig] = None,
    resources_to_add: Optional[
        "capo_networkflowmonitor.types.target_resource_list.TargetResourceList"
    ] = None,
    resources_to_delete: Optional[
        "capo_networkflowmonitor.types.target_resource_list.TargetResourceList"
    ] = None,
) -> "capo_networkflowmonitor.types.update_scope_output.UpdateScopeOutput":
    """<p>Update a scope to add or remove resources that you want to be available for Network Flow Monitor to generate metrics for, when you have active agents on those resources sending metrics reports to the Network Flow Monitor backend.</p>

    Args:
        scope_id: <p>The identifier for the scope that includes the resources you want to get data results for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account.</p>
        resources_to_add: <p>A list of resources to add to a scope.</p>
        resources_to_delete: <p>A list of resources to delete from a scope.</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_scope_input.UpdateScopeInput]",
    ) -> AsyncOperationResponse[
        "capo_networkflowmonitor.types.update_scope_output.UpdateScopeOutput"
    ]:
        import capo_networkflowmonitor._operations.network_flow_monitor.update_scope

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateScope")
    )
    input_: capo_networkflowmonitor.types.update_scope_input.UpdateScopeInput = {
        "scope_id": scope_id
    }
    if resources_to_add is not None:
        input_["resources_to_add"] = resources_to_add
    if resources_to_delete is not None:
        input_["resources_to_delete"] = resources_to_delete

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