Skip to content

stop_monitoring_members

stop_monitoring_members(
    detector_id: DetectorId,
    *,
    config_overrides: Optional[GuardDutyClientConfig] = None,
    account_ids: Optional[AccountIds] = None,
) -> StopMonitoringMembersResponse

Stops GuardDuty monitoring for the specified member accounts. Use the StartMonitoringMembers operation to restart monitoring for those accounts.

With autoEnableOrganizationMembers configuration for your organization set to ALL, you'll receive an error if you attempt to stop monitoring the member accounts in your organization.

Parameters:

  • detector_id (DetectorId) –

    The unique ID of the detector associated with the GuardDuty administrator account that is monitoring member accounts.

    To find the detectorId in the current Region, see the Settings page in the GuardDuty console, or run the ListDetectors API.

  • account_ids (Optional[AccountIds], default: None ) –

    A list of account IDs for the member accounts to stop monitoring.

Raises:

Source code in docs_src/capo_guardduty/_services/guard_duty.py
def stop_monitoring_members(
    self,
    detector_id: "capo_guardduty.types.detector_id.DetectorId",
    *,
    config_overrides: Optional[GuardDutyClientConfig] = None,
    account_ids: Optional["capo_guardduty.types.account_ids.AccountIds"] = None,
) -> "capo_guardduty.types.stop_monitoring_members_response.StopMonitoringMembersResponse":
    """<p>Stops GuardDuty monitoring for the specified member accounts. Use the <code>StartMonitoringMembers</code> operation to restart monitoring for those accounts.</p> <p>With <code>autoEnableOrganizationMembers</code> configuration for your organization set to <code>ALL</code>, you'll receive an error if you attempt to stop monitoring the member accounts in your organization.</p>

    Args:
        detector_id: <p>The unique ID of the detector associated with the GuardDuty administrator account that is monitoring member accounts.</p> <p>To find the <code>detectorId</code> in the current Region, see the Settings page in the GuardDuty console, or run the <a href="https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html">ListDetectors</a> API.</p>
        account_ids: <p>A list of account IDs for the member accounts to stop monitoring.</p>

    Raises:
        capo_guardduty.errors.bad_request_exception.BadRequestException: <p>A bad request exception object.</p>
        capo_guardduty.errors.internal_server_error_exception.InternalServerErrorException: <p>An internal server error exception object.</p>
        capo_guardduty.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_guardduty.types.stop_monitoring_members_request.StopMonitoringMembersRequest]",
    ) -> OperationResponse[
        "capo_guardduty.types.stop_monitoring_members_response.StopMonitoringMembersResponse"
    ]:
        import capo_guardduty._operations.guard_duty_api_service.stop_monitoring_members

        output, http_response = (
            capo_guardduty._operations.guard_duty_api_service.stop_monitoring_members.stop_monitoring_members(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StopMonitoringMembers")
    )
    input_: capo_guardduty.types.stop_monitoring_members_request.StopMonitoringMembersRequest = {
        "detector_id": detector_id
    }
    if account_ids is not None:
        input_["account_ids"] = account_ids

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