create_channel

IoTAnalytics.Client.create_channel(**kwargs)

Used to create 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

response = 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'
        },
    ]
)
Parameters
  • channelName (string) --

    [REQUIRED]

    The name of the channel.

  • channelStorage (dict) --

    Where channel data is stored. You can choose one of serviceManagedS3 or customerManagedS3 storage. If not specified, the default is serviceManagedS3 . You can't change this storage option after the channel is created.

    • serviceManagedS3 (dict) --

      Used to store channel data in an S3 bucket managed by IoT Analytics. You can't change the choice of S3 storage after the data store is created.

    • customerManagedS3 (dict) --

      Used to store channel data in an S3 bucket that you manage. If customer managed storage is selected, the retentionPeriod parameter is ignored. You can't change the choice of S3 storage after the data store is created.

      • bucket (string) -- [REQUIRED]

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

      • keyPrefix (string) --

        (Optional) The prefix used to create the keys of the channel data objects. Each object in an S3 bucket has a key that is its unique identifier in the bucket. Each object in a bucket has exactly one key. The prefix must end with a forward slash (/).

      • roleArn (string) -- [REQUIRED]

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

  • retentionPeriod (dict) --

    How long, in days, message data is kept for the channel. When customerManagedS3 storage is selected, this parameter is ignored.

    • 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.

  • tags (list) --

    Metadata which can be used to manage the channel.

    • (dict) --

      A set of key-value pairs that are used to manage the resource.

      • key (string) -- [REQUIRED]

        The tag's key.

      • value (string) -- [REQUIRED]

        The tag's value.

Return type

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.

Exceptions

  • IoTAnalytics.Client.exceptions.InvalidRequestException
  • IoTAnalytics.Client.exceptions.ResourceAlreadyExistsException
  • IoTAnalytics.Client.exceptions.InternalFailureException
  • IoTAnalytics.Client.exceptions.ServiceUnavailableException
  • IoTAnalytics.Client.exceptions.ThrottlingException
  • IoTAnalytics.Client.exceptions.LimitExceededException