Skip to content

get_custom_detection_rule_org_configuration

get_custom_detection_rule_org_configuration(
    rule_id: RuleId,
    *,
    config_overrides: Optional[GuardDutyClientConfig] = None,
    mode: Optional[AssociationMode] = None,
) -> GetCustomDetectionRuleOrgConfigurationResponse

Returns the organization-level configuration for a custom detection rule.

Parameters:

  • rule_id (RuleId) –

    The unique identifier for the custom detection rule.

  • mode (Optional[AssociationMode], default: None ) –

    The execution mode of the organization configuration to retrieve. Valid values: LIVE | DRY_RUN.

Raises:

Source code in docs_src/capo_guardduty/_services/guard_duty.py
def get_custom_detection_rule_org_configuration(
    self,
    rule_id: "capo_guardduty.types.rule_id.RuleId",
    *,
    config_overrides: Optional[GuardDutyClientConfig] = None,
    mode: Optional["capo_guardduty.types.association_mode.AssociationMode"] = None,
) -> "capo_guardduty.types.get_custom_detection_rule_org_configuration_response.GetCustomDetectionRuleOrgConfigurationResponse":
    """<p>Returns the organization-level configuration for a custom detection rule.</p>

    Args:
        rule_id: <p>The unique identifier for the custom detection rule.</p>
        mode: <p>The execution mode of the organization configuration to retrieve. Valid values: <code>LIVE</code> | <code>DRY_RUN</code>.</p>

    Raises:
        capo_guardduty.errors.access_denied_exception.AccessDeniedException: <p>An access denied exception object.</p>
        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.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource can't be found.</p>
        capo_guardduty.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_guardduty.types.get_custom_detection_rule_org_configuration_request.GetCustomDetectionRuleOrgConfigurationRequest]",
    ) -> OperationResponse[
        "capo_guardduty.types.get_custom_detection_rule_org_configuration_response.GetCustomDetectionRuleOrgConfigurationResponse"
    ]:
        import capo_guardduty._operations.guard_duty_api_service.get_custom_detection_rule_org_configuration

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetCustomDetectionRuleOrgConfiguration")
    )
    input_: capo_guardduty.types.get_custom_detection_rule_org_configuration_request.GetCustomDetectionRuleOrgConfigurationRequest = {
        "rule_id": rule_id
    }
    if mode is not None:
        input_["mode"] = mode

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