Jump to Content

This API Documentation is now deprecated

We are excited to announce our new API Documentation.

Class ListRetainedMessagesCommandProtected

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.

Example

Use a bare-bones client and the command you need to make an API call.

import { IoTDataPlaneClient, ListRetainedMessagesCommand } from "@aws-sdk/client-iot-data-plane"; // ES Modules import
// const { IoTDataPlaneClient, ListRetainedMessagesCommand } = require("@aws-sdk/client-iot-data-plane"); // CommonJS import
const client = new IoTDataPlaneClient(config);
const input = { // ListRetainedMessagesRequest
nextToken: "STRING_VALUE",
maxResults: Number("int"),
};
const command = new ListRetainedMessagesCommand(input);
const response = await client.send(command);
// { // ListRetainedMessagesResponse
// retainedTopics: [ // RetainedMessageList
// { // RetainedMessageSummary
// topic: "STRING_VALUE",
// payloadSize: Number("long"),
// qos: Number("int"),
// lastModifiedTime: Number("long"),
// },
// ],
// nextToken: "STRING_VALUE",
// };

Param

ListRetainedMessagesCommandInput

Returns

ListRetainedMessagesCommandOutput

See

Throws

InternalFailureException (server fault)

An unexpected error has occurred.

Throws

InvalidRequestException (client fault)

The request is not valid.

Throws

MethodNotAllowedException (client fault)

The specified combination of HTTP verb and URI is not supported.

Throws

ServiceUnavailableException (server fault)

The service is temporarily unavailable.

Throws

ThrottlingException (client fault)

The rate exceeds the limit.

Throws

UnauthorizedException (client fault)

You are not authorized to perform this operation.

Throws

IoTDataPlaneServiceException

Base exception class for all service exceptions from IoTDataPlane service.

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

Methods