createDatasetGroup method

Future<CreateDatasetGroupResponse> createDatasetGroup({
  1. required String name,
  2. String? kmsKeyArn,
  3. String? roleArn,
})

Creates an empty dataset group. A dataset group contains related datasets that supply data for training a model. A dataset group can contain at most three datasets, one for each type of dataset:

  • Interactions
  • Items
  • Users
To train a model (create a solution), a dataset group that contains an Interactions dataset is required. Call CreateDataset to add a dataset to the group.

A dataset group can be in one of the following states:

  • CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
  • DELETE PENDING
To get the status of the dataset group, call DescribeDatasetGroup. If the status shows as CREATE FAILED, the response includes a failureReason key, which describes why the creation failed. You can specify an AWS Key Management Service (KMS) key to encrypt the datasets in the group. If you specify a KMS key, you must also include an AWS Identity and Access Management (IAM) role that has permission to access the key.

APIs that require a dataset group ARN in the request

Related APIs

May throw InvalidInputException. May throw ResourceAlreadyExistsException. May throw LimitExceededException.

Parameter name : The name for the new dataset group.

Parameter kmsKeyArn : The Amazon Resource Name (ARN) of a KMS key used to encrypt the datasets.

Parameter roleArn : The ARN of the IAM role that has permissions to access the KMS key. Supplying an IAM role is only valid when also specifying a KMS key.

Implementation

Future<CreateDatasetGroupResponse> createDatasetGroup({
  required String name,
  String? kmsKeyArn,
  String? roleArn,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    63,
    isRequired: true,
  );
  _s.validateStringLength(
    'roleArn',
    roleArn,
    0,
    256,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonPersonalize.CreateDatasetGroup'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'name': name,
      if (kmsKeyArn != null) 'kmsKeyArn': kmsKeyArn,
      if (roleArn != null) 'roleArn': roleArn,
    },
  );

  return CreateDatasetGroupResponse.fromJson(jsonResponse.body);
}