Skip to content

delete_members

delete_members(
    graph_arn: GraphArn,
    account_ids: AccountIdList,
    *,
    config_overrides: Optional[DetectiveClientConfig] = None,
) -> DeleteMembersResponse

Removes the specified member accounts from the behavior graph. The removed accounts no longer contribute data to the behavior graph. This operation can only be called by the administrator account for the behavior graph.

For invited accounts, the removed accounts are deleted from the list of accounts in the behavior graph. To restore the account, the administrator account must send another invitation.

For organization accounts in the organization behavior graph, the Detective administrator account can always enable the organization account again. Organization accounts that are not enabled as member accounts are not included in the ListMembers results for the organization behavior graph.

An administrator account cannot use DeleteMembers to remove their own account from the behavior graph. To disable a behavior graph, the administrator account uses the DeleteGraph API method.

Parameters:

  • graph_arn (GraphArn) –

    The ARN of the behavior graph to remove members from.

  • account_ids (AccountIdList) –

    The list of Amazon Web Services account identifiers for the member accounts to remove from the behavior graph. You can remove up to 50 member accounts at a time.

Raises:

Source code in docs_src/capo_detective/_services/detective.py
def delete_members(
    self,
    graph_arn: "capo_detective.types.graph_arn.GraphArn",
    account_ids: "capo_detective.types.account_id_list.AccountIdList",
    *,
    config_overrides: Optional[DetectiveClientConfig] = None,
) -> "capo_detective.types.delete_members_response.DeleteMembersResponse":
    """<p>Removes the specified member accounts from the behavior graph. The removed accounts no longer contribute data to the behavior graph. This operation can only be called by the administrator account for the behavior graph.</p> <p>For invited accounts, the removed accounts are deleted from the list of accounts in the behavior graph. To restore the account, the administrator account must send another invitation.</p> <p>For organization accounts in the organization behavior graph, the Detective administrator account can always enable the organization account again. Organization accounts that are not enabled as member accounts are not included in the <code>ListMembers</code> results for the organization behavior graph.</p> <p>An administrator account cannot use <code>DeleteMembers</code> to remove their own account from the behavior graph. To disable a behavior graph, the administrator account uses the <code>DeleteGraph</code> API method.</p>

    Args:
        graph_arn: <p>The ARN of the behavior graph to remove members from.</p>
        account_ids: <p>The list of Amazon Web Services account identifiers for the member accounts to remove from the behavior graph. You can remove up to 50 member accounts at a time.</p>

    Raises:
        capo_detective.errors.access_denied_exception.AccessDeniedException: <p>The request issuer does not have permission to access this resource or perform this operation.</p>
        capo_detective.errors.conflict_exception.ConflictException: <p>The request attempted an invalid action.</p>
        capo_detective.errors.internal_server_exception.InternalServerException: <p>The request was valid but failed because of a problem with the service.</p>
        capo_detective.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request refers to a nonexistent resource.</p>
        capo_detective.errors.validation_exception.ValidationException: <p>The request parameters are invalid.</p>
        capo_detective.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_detective.types.delete_members_request.DeleteMembersRequest]",
    ) -> OperationResponse[
        "capo_detective.types.delete_members_response.DeleteMembersResponse"
    ]:
        import capo_detective._operations.amazon_detective.delete_members

        output, http_response = (
            capo_detective._operations.amazon_detective.delete_members.delete_members(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteMembers")
    )
    input_: capo_detective.types.delete_members_request.DeleteMembersRequest = {
        "graph_arn": graph_arn,
        "account_ids": account_ids,
    }

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