Skip to content

start_on_demand_audit_task

start_on_demand_audit_task(
    target_check_names: TargetAuditCheckNames,
    *,
    config_overrides: Optional[IoTClientConfig] = None,
) -> StartOnDemandAuditTaskResponse

Starts an on-demand Device Defender audit.

Requires permission to access the StartOnDemandAuditTask action.

Parameters:

  • target_check_names (TargetAuditCheckNames) –

    Which checks are performed during the audit. The checks you specify must be enabled for your account or an exception occurs. Use DescribeAccountAuditConfiguration to see the list of all checks, including those that are enabled or UpdateAccountAuditConfiguration to select which checks are enabled.

Raises:

Source code in docs_src/capo_iot/_services/io_t.py
def start_on_demand_audit_task(
    self,
    target_check_names: "capo_iot.types.target_audit_check_names.TargetAuditCheckNames",
    *,
    config_overrides: Optional[IoTClientConfig] = None,
) -> "capo_iot.types.start_on_demand_audit_task_response.StartOnDemandAuditTaskResponse":
    """<p>Starts an on-demand Device Defender audit.</p> <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">StartOnDemandAuditTask</a> action.</p>

    Args:
        target_check_names: <p>Which checks are performed during the audit. The checks you specify must be enabled for your account or an exception occurs. Use <code>DescribeAccountAuditConfiguration</code> to see the list of all checks, including those that are enabled or <code>UpdateAccountAuditConfiguration</code> to select which checks are enabled.</p>

    Raises:
        capo_iot.errors.internal_failure_exception.InternalFailureException: <p>An unexpected error has occurred.</p>
        capo_iot.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_iot.errors.limit_exceeded_exception.LimitExceededException: <p>A limit has been exceeded.</p>
        capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iot.types.start_on_demand_audit_task_request.StartOnDemandAuditTaskRequest]",
    ) -> OperationResponse[
        "capo_iot.types.start_on_demand_audit_task_response.StartOnDemandAuditTaskResponse"
    ]:
        import capo_iot._operations.aws_iot_service.start_on_demand_audit_task

        output, http_response = (
            capo_iot._operations.aws_iot_service.start_on_demand_audit_task.start_on_demand_audit_task(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartOnDemandAuditTask")
    )
    input_: capo_iot.types.start_on_demand_audit_task_request.StartOnDemandAuditTaskRequest = {
        "target_check_names": target_check_names
    }

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