Skip to content

put_raw_events async

put_raw_events(
    event_bus_arn: EventBusArn,
    entries: PutRawEventsRequestEntryList,
    *,
    config_overrides: Optional[AsyncEventBridgeV2ClientConfig] = None,
    schema_registry_configuration: Optional[SchemaRegistryConfiguration] = None,
    deduplication_configuration: Optional[DeduplicationConfiguration] = None,
) -> PutRawEventsResponse

Publishes pre-shaped events to an event bus.

The total size of all event entries in a request must not exceed 1 MB (1,048,576 bytes), including the Data payload and the keys and values of Metadata for each entry. The limit applies to the request as a whole, not to individual entries.

If you exceed the limit, the request fails with InvalidInputException, and the service doesn't publish any of the entries in the request.

Parameters:

  • event_bus_arn (EventBusArn) –

    The Amazon Resource Name (ARN) that uniquely identifies an event bus.

  • entries (PutRawEventsRequestEntryList) –

    List of event entries to publish. Must contain at least one entry.

  • schema_registry_configuration (Optional[SchemaRegistryConfiguration], default: None ) –

    Schema-registry settings for encoding open-format (Avro/Protobuf) events. Required for open-format entries; ignored for JSON entries. The registry is read with the caller's credentials, so the caller needs read access to the registry it references.

  • deduplication_configuration (Optional[DeduplicationConfiguration], default: None ) –

    Request-level deduplication settings, applied to every entry in the batch.

Raises:

  • AccessDeniedException –

    The caller does not have the permissions required to perform the operation. This error is also returned when the operation cannot use the AWS KMS key for the event bus.

  • InternalException –

    The request failed because of an internal service error. Retry the request.

  • InvalidInputException –

    A request parameter is missing or not valid.

  • ThrottlingException –

    The request was throttled because it exceeds a request rate limit. Retry the request with backoff.

  • InvalidStateException –

    The resource is not in a state that allows the operation. For example, an event bus that is still being created cannot accept events.

  • ResourceNotFoundException –

    The resource does not exist.

  • SchemaRegistryUnavailableException –

    The configured schema registry could not be reached. Retry the request.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_eventbridgev2/_services/async_event_bridge_v2.py
async def put_raw_events(
    self,
    event_bus_arn: "capo_eventbridgev2.types.event_bus_arn.EventBusArn",
    entries: "capo_eventbridgev2.types.put_raw_events_request_entry_list.PutRawEventsRequestEntryList",
    *,
    config_overrides: Optional[AsyncEventBridgeV2ClientConfig] = None,
    schema_registry_configuration: Optional[
        "capo_eventbridgev2.types.schema_registry_configuration.SchemaRegistryConfiguration"
    ] = None,
    deduplication_configuration: Optional[
        "capo_eventbridgev2.types.deduplication_configuration.DeduplicationConfiguration"
    ] = None,
) -> "capo_eventbridgev2.types.put_raw_events_response.PutRawEventsResponse":
    """<p>Publishes pre-shaped events to an event bus.</p> <p>The total size of all event entries in a request must not exceed 1 MB (1,048,576 bytes), including the <code>Data</code> payload and the keys and values of <code>Metadata</code> for each entry. The limit applies to the request as a whole, not to individual entries.</p> <p>If you exceed the limit, the request fails with <code>InvalidInputException</code>, and the service doesn't publish any of the entries in the request.</p>

    Args:
        event_bus_arn: <p>The Amazon Resource Name (ARN) that uniquely identifies an event bus.</p>
        entries: <p>List of event entries to publish. Must contain at least one entry.</p>
        schema_registry_configuration: <p>Schema-registry settings for encoding open-format (Avro/Protobuf) events. Required for open-format entries; ignored for JSON entries. The registry is read with the caller's credentials, so the caller needs read access to the registry it references.</p>
        deduplication_configuration: <p>Request-level deduplication settings, applied to every entry in the batch.</p>

    Raises:
        capo_eventbridgev2.errors.access_denied_exception.AccessDeniedException: <p>The caller does not have the permissions required to perform the operation. This error is also returned when the operation cannot use the AWS KMS key for the event bus.</p>
        capo_eventbridgev2.errors.internal_exception.InternalException: <p>The request failed because of an internal service error. Retry the request.</p>
        capo_eventbridgev2.errors.invalid_input_exception.InvalidInputException: <p>A request parameter is missing or not valid.</p>
        capo_eventbridgev2.errors.throttling_exception.ThrottlingException: <p>The request was throttled because it exceeds a request rate limit. Retry the request with backoff.</p>
        capo_eventbridgev2.errors.invalid_state_exception.InvalidStateException: <p>The resource is not in a state that allows the operation. For example, an event bus that is still being created cannot accept events.</p>
        capo_eventbridgev2.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource does not exist.</p>
        capo_eventbridgev2.errors.schema_registry_unavailable_exception.SchemaRegistryUnavailableException: <p>The configured schema registry could not be reached. Retry the request.</p>
        capo_eventbridgev2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_eventbridgev2.types.put_raw_events_request.PutRawEventsRequest]",
    ) -> AsyncOperationResponse[
        "capo_eventbridgev2.types.put_raw_events_response.PutRawEventsResponse"
    ]:
        import capo_eventbridgev2._operations.aws_events_v2.put_raw_events

        (
            output,
            http_response,
        ) = await capo_eventbridgev2._operations.aws_events_v2.put_raw_events.async_put_raw_events(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_eventbridgev2.types.put_raw_events_request.PutRawEventsRequest",
    ) -> dict[str, Any]:
        import capo_eventbridgev2.types.put_raw_events_request

        return capo_eventbridgev2.types.put_raw_events_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("PutRawEvents", redact_input=_redact_input),
    )
    input_: capo_eventbridgev2.types.put_raw_events_request.PutRawEventsRequest = {
        "event_bus_arn": event_bus_arn,
        "entries": entries,
    }
    if schema_registry_configuration is not None:
        input_["schema_registry_configuration"] = schema_registry_configuration
    if deduplication_configuration is not None:
        input_["deduplication_configuration"] = deduplication_configuration

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