Skip to content

put_events

put_events(
    entries: PutEventsRequestEntryList,
    *,
    config_overrides: Optional[EventBridgeClientConfig] = None,
    endpoint_id: Optional[EndpointId] = None,
) -> PutEventsResponse

Sends custom events to Amazon EventBridge so that they can be matched to rules.

You can batch multiple event entries into one request for efficiency. However, the total entry size must be less than 1MB. You can calculate the entry size before you send the events. For more information, see Calculating PutEvents event entry size in the Amazon EventBridge User Guide .

PutEvents accepts the data in JSON format. For the JSON number (integer) data type, the constraints are: a minimum value of -9,223,372,036,854,775,808 and a maximum value of 9,223,372,036,854,775,807.

PutEvents will only process nested JSON up to 1000 levels deep.

Parameters:

  • entries (PutEventsRequestEntryList) –

    The entry that defines an event in your system. You can specify several parameters for the entry such as the source and type of the event, resources associated with the event, and so on.

  • endpoint_id (Optional[EndpointId], default: None ) –

    The URL subdomain of the endpoint. For example, if the URL for Endpoint is https://abcde.veo.endpoints.event.amazonaws.com, then the EndpointId is abcde.veo.

    When using Java, you must include auth-crt on the class path.

Raises:

Source code in docs_src/capo_eventbridge/_services/event_bridge.py
def put_events(
    self,
    entries: "capo_eventbridge.types.put_events_request_entry_list.PutEventsRequestEntryList",
    *,
    config_overrides: Optional[EventBridgeClientConfig] = None,
    endpoint_id: Optional["capo_eventbridge.types.endpoint_id.EndpointId"] = None,
) -> "capo_eventbridge.types.put_events_response.PutEventsResponse":
    """<p>Sends custom events to Amazon EventBridge so that they can be matched to rules.</p> <p>You can batch multiple event entries into one request for efficiency. However, the total entry size must be less than 1MB. You can calculate the entry size before you send the events. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-putevents.html#eb-putevent-size">Calculating PutEvents event entry size</a> in the <i> <i>Amazon EventBridge User Guide</i> </i>.</p> <p>PutEvents accepts the data in JSON format. For the JSON number (integer) data type, the constraints are: a minimum value of -9,223,372,036,854,775,808 and a maximum value of 9,223,372,036,854,775,807.</p> <note> <p>PutEvents will only process nested JSON up to 1000 levels deep.</p> </note>

    Args:
        entries: <p>The entry that defines an event in your system. You can specify several parameters for the entry such as the source and type of the event, resources associated with the event, and so on.</p>
        endpoint_id: <p>The URL subdomain of the endpoint. For example, if the URL for Endpoint is https://abcde.veo.endpoints.event.amazonaws.com, then the EndpointId is <code>abcde.veo</code>.</p> <important> <p>When using Java, you must include <code>auth-crt</code> on the class path.</p> </important>

    Raises:
        capo_eventbridge.errors.internal_exception.InternalException: <p>This exception occurs due to unexpected causes.</p>
        capo_eventbridge.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_eventbridge.types.put_events_request.PutEventsRequest]",
    ) -> OperationResponse[
        "capo_eventbridge.types.put_events_response.PutEventsResponse"
    ]:
        import capo_eventbridge._operations.aws_events.put_events

        output, http_response = (
            capo_eventbridge._operations.aws_events.put_events.put_events(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutEvents")
    )
    input_: capo_eventbridge.types.put_events_request.PutEventsRequest = {
        "entries": entries
    }
    if endpoint_id is not None:
        input_["endpoint_id"] = endpoint_id

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