createDataset method

Future<CreateDatasetResponse> createDataset({
  1. required List<DatasetAction> actions,
  2. required String datasetName,
  3. List<DatasetContentDeliveryRule>? contentDeliveryRules,
  4. List<LateDataRule>? lateDataRules,
  5. RetentionPeriod? retentionPeriod,
  6. List<Tag>? tags,
  7. List<DatasetTrigger>? triggers,
  8. VersioningConfiguration? versioningConfiguration,
})

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

May throw InvalidRequestException. May throw ResourceAlreadyExistsException. May throw InternalFailureException. May throw ServiceUnavailableException. May throw ThrottlingException. May throw LimitExceededException.

Parameter actions : A list of actions that create the data set contents.

Parameter datasetName : The name of the data set.

Parameter contentDeliveryRules : When dataset contents are created, they are delivered to destinations specified here.

Parameter lateDataRules : A list of data rules that send notifications to Amazon CloudWatch, when data arrives late. To specify lateDataRules, the dataset must use a DeltaTimer filter.

Parameter retentionPeriod : 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 AWS IoT Analytics Data Sets in the AWS IoT Analytics User Guide.

Parameter tags : Metadata which can be used to manage the data set.

Parameter triggers : A list of triggers. A trigger causes data set contents to be populated at a specified time interval or when another data set's contents are created. The list of triggers can be empty or contain up to five DataSetTrigger objects.

Parameter versioningConfiguration : 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 AWS IoT Analytics Data Sets in the AWS IoT Analytics User Guide.

Implementation

Future<CreateDatasetResponse> createDataset({
  required List<DatasetAction> actions,
  required String datasetName,
  List<DatasetContentDeliveryRule>? contentDeliveryRules,
  List<LateDataRule>? lateDataRules,
  RetentionPeriod? retentionPeriod,
  List<Tag>? tags,
  List<DatasetTrigger>? triggers,
  VersioningConfiguration? versioningConfiguration,
}) async {
  ArgumentError.checkNotNull(actions, 'actions');
  ArgumentError.checkNotNull(datasetName, 'datasetName');
  _s.validateStringLength(
    'datasetName',
    datasetName,
    1,
    128,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'actions': actions,
    'datasetName': datasetName,
    if (contentDeliveryRules != null)
      'contentDeliveryRules': contentDeliveryRules,
    if (lateDataRules != null) 'lateDataRules': lateDataRules,
    if (retentionPeriod != null) 'retentionPeriod': retentionPeriod,
    if (tags != null) 'tags': tags,
    if (triggers != null) 'triggers': triggers,
    if (versioningConfiguration != null)
      'versioningConfiguration': versioningConfiguration,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/datasets',
    exceptionFnMap: _exceptionFns,
  );
  return CreateDatasetResponse.fromJson(response);
}