create_dataset
(**kwargs)¶Used to create a dataset. A dataset stores data retrieved from a data store by applying a queryAction
(a SQL query) or a containerAction
(executing a containerized application). This operation creates the skeleton of a dataset. The dataset can be populated manually by calling CreateDatasetContent
or automatically according to a trigger you specify.
See also: AWS API Documentation
Request Syntax
response = client.create_dataset(
datasetName='string',
actions=[
{
'actionName': 'string',
'queryAction': {
'sqlQuery': 'string',
'filters': [
{
'deltaTime': {
'offsetSeconds': 123,
'timeExpression': 'string'
}
},
]
},
'containerAction': {
'image': 'string',
'executionRoleArn': 'string',
'resourceConfiguration': {
'computeType': 'ACU_1'|'ACU_2',
'volumeSizeInGB': 123
},
'variables': [
{
'name': 'string',
'stringValue': 'string',
'doubleValue': 123.0,
'datasetContentVersionValue': {
'datasetName': 'string'
},
'outputFileUriValue': {
'fileName': 'string'
}
},
]
}
},
],
triggers=[
{
'schedule': {
'expression': 'string'
},
'dataset': {
'name': 'string'
}
},
],
contentDeliveryRules=[
{
'entryName': 'string',
'destination': {
'iotEventsDestinationConfiguration': {
'inputName': 'string',
'roleArn': 'string'
},
's3DestinationConfiguration': {
'bucket': 'string',
'key': 'string',
'glueConfiguration': {
'tableName': 'string',
'databaseName': 'string'
},
'roleArn': 'string'
}
}
},
],
retentionPeriod={
'unlimited': True|False,
'numberOfDays': 123
},
versioningConfiguration={
'unlimited': True|False,
'maxVersions': 123
},
tags=[
{
'key': 'string',
'value': 'string'
},
],
lateDataRules=[
{
'ruleName': 'string',
'ruleConfiguration': {
'deltaTimeSessionWindowConfiguration': {
'timeoutInMinutes': 123
}
}
},
]
)
[REQUIRED]
The name of the dataset.
[REQUIRED]
A list of actions that create the dataset contents.
A DatasetAction
object that specifies how dataset contents are automatically created.
The name of the dataset action by which dataset contents are automatically created.
An SqlQueryDatasetAction
object that uses an SQL query to automatically create dataset contents.
A SQL query string.
Prefilters applied to message data.
Information that is used to filter message data, to segregate it according to the timeframe in which it arrives.
Used to limit data to that which has arrived since the last execution of the action.
The number of seconds of estimated in-flight lag time of message data. When you create dataset contents using message data from a specified timeframe, some message data might still be in flight when processing begins, and so do not arrive in time to be processed. Use this field to make allowances for the in flight time of your message data, so that data not processed from a previous timeframe is included with the next timeframe. Otherwise, missed message data would be excluded from processing during the next timeframe too, because its timestamp places it within the previous timeframe.
An expression by which the time of the message data might be determined. This can be the name of a timestamp field or a SQL expression that is used to derive the time the message data was generated.
Information that allows the system to run a containerized application to create the dataset contents. The application must be in a Docker container along with any required support libraries.
The ARN of the Docker container stored in your account. The Docker container contains an application and required support libraries and is used to generate dataset contents.
The ARN of the role that gives permission to the system to access required resources to run the containerAction
. This includes, at minimum, permission to retrieve the dataset contents that are the input to the containerized application.
Configuration of the resource that executes the containerAction
.
The type of the compute resource used to execute the containerAction
. Possible values are: ACU_1
(vCPU=4, memory=16 GiB) or ACU_2
(vCPU=8, memory=32 GiB).
The size, in GB, of the persistent storage available to the resource instance used to execute the containerAction
(min: 1, max: 50).
The values of variables used in the context of the execution of the containerized application (basically, parameters passed to the application). Each variable must have a name and a value given by one of stringValue
, datasetContentVersionValue
, or outputFileUriValue
.
An instance of a variable to be passed to the containerAction
execution. Each variable must have a name and a value given by one of stringValue
, datasetContentVersionValue
, or outputFileUriValue
.
The name of the variable.
The value of the variable as a string.
The value of the variable as a double (numeric).
The value of the variable as a structure that specifies a dataset content version.
The name of the dataset whose latest contents are used as input to the notebook or application.
The value of the variable as a structure that specifies an output file URI.
The URI of the location where dataset contents are stored, usually the URI of a file in an S3 bucket.
A list of triggers. A trigger causes dataset contents to be populated at a specified time interval or when another dataset's contents are created. The list of triggers can be empty or contain up to five DataSetTrigger
objects.
The DatasetTrigger
that specifies when the dataset is automatically updated.
The Schedule when the trigger is initiated.
The expression that defines when to trigger an update. For more information, see Schedule Expressions for Rules in the Amazon CloudWatch Events User Guide .
The dataset whose content creation triggers the creation of this dataset's contents.
The name of the dataset whose content generation triggers the new dataset content generation.
When dataset contents are created, they are delivered to destinations specified here.
When dataset contents are created, they are delivered to destination specified here.
The name of the dataset content delivery rules entry.
The destination to which dataset contents are delivered.
Configuration information for delivery of dataset contents to IoT Events.
The name of the IoT Events input to which dataset contents are delivered.
The ARN of the role that grants IoT Analytics permission to deliver dataset contents to an IoT Events input.
Configuration information for delivery of dataset contents to Amazon S3.
The name of the S3 bucket to which dataset contents are delivered.
The key of the dataset contents object in an S3 bucket. Each object has a key that is a unique identifier. Each object has exactly one key.
You can create a unique key with the following options:
!{iotanalytics:scheduleTime}
to insert the time of a scheduled SQL query run.!{iotanalytics:versionId}
to insert a unique hash that identifies a dataset content.!{iotanalytics:creationTime}
to insert the creation time of a dataset content.The following example creates a unique key for a CSV file: dataset/mydataset/!{iotanalytics:scheduleTime}/!{iotanalytics:versionId}.csv
Note
If you don't use !{iotanalytics:versionId}
to specify the key, you might get duplicate keys. For example, you might have two dataset contents with the same scheduleTime
but different versionId
s. This means that one dataset content overwrites the other.
Configuration information for coordination with Glue, a fully managed extract, transform and load (ETL) service.
The name of the table in your Glue Data Catalog that is used to perform the ETL operations. An Glue Data Catalog table contains partitioned data and descriptions of data sources and targets.
The name of the database in your Glue Data Catalog in which the table is located. An Glue Data Catalog database contains metadata tables.
The ARN of the role that grants IoT Analytics permission to interact with your Amazon S3 and Glue resources.
Optional. How long, in days, versions of dataset contents are kept for the dataset. If not specified or set to null
, versions of dataset contents are retained for at most 90 days. The number of versions of dataset contents retained is determined by the versioningConfiguration
parameter. For more information, see Keeping Multiple Versions of IoT Analytics datasets in the IoT Analytics User Guide .
If true, message data is kept indefinitely.
The number of days that message data is kept. The unlimited
parameter must be false.
Optional. How many versions of dataset contents are kept. If not specified or set to null, only the latest version plus the latest succeeded version (if they are different) are kept for the time period specified by the retentionPeriod
parameter. For more information, see Keeping Multiple Versions of IoT Analytics datasets in the IoT Analytics User Guide .
If true, unlimited versions of dataset contents are kept.
How many versions of dataset contents are kept. The unlimited
parameter must be false
.
Metadata which can be used to manage the dataset.
A set of key-value pairs that are used to manage the resource.
The tag's key.
The tag's value.
A list of data rules that send notifications to CloudWatch, when data arrives late. To specify lateDataRules
, the dataset must use a DeltaTimer filter.
A structure that contains the name and configuration information of a late data rule.
The name of the late data rule.
The information needed to configure the late data rule.
The information needed to configure a delta time session window.
A time interval. You can use timeoutInMinutes
so that IoT Analytics can batch up late data notifications that have been generated since the last execution. IoT Analytics sends one batch of notifications to Amazon CloudWatch Events at one time.
For more information about how to write a timestamp expression, see Date and Time Functions and Operators, in the Presto 0.172 Documentation .
dict
Response Syntax
{
'datasetName': 'string',
'datasetArn': 'string',
'retentionPeriod': {
'unlimited': True|False,
'numberOfDays': 123
}
}
Response Structure
(dict) --
datasetName (string) --
The name of the dataset.
datasetArn (string) --
The ARN of the dataset.
retentionPeriod (dict) --
How long, in days, dataset contents are kept for the dataset.
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