Sends a set of messages to the IoT Events system. Each message payload is transformed into the input you specify ("inputName") and ingested into any detectors that monitor that input. If multiple messages are sent, the order in which the messages are processed isn't guaranteed. To guarantee ordering, you must send messages one at a time and wait for a successful response.
Parameters:
-
messages
(Messages)
–
The list of messages to send. Each message has the following format: '{ "messageId": "string", "inputName": "string", "payload": "string"}'
Raises:
Source code in docs_src/capo_iot_events_data/_services/async_io_t_events_data.py
| async def batch_put_message(
self,
messages: "capo_iot_events_data.types.messages.Messages",
*,
config_overrides: Optional[AsyncIoTEventsDataClientConfig] = None,
) -> (
"capo_iot_events_data.types.batch_put_message_response.BatchPutMessageResponse"
):
"""<p>Sends a set of messages to the IoT Events system. Each message payload is transformed into the input you specify (<code>"inputName"</code>) and ingested into any detectors that monitor that input. If multiple messages are sent, the order in which the messages are processed isn't guaranteed. To guarantee ordering, you must send messages one at a time and wait for a successful response.</p>
Args:
messages: <p>The list of messages to send. Each message has the following format: <code>'{ "messageId": "string", "inputName": "string", "payload": "string"}'</code> </p>
Raises:
capo_iot_events_data.errors.internal_failure_exception.InternalFailureException: <p>An internal failure occurred.</p>
capo_iot_events_data.errors.invalid_request_exception.InvalidRequestException: <p>The request was invalid.</p>
capo_iot_events_data.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is currently unavailable.</p>
capo_iot_events_data.errors.throttling_exception.ThrottlingException: <p>The request could not be completed due to throttling.</p>
capo_iot_events_data.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_iot_events_data.types.batch_put_message_request.BatchPutMessageRequest]",
) -> AsyncOperationResponse[
"capo_iot_events_data.types.batch_put_message_response.BatchPutMessageResponse"
]:
import capo_iot_events_data._operations.iot_columbo_data_service.batch_put_message
(
output,
http_response,
) = await capo_iot_events_data._operations.iot_columbo_data_service.batch_put_message.async_batch_put_message(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("BatchPutMessage")
)
input_: capo_iot_events_data.types.batch_put_message_request.BatchPutMessageRequest = {
"messages": messages
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|