sample_channel_data

IoTAnalytics.Client.sample_channel_data(**kwargs)

Retrieves a sample of messages from the specified channel ingested during the specified timeframe. Up to 10 messages can be retrieved.

See also: AWS API Documentation

Request Syntax

response = client.sample_channel_data(
    channelName='string',
    maxMessages=123,
    startTime=datetime(2015, 1, 1),
    endTime=datetime(2015, 1, 1)
)
Parameters
  • channelName (string) --

    [REQUIRED]

    The name of the channel whose message samples are retrieved.

  • maxMessages (integer) -- The number of sample messages to be retrieved. The limit is 10. The default is also 10.
  • startTime (datetime) -- The start of the time window from which sample messages are retrieved.
  • endTime (datetime) -- The end of the time window from which sample messages are retrieved.
Return type

dict

Returns

Response Syntax

{
    'payloads': [
        b'bytes',
    ]
}

Response Structure

  • (dict) --

    • payloads (list) --

      The list of message samples. Each sample message is returned as a base64-encoded string.

      • (bytes) --

Exceptions

  • IoTAnalytics.Client.exceptions.InvalidRequestException
  • IoTAnalytics.Client.exceptions.ResourceNotFoundException
  • IoTAnalytics.Client.exceptions.InternalFailureException
  • IoTAnalytics.Client.exceptions.ServiceUnavailableException
  • IoTAnalytics.Client.exceptions.ThrottlingException