Skip to content

set_v2_logging_options async

set_v2_logging_options(
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    role_arn: Optional[AwsArn] = None,
    default_log_level: Optional[LogLevel] = None,
    disable_all_logs: Optional[DisableAllLogs] = None,
    event_configurations: Optional[LogEventConfigurations] = None,
) -> None

Sets the logging options for the V2 logging service.

Requires permission to access the SetV2LoggingOptions action.

Parameters:

  • role_arn (Optional[AwsArn], default: None ) –

    The ARN of the role that allows IoT to write to Cloudwatch logs.

  • default_log_level (Optional[LogLevel], default: None ) –

    The default logging level.

  • disable_all_logs (Optional[DisableAllLogs], default: None ) –

    If true all logs are disabled. The default is false.

  • event_configurations (Optional[LogEventConfigurations], default: None ) –

    The list of event configurations that override account-level logging.

Raises:

Source code in docs_src/capo_iot/_services/async_io_t.py
async def set_v2_logging_options(
    self,
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    role_arn: Optional["capo_iot.types.aws_arn.AwsArn"] = None,
    default_log_level: Optional["capo_iot.types.log_level.LogLevel"] = None,
    disable_all_logs: Optional[
        "capo_iot.types.disable_all_logs.DisableAllLogs"
    ] = None,
    event_configurations: Optional[
        "capo_iot.types.log_event_configurations.LogEventConfigurations"
    ] = None,
) -> None:
    """<p>Sets the logging options for the V2 logging service.</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">SetV2LoggingOptions</a> action.</p>

    Args:
        role_arn: <p>The ARN of the role that allows IoT to write to Cloudwatch logs.</p>
        default_log_level: <p>The default logging level.</p>
        disable_all_logs: <p>If true all logs are disabled. The default is false.</p>
        event_configurations: <p> The list of event configurations that override account-level logging. </p>

    Raises:
        capo_iot.errors.internal_exception.InternalException: <p>An unexpected error has occurred.</p>
        capo_iot.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_iot.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is temporarily unavailable.</p>
        capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iot.types.set_v2_logging_options_request.SetV2LoggingOptionsRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_iot._operations.aws_iot_service.set_v2_logging_options

        (
            output,
            http_response,
        ) = await capo_iot._operations.aws_iot_service.set_v2_logging_options.async_set_v2_logging_options(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SetV2LoggingOptions")
    )
    input_: capo_iot.types.set_v2_logging_options_request.SetV2LoggingOptionsRequest = {}
    if role_arn is not None:
        input_["role_arn"] = role_arn
    if default_log_level is not None:
        input_["default_log_level"] = default_log_level
    if disable_all_logs is not None:
        input_["disable_all_logs"] = disable_all_logs
    if event_configurations is not None:
        input_["event_configurations"] = event_configurations

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output