list_retained_messages

IoTDataPlane.Client.list_retained_messages(**kwargs)

Lists summary information about the retained messages stored for the account.

This action returns only the topic names of the retained messages. It doesn't return any message payloads. Although this action doesn't return a message payload, it can still incur messaging costs.

To get the message payload of a retained message, call GetRetainedMessage with the topic name of the retained message.

Requires permission to access the ListRetainedMessages action.

For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.

See also: AWS API Documentation

Request Syntax

response = client.list_retained_messages(
    nextToken='string',
    maxResults=123
)
Parameters
  • nextToken (string) -- To retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results.
  • maxResults (integer) -- The maximum number of results to return at one time.
Return type

dict

Returns

Response Syntax

{
    'retainedTopics': [
        {
            'topic': 'string',
            'payloadSize': 123,
            'qos': 123,
            'lastModifiedTime': 123
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • retainedTopics (list) --

      A summary list the account's retained messages. The information returned doesn't include the message payloads of the retained messages.

      • (dict) --

        Information about a single retained message.

        • topic (string) --

          The topic name to which the retained message was published.

        • payloadSize (integer) --

          The size of the retained message's payload in bytes.

        • qos (integer) --

          The quality of service (QoS) level used to publish the retained message.

        • lastModifiedTime (integer) --

          The Epoch date and time, in milliseconds, when the retained message was stored by IoT.

    • nextToken (string) --

      The token for the next set of results, or null if there are no additional results.

Exceptions

  • IoTDataPlane.Client.exceptions.InvalidRequestException
  • IoTDataPlane.Client.exceptions.ThrottlingException
  • IoTDataPlane.Client.exceptions.UnauthorizedException
  • IoTDataPlane.Client.exceptions.ServiceUnavailableException
  • IoTDataPlane.Client.exceptions.InternalFailureException
  • IoTDataPlane.Client.exceptions.MethodNotAllowedException