AWS IoT Analytics

2019/05/30 - AWS IoT Analytics - 8 updated api methods

Changes  IoT Analytics adds the option to use your own S3 bucket to store channel and data store resources. Previously, only service-managed storage was used.

CreateChannel (updated) Link ¶
Changes (request)
{'channelStorage': {'customerManagedS3': {'bucket': 'string',
                                          'keyPrefix': 'string',
                                          'roleArn': 'string'},
                    'serviceManagedS3': {}}}

Creates a channel. A channel collects data from an MQTT topic and archives the raw, unprocessed messages before publishing the data to a pipeline.

See also: AWS API Documentation

Request Syntax

client.create_channel(
    channelName='string',
    channelStorage={
        'serviceManagedS3': {}
        ,
        'customerManagedS3': {
            'bucket': 'string',
            'keyPrefix': 'string',
            'roleArn': 'string'
        }
    },
    retentionPeriod={
        'unlimited': True|False,
        'numberOfDays': 123
    },
    tags=[
        {
            'key': 'string',
            'value': 'string'
        },
    ]
)
type channelName

string

param channelName

[REQUIRED]

The name of the channel.

type channelStorage

dict

param channelStorage

Where channel data is stored.

  • serviceManagedS3 (dict) --

    Use this to store channel data in an S3 bucket managed by the AWS IoT Analytics service.

  • customerManagedS3 (dict) --

    Use this to store channel data in an S3 bucket that you manage.

    • bucket (string) -- [REQUIRED]

      The name of the Amazon S3 bucket in which channel data is stored.

    • keyPrefix (string) --

      The prefix used to create the keys of the channel data objects. Each object in an Amazon S3 bucket has a key that is its unique identifier within the bucket (each object in a bucket has exactly one key).

    • roleArn (string) -- [REQUIRED]

      The ARN of the role which grants AWS IoT Analytics permission to interact with your Amazon S3 resources.

type retentionPeriod

dict

param retentionPeriod

How long, in days, message data is kept for the channel.

  • unlimited (boolean) --

    If true, message data is kept indefinitely.

  • numberOfDays (integer) --

    The number of days that message data is kept. The "unlimited" parameter must be false.

type tags

list

param tags

Metadata which can be used to manage the channel.

  • (dict) --

    A set of key/value pairs which are used to manage the resource.

    • key (string) -- [REQUIRED]

      The tag's key.

    • value (string) -- [REQUIRED]

      The tag's value.

rtype

dict

returns

Response Syntax

{
    'channelName': 'string',
    'channelArn': 'string',
    'retentionPeriod': {
        'unlimited': True|False,
        'numberOfDays': 123
    }
}

Response Structure

  • (dict) --

    • channelName (string) --

      The name of the channel.

    • channelArn (string) --

      The ARN of the channel.

    • retentionPeriod (dict) --

      How long, in days, message data is kept for the channel.

      • unlimited (boolean) --

        If true, message data is kept indefinitely.

      • numberOfDays (integer) --

        The number of days that message data is kept. The "unlimited" parameter must be false.

CreateDatastore (updated) Link ¶
Changes (request)
{'datastoreStorage': {'customerManagedS3': {'bucket': 'string',
                                            'keyPrefix': 'string',
                                            'roleArn': 'string'},
                      'serviceManagedS3': {}}}

Creates a data store, which is a repository for messages.

See also: AWS API Documentation

Request Syntax

client.create_datastore(
    datastoreName='string',
    datastoreStorage={
        'serviceManagedS3': {}
        ,
        'customerManagedS3': {
            'bucket': 'string',
            'keyPrefix': 'string',
            'roleArn': 'string'
        }
    },
    retentionPeriod={
        'unlimited': True|False,
        'numberOfDays': 123
    },
    tags=[
        {
            'key': 'string',
            'value': 'string'
        },
    ]
)
type datastoreName

string

param datastoreName

[REQUIRED]

The name of the data store.

type datastoreStorage

dict

param datastoreStorage

Where data store data is stored.

  • serviceManagedS3 (dict) --

    Use this to store data store data in an S3 bucket managed by the AWS IoT Analytics service.

  • customerManagedS3 (dict) --

    Use this to store data store data in an S3 bucket that you manage.

    • bucket (string) -- [REQUIRED]

      The name of the Amazon S3 bucket in which data store data is stored.

    • keyPrefix (string) --

      The prefix used to create the keys of the data store data objects. Each object in an Amazon S3 bucket has a key that is its unique identifier within the bucket (each object in a bucket has exactly one key).

    • roleArn (string) -- [REQUIRED]

      The ARN of the role which grants AWS IoT Analytics permission to interact with your Amazon S3 resources.

type retentionPeriod

dict

param retentionPeriod

How long, in days, message data is kept for the data store.

  • unlimited (boolean) --

    If true, message data is kept indefinitely.

  • numberOfDays (integer) --

    The number of days that message data is kept. The "unlimited" parameter must be false.

type tags

list

param tags

Metadata which can be used to manage the data store.

  • (dict) --

    A set of key/value pairs which are used to manage the resource.

    • key (string) -- [REQUIRED]

      The tag's key.

    • value (string) -- [REQUIRED]

      The tag's value.

rtype

dict

returns

Response Syntax

{
    'datastoreName': 'string',
    'datastoreArn': 'string',
    'retentionPeriod': {
        'unlimited': True|False,
        'numberOfDays': 123
    }
}

Response Structure

  • (dict) --

    • datastoreName (string) --

      The name of the data store.

    • datastoreArn (string) --

      The ARN of the data store.

    • retentionPeriod (dict) --

      How long, in days, message data is kept for the data store.

      • unlimited (boolean) --

        If true, message data is kept indefinitely.

      • numberOfDays (integer) --

        The number of days that message data is kept. The "unlimited" parameter must be false.

DescribeChannel (updated) Link ¶
Changes (response)
{'channel': {'storage': {'customerManagedS3': {'bucket': 'string',
                                               'keyPrefix': 'string',
                                               'roleArn': 'string'},
                         'serviceManagedS3': {}}}}

Retrieves information about a channel.

See also: AWS API Documentation

Request Syntax

client.describe_channel(
    channelName='string',
    includeStatistics=True|False
)
type channelName

string

param channelName

[REQUIRED]

The name of the channel whose information is retrieved.

type includeStatistics

boolean

param includeStatistics

If true, additional statistical information about the channel is included in the response.

rtype

dict

returns

Response Syntax

{
    'channel': {
        'name': 'string',
        'storage': {
            'serviceManagedS3': {},
            'customerManagedS3': {
                'bucket': 'string',
                'keyPrefix': 'string',
                'roleArn': 'string'
            }
        },
        'arn': 'string',
        'status': 'CREATING'|'ACTIVE'|'DELETING',
        'retentionPeriod': {
            'unlimited': True|False,
            'numberOfDays': 123
        },
        'creationTime': datetime(2015, 1, 1),
        'lastUpdateTime': datetime(2015, 1, 1)
    },
    'statistics': {
        'size': {
            'estimatedSizeInBytes': 123.0,
            'estimatedOn': datetime(2015, 1, 1)
        }
    }
}

Response Structure

  • (dict) --

    • channel (dict) --

      An object that contains information about the channel.

      • name (string) --

        The name of the channel.

      • storage (dict) --

        Where channel data is stored.

        • serviceManagedS3 (dict) --

          Use this to store channel data in an S3 bucket managed by the AWS IoT Analytics service.

        • customerManagedS3 (dict) --

          Use this to store channel data in an S3 bucket that you manage.

          • bucket (string) --

            The name of the Amazon S3 bucket in which channel data is stored.

          • keyPrefix (string) --

            The prefix used to create the keys of the channel data objects. Each object in an Amazon S3 bucket has a key that is its unique identifier within the bucket (each object in a bucket has exactly one key).

          • roleArn (string) --

            The ARN of the role which grants AWS IoT Analytics permission to interact with your Amazon S3 resources.

      • arn (string) --

        The ARN of the channel.

      • status (string) --

        The status of the channel.

      • retentionPeriod (dict) --

        How long, in days, message data is kept for the channel.

        • unlimited (boolean) --

          If true, message data is kept indefinitely.

        • numberOfDays (integer) --

          The number of days that message data is kept. The "unlimited" parameter must be false.

      • creationTime (datetime) --

        When the channel was created.

      • lastUpdateTime (datetime) --

        When the channel was last updated.

    • statistics (dict) --

      Statistics about the channel. Included if the 'includeStatistics' parameter is set to true in the request.

      • size (dict) --

        The estimated size of the channel.

        • estimatedSizeInBytes (float) --

          The estimated size of the resource in bytes.

        • estimatedOn (datetime) --

          The time when the estimate of the size of the resource was made.

DescribeDatastore (updated) Link ¶
Changes (response)
{'datastore': {'storage': {'customerManagedS3': {'bucket': 'string',
                                                 'keyPrefix': 'string',
                                                 'roleArn': 'string'},
                           'serviceManagedS3': {}}}}

Retrieves information about a data store.

See also: AWS API Documentation

Request Syntax

client.describe_datastore(
    datastoreName='string',
    includeStatistics=True|False
)
type datastoreName

string

param datastoreName

[REQUIRED]

The name of the data store

type includeStatistics

boolean

param includeStatistics

If true, additional statistical information about the datastore is included in the response.

rtype

dict

returns

Response Syntax

{
    'datastore': {
        'name': 'string',
        'storage': {
            'serviceManagedS3': {},
            'customerManagedS3': {
                'bucket': 'string',
                'keyPrefix': 'string',
                'roleArn': 'string'
            }
        },
        'arn': 'string',
        'status': 'CREATING'|'ACTIVE'|'DELETING',
        'retentionPeriod': {
            'unlimited': True|False,
            'numberOfDays': 123
        },
        'creationTime': datetime(2015, 1, 1),
        'lastUpdateTime': datetime(2015, 1, 1)
    },
    'statistics': {
        'size': {
            'estimatedSizeInBytes': 123.0,
            'estimatedOn': datetime(2015, 1, 1)
        }
    }
}

Response Structure

  • (dict) --

    • datastore (dict) --

      Information about the data store.

      • name (string) --

        The name of the data store.

      • storage (dict) --

        Where data store data is stored.

        • serviceManagedS3 (dict) --

          Use this to store data store data in an S3 bucket managed by the AWS IoT Analytics service.

        • customerManagedS3 (dict) --

          Use this to store data store data in an S3 bucket that you manage.

          • bucket (string) --

            The name of the Amazon S3 bucket in which data store data is stored.

          • keyPrefix (string) --

            The prefix used to create the keys of the data store data objects. Each object in an Amazon S3 bucket has a key that is its unique identifier within the bucket (each object in a bucket has exactly one key).

          • roleArn (string) --

            The ARN of the role which grants AWS IoT Analytics permission to interact with your Amazon S3 resources.

      • arn (string) --

        The ARN of the data store.

      • status (string) --

        The status of a data store:

        CREATING

        The data store is being created.

        ACTIVE

        The data store has been created and can be used.

        DELETING

        The data store is being deleted.

      • retentionPeriod (dict) --

        How long, in days, message data is kept for the data store.

        • unlimited (boolean) --

          If true, message data is kept indefinitely.

        • numberOfDays (integer) --

          The number of days that message data is kept. The "unlimited" parameter must be false.

      • creationTime (datetime) --

        When the data store was created.

      • lastUpdateTime (datetime) --

        The last time the data store was updated.

    • statistics (dict) --

      Additional statistical information about the data store. Included if the 'includeStatistics' parameter is set to true in the request.

      • size (dict) --

        The estimated size of the data store.

        • estimatedSizeInBytes (float) --

          The estimated size of the resource in bytes.

        • estimatedOn (datetime) --

          The time when the estimate of the size of the resource was made.

ListChannels (updated) Link ¶
Changes (response)
{'channelSummaries': {'channelStorage': {'customerManagedS3': {'bucket': 'string',
                                                               'keyPrefix': 'string',
                                                               'roleArn': 'string'},
                                         'serviceManagedS3': {}}}}

Retrieves a list of channels.

See also: AWS API Documentation

Request Syntax

client.list_channels(
    nextToken='string',
    maxResults=123
)
type nextToken

string

param nextToken

The token for the next set of results.

type maxResults

integer

param maxResults

The maximum number of results to return in this request.

The default value is 100.

rtype

dict

returns

Response Syntax

{
    'channelSummaries': [
        {
            'channelName': 'string',
            'channelStorage': {
                'serviceManagedS3': {},
                'customerManagedS3': {
                    'bucket': 'string',
                    'keyPrefix': 'string',
                    'roleArn': 'string'
                }
            },
            'status': 'CREATING'|'ACTIVE'|'DELETING',
            'creationTime': datetime(2015, 1, 1),
            'lastUpdateTime': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • channelSummaries (list) --

      A list of "ChannelSummary" objects.

      • (dict) --

        A summary of information about a channel.

        • channelName (string) --

          The name of the channel.

        • channelStorage (dict) --

          Where channel data is stored.

          • serviceManagedS3 (dict) --

            Used to store channel data in an S3 bucket managed by the AWS IoT Analytics service.

          • customerManagedS3 (dict) --

            Used to store channel data in an S3 bucket that you manage.

            • bucket (string) --

              The name of the Amazon S3 bucket in which channel data is stored.

            • keyPrefix (string) --

              The prefix used to create the keys of the channel data objects. Each object in an Amazon S3 bucket has a key that is its unique identifier within the bucket (each object in a bucket has exactly one key).

            • roleArn (string) --

              The ARN of the role which grants AWS IoT Analytics permission to interact with your Amazon S3 resources.

        • status (string) --

          The status of the channel.

        • creationTime (datetime) --

          When the channel was created.

        • lastUpdateTime (datetime) --

          The last time the channel was updated.

    • nextToken (string) --

      The token to retrieve the next set of results, or null if there are no more results.

ListDatastores (updated) Link ¶
Changes (response)
{'datastoreSummaries': {'datastoreStorage': {'customerManagedS3': {'bucket': 'string',
                                                                   'keyPrefix': 'string',
                                                                   'roleArn': 'string'},
                                             'serviceManagedS3': {}}}}

Retrieves a list of data stores.

See also: AWS API Documentation

Request Syntax

client.list_datastores(
    nextToken='string',
    maxResults=123
)
type nextToken

string

param nextToken

The token for the next set of results.

type maxResults

integer

param maxResults

The maximum number of results to return in this request.

The default value is 100.

rtype

dict

returns

Response Syntax

{
    'datastoreSummaries': [
        {
            'datastoreName': 'string',
            'datastoreStorage': {
                'serviceManagedS3': {},
                'customerManagedS3': {
                    'bucket': 'string',
                    'keyPrefix': 'string',
                    'roleArn': 'string'
                }
            },
            'status': 'CREATING'|'ACTIVE'|'DELETING',
            'creationTime': datetime(2015, 1, 1),
            'lastUpdateTime': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • datastoreSummaries (list) --

      A list of "DatastoreSummary" objects.

      • (dict) --

        A summary of information about a data store.

        • datastoreName (string) --

          The name of the data store.

        • datastoreStorage (dict) --

          Where data store data is stored.

          • serviceManagedS3 (dict) --

            Used to store data store data in an S3 bucket managed by the AWS IoT Analytics service.

          • customerManagedS3 (dict) --

            Used to store data store data in an S3 bucket that you manage.

            • bucket (string) --

              The name of the Amazon S3 bucket in which data store data is stored.

            • keyPrefix (string) --

              The prefix used to create the keys of the data store data objects. Each object in an Amazon S3 bucket has a key that is its unique identifier within the bucket (each object in a bucket has exactly one key).

            • roleArn (string) --

              The ARN of the role which grants AWS IoT Analytics permission to interact with your Amazon S3 resources.

        • status (string) --

          The status of the data store.

        • creationTime (datetime) --

          When the data store was created.

        • lastUpdateTime (datetime) --

          The last time the data store was updated.

    • nextToken (string) --

      The token to retrieve the next set of results, or null if there are no more results.

UpdateChannel (updated) Link ¶
Changes (request)
{'channelStorage': {'customerManagedS3': {'bucket': 'string',
                                          'keyPrefix': 'string',
                                          'roleArn': 'string'},
                    'serviceManagedS3': {}}}

Updates the settings of a channel.

See also: AWS API Documentation

Request Syntax

client.update_channel(
    channelName='string',
    channelStorage={
        'serviceManagedS3': {}
        ,
        'customerManagedS3': {
            'bucket': 'string',
            'keyPrefix': 'string',
            'roleArn': 'string'
        }
    },
    retentionPeriod={
        'unlimited': True|False,
        'numberOfDays': 123
    }
)
type channelName

string

param channelName

[REQUIRED]

The name of the channel to be updated.

type channelStorage

dict

param channelStorage

Where channel data is stored.

  • serviceManagedS3 (dict) --

    Use this to store channel data in an S3 bucket managed by the AWS IoT Analytics service.

  • customerManagedS3 (dict) --

    Use this to store channel data in an S3 bucket that you manage.

    • bucket (string) -- [REQUIRED]

      The name of the Amazon S3 bucket in which channel data is stored.

    • keyPrefix (string) --

      The prefix used to create the keys of the channel data objects. Each object in an Amazon S3 bucket has a key that is its unique identifier within the bucket (each object in a bucket has exactly one key).

    • roleArn (string) -- [REQUIRED]

      The ARN of the role which grants AWS IoT Analytics permission to interact with your Amazon S3 resources.

type retentionPeriod

dict

param retentionPeriod

How long, in days, message data is kept for the channel.

  • unlimited (boolean) --

    If true, message data is kept indefinitely.

  • numberOfDays (integer) --

    The number of days that message data is kept. The "unlimited" parameter must be false.

returns

None

UpdateDatastore (updated) Link ¶
Changes (request)
{'datastoreStorage': {'customerManagedS3': {'bucket': 'string',
                                            'keyPrefix': 'string',
                                            'roleArn': 'string'},
                      'serviceManagedS3': {}}}

Updates the settings of a data store.

See also: AWS API Documentation

Request Syntax

client.update_datastore(
    datastoreName='string',
    retentionPeriod={
        'unlimited': True|False,
        'numberOfDays': 123
    },
    datastoreStorage={
        'serviceManagedS3': {}
        ,
        'customerManagedS3': {
            'bucket': 'string',
            'keyPrefix': 'string',
            'roleArn': 'string'
        }
    }
)
type datastoreName

string

param datastoreName

[REQUIRED]

The name of the data store to be updated.

type retentionPeriod

dict

param retentionPeriod

How long, in days, message data is kept for the data store.

  • unlimited (boolean) --

    If true, message data is kept indefinitely.

  • numberOfDays (integer) --

    The number of days that message data is kept. The "unlimited" parameter must be false.

type datastoreStorage

dict

param datastoreStorage

Where data store data is stored.

  • serviceManagedS3 (dict) --

    Use this to store data store data in an S3 bucket managed by the AWS IoT Analytics service.

  • customerManagedS3 (dict) --

    Use this to store data store data in an S3 bucket that you manage.

    • bucket (string) -- [REQUIRED]

      The name of the Amazon S3 bucket in which data store data is stored.

    • keyPrefix (string) --

      The prefix used to create the keys of the data store data objects. Each object in an Amazon S3 bucket has a key that is its unique identifier within the bucket (each object in a bucket has exactly one key).

    • roleArn (string) -- [REQUIRED]

      The ARN of the role which grants AWS IoT Analytics permission to interact with your Amazon S3 resources.

returns

None