Skip to content

update_scheduled_audit

update_scheduled_audit(
    scheduled_audit_name: ScheduledAuditName,
    *,
    config_overrides: Optional[IoTClientConfig] = None,
    frequency: Optional[AuditFrequency] = None,
    day_of_month: Optional[DayOfMonth] = None,
    day_of_week: Optional[DayOfWeek] = None,
    target_check_names: Optional[TargetAuditCheckNames] = None,
) -> UpdateScheduledAuditResponse

Updates a scheduled audit, including which checks are performed and how often the audit takes place.

Requires permission to access the UpdateScheduledAudit action.

Parameters:

  • frequency (Optional[AuditFrequency], default: None ) –

    How often the scheduled audit takes place, either DAILY, WEEKLY, BIWEEKLY, or MONTHLY. The start time of each audit is determined by the system.

  • day_of_month (Optional[DayOfMonth], default: None ) –

    The day of the month on which the scheduled audit takes place. This can be 1 through 31 or LAST. This field is required if the frequency parameter is set to MONTHLY. If days 29-31 are specified, and the month does not have that many days, the audit takes place on the "LAST" day of the month.

  • day_of_week (Optional[DayOfWeek], default: None ) –

    The day of the week on which the scheduled audit takes place. This can be one of SUN, MON, TUE, WED, THU, FRI, or SAT. This field is required if the "frequency" parameter is set to WEEKLY or BIWEEKLY.

  • target_check_names (Optional[TargetAuditCheckNames], default: None ) –

    Which checks are performed during the scheduled audit. Checks must be enabled for your account. (Use DescribeAccountAuditConfiguration to see the list of all checks, including those that are enabled or use UpdateAccountAuditConfiguration to select which checks are enabled.)

  • scheduled_audit_name (ScheduledAuditName) –

    The name of the scheduled audit. (Max. 128 chars)

Raises:

Source code in docs_src/capo_iot/_services/io_t.py
def update_scheduled_audit(
    self,
    scheduled_audit_name: "capo_iot.types.scheduled_audit_name.ScheduledAuditName",
    *,
    config_overrides: Optional[IoTClientConfig] = None,
    frequency: Optional["capo_iot.types.audit_frequency.AuditFrequency"] = None,
    day_of_month: Optional["capo_iot.types.day_of_month.DayOfMonth"] = None,
    day_of_week: Optional["capo_iot.types.day_of_week.DayOfWeek"] = None,
    target_check_names: Optional[
        "capo_iot.types.target_audit_check_names.TargetAuditCheckNames"
    ] = None,
) -> "capo_iot.types.update_scheduled_audit_response.UpdateScheduledAuditResponse":
    """<p>Updates a scheduled audit, including which checks are performed and how often the audit takes place.</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">UpdateScheduledAudit</a> action.</p>

    Args:
        frequency: <p>How often the scheduled audit takes place, either <code>DAILY</code>, <code>WEEKLY</code>, <code>BIWEEKLY</code>, or <code>MONTHLY</code>. The start time of each audit is determined by the system.</p>
        day_of_month: <p>The day of the month on which the scheduled audit takes place. This can be <code>1</code> through <code>31</code> or <code>LAST</code>. This field is required if the <code>frequency</code> parameter is set to <code>MONTHLY</code>. If days 29-31 are specified, and the month does not have that many days, the audit takes place on the "LAST" day of the month.</p>
        day_of_week: <p>The day of the week on which the scheduled audit takes place. This can be one of <code>SUN</code>, <code>MON</code>, <code>TUE</code>, <code>WED</code>, <code>THU</code>, <code>FRI</code>, or <code>SAT</code>. This field is required if the "frequency" parameter is set to <code>WEEKLY</code> or <code>BIWEEKLY</code>.</p>
        target_check_names: <p>Which checks are performed during the scheduled audit. Checks must be enabled for your account. (Use <code>DescribeAccountAuditConfiguration</code> to see the list of all checks, including those that are enabled or use <code>UpdateAccountAuditConfiguration</code> to select which checks are enabled.)</p>
        scheduled_audit_name: <p>The name of the scheduled audit. (Max. 128 chars)</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.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</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.update_scheduled_audit_request.UpdateScheduledAuditRequest]",
    ) -> OperationResponse[
        "capo_iot.types.update_scheduled_audit_response.UpdateScheduledAuditResponse"
    ]:
        import capo_iot._operations.aws_iot_service.update_scheduled_audit

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateScheduledAudit")
    )
    input_: capo_iot.types.update_scheduled_audit_request.UpdateScheduledAuditRequest = {
        "scheduled_audit_name": scheduled_audit_name
    }
    if frequency is not None:
        input_["frequency"] = frequency
    if day_of_month is not None:
        input_["day_of_month"] = day_of_month
    if day_of_week is not None:
        input_["day_of_week"] = day_of_week
    if target_check_names is not None:
        input_["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