Gets the details of a single retained message for the specified topic.
This action returns the message payload of the retained message, which can incur messaging costs. To list only the topic names of the retained messages, call ListRetainedMessages.
Requires permission to access the GetRetainedMessage action.
For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.
Parameters:
-
topic
(Topic)
–
The topic name of the retained message to retrieve.
Raises:
Source code in docs_src/capo_iot_data_plane/_services/async_io_t_data_plane.py
| async def get_retained_message(
self,
topic: "capo_iot_data_plane.types.topic.Topic",
*,
config_overrides: Optional[AsyncIoTDataPlaneClientConfig] = None,
) -> "capo_iot_data_plane.types.get_retained_message_response.GetRetainedMessageResponse":
"""<p>Gets the details of a single retained message for the specified topic.</p> <p>This action returns the message payload of the retained message, which can incur messaging costs. To list only the topic names of the retained messages, call <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_iotdata_ListRetainedMessages.html">ListRetainedMessages</a>.</p> <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html">GetRetainedMessage</a> action.</p> <p>For more information about messaging costs, see <a href="http://aws.amazon.com/iot-core/pricing/#Messaging">Amazon Web Services IoT Core pricing - Messaging</a>.</p>
Args:
topic: <p>The topic name of the retained message to retrieve.</p>
Raises:
capo_iot_data_plane.errors.internal_failure_exception.InternalFailureException: <p>An unexpected error has occurred.</p>
capo_iot_data_plane.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
capo_iot_data_plane.errors.method_not_allowed_exception.MethodNotAllowedException: <p>The specified combination of HTTP verb and URI is not supported.</p>
capo_iot_data_plane.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
capo_iot_data_plane.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is temporarily unavailable.</p>
capo_iot_data_plane.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
capo_iot_data_plane.errors.unauthorized_exception.UnauthorizedException: <p>You are not authorized to perform this operation.</p>
capo_iot_data_plane.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_iot_data_plane.types.get_retained_message_request.GetRetainedMessageRequest]",
) -> AsyncOperationResponse[
"capo_iot_data_plane.types.get_retained_message_response.GetRetainedMessageResponse"
]:
import capo_iot_data_plane._operations.iot_moonraker_service.get_retained_message
(
output,
http_response,
) = await capo_iot_data_plane._operations.iot_moonraker_service.get_retained_message.async_get_retained_message(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetRetainedMessage")
)
input_: capo_iot_data_plane.types.get_retained_message_request.GetRetainedMessageRequest = {
"topic": topic
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|