create_stream

create_stream(**kwargs)

Creates a stream for delivering one or more large files in chunks over MQTT. A stream transports data bytes in chunks or blocks packaged as MQTT messages from a source like S3. You can have one or more files associated with a stream.

Requires permission to access the CreateStream action.

See also: AWS API Documentation

Request Syntax

response = client.create_stream(
    streamId='string',
    description='string',
    files=[
        {
            'fileId': 123,
            's3Location': {
                'bucket': 'string',
                'key': 'string',
                'version': 'string'
            }
        },
    ],
    roleArn='string',
    tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
Parameters
  • streamId (string) --

    [REQUIRED]

    The stream ID.

  • description (string) -- A description of the stream.
  • files (list) --

    [REQUIRED]

    The files to stream.

    • (dict) --

      Represents a file to stream.

      • fileId (integer) --

        The file ID.

      • s3Location (dict) --

        The location of the file in S3.

        • bucket (string) --

          The S3 bucket.

        • key (string) --

          The S3 key.

        • version (string) --

          The S3 bucket version.

  • roleArn (string) --

    [REQUIRED]

    An IAM role that allows the IoT service principal to access your S3 files.

  • tags (list) --

    Metadata which can be used to manage streams.

    • (dict) --

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

      • Key (string) -- [REQUIRED]

        The tag's key.

      • Value (string) --

        The tag's value.

Return type

dict

Returns

Response Syntax

{
    'streamId': 'string',
    'streamArn': 'string',
    'description': 'string',
    'streamVersion': 123
}

Response Structure

  • (dict) --

    • streamId (string) --

      The stream ID.

    • streamArn (string) --

      The stream ARN.

    • description (string) --

      A description of the stream.

    • streamVersion (integer) --

      The version of the stream.

Exceptions

  • IoT.Client.exceptions.InvalidRequestException
  • IoT.Client.exceptions.LimitExceededException
  • IoT.Client.exceptions.ResourceNotFoundException
  • IoT.Client.exceptions.ResourceAlreadyExistsException
  • IoT.Client.exceptions.ThrottlingException
  • IoT.Client.exceptions.UnauthorizedException
  • IoT.Client.exceptions.ServiceUnavailableException
  • IoT.Client.exceptions.InternalFailureException