Skip to content

create_event_log_configuration

create_event_log_configuration(
    resource_type: SmartHomeResourceType,
    event_log_level: LogLevel,
    *,
    config_overrides: Optional[IoTManagedIntegrationsClientConfig] = None,
    resource_id: Optional[SmartHomeResourceId] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateEventLogConfigurationResponse

Set the event log configuration for the account, resource type, or specific resource.

Parameters:

  • resource_type (SmartHomeResourceType) –

    The type of resource for the event log configuration.

  • resource_id (Optional[SmartHomeResourceId], default: None ) –

    The identifier of the resource for the event log configuration.

  • event_log_level (LogLevel) –

    The logging level for the event log configuration.

  • client_token (Optional[ClientToken], default: None ) –

    An idempotency token. If you retry a request that completed successfully initially using the same client token and parameters, then the retry attempt will succeed without performing any further actions.

Raises:

Source code in docs_src/capo_iot_managed_integrations/_services/io_t_managed_integrations.py
def create_event_log_configuration(
    self,
    resource_type: "capo_iot_managed_integrations.types.smart_home_resource_type.SmartHomeResourceType",
    event_log_level: "capo_iot_managed_integrations.types.log_level.LogLevel",
    *,
    config_overrides: Optional[IoTManagedIntegrationsClientConfig] = None,
    resource_id: Optional[
        "capo_iot_managed_integrations.types.smart_home_resource_id.SmartHomeResourceId"
    ] = None,
    client_token: Optional[
        "capo_iot_managed_integrations.types.client_token.ClientToken"
    ] = None,
) -> "capo_iot_managed_integrations.types.create_event_log_configuration_response.CreateEventLogConfigurationResponse":
    """<p>Set the event log configuration for the account, resource type, or specific resource.</p>

    Args:
        resource_type: <p>The type of resource for the event log configuration.</p>
        resource_id: <p>The identifier of the resource for the event log configuration.</p>
        event_log_level: <p>The logging level for the event log configuration.</p>
        client_token: <p>An idempotency token. If you retry a request that completed successfully initially using the same client token and parameters, then the retry attempt will succeed without performing any further actions.</p>

    Raises:
        capo_iot_managed_integrations.errors.access_denied_exception.AccessDeniedException: <p>User is not authorized.</p>
        capo_iot_managed_integrations.errors.conflict_exception.ConflictException: <p>There is a conflict with the request.</p>
        capo_iot_managed_integrations.errors.internal_server_exception.InternalServerException: <p>Internal error from the service that indicates an unexpected error or that the service is unavailable.</p>
        capo_iot_managed_integrations.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service quota has been exceeded for this request.</p>
        capo_iot_managed_integrations.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot_managed_integrations.errors.validation_exception.ValidationException: <p>A validation error occurred when performing the API request.</p>
        capo_iot_managed_integrations.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iot_managed_integrations.types.create_event_log_configuration_request.CreateEventLogConfigurationRequest]",
    ) -> OperationResponse[
        "capo_iot_managed_integrations.types.create_event_log_configuration_response.CreateEventLogConfigurationResponse"
    ]:
        import capo_iot_managed_integrations._operations.iot_managed_integrations.create_event_log_configuration

        output, http_response = (
            capo_iot_managed_integrations._operations.iot_managed_integrations.create_event_log_configuration.create_event_log_configuration(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateEventLogConfiguration")
    )
    input_: capo_iot_managed_integrations.types.create_event_log_configuration_request.CreateEventLogConfigurationRequest = {
        "resource_type": resource_type,
        "event_log_level": event_log_level,
    }
    if resource_id is not None:
        input_["resource_id"] = resource_id
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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