startMetadataModelCreation method

Future<StartMetadataModelCreationResponse> startMetadataModelCreation({
  1. required String metadataModelName,
  2. required String migrationProjectIdentifier,
  3. required MetadataModelProperties properties,
  4. required String selectionRules,
})

Queues the creation of a metadata model in the source metadata tree. If other requests created by Start* operations are already in the migration project's queue, the creation begins after they complete. To check the status of the creation request, call DescribeMetadataModelCreations using the returned RequestIdentifier as a filter.

To cancel a queued or in-progress request, call CancelMetadataModelCreation with the returned RequestIdentifier. After the creation completes successfully:

Required permissions: dms:StartMetadataModelCreation. For more information, see Actions, resources, and condition keys for Database Migration Service.

May throw AccessDeniedFault. May throw ResourceAlreadyExistsFault. May throw ResourceNotFoundFault. May throw ResourceQuotaExceededFault.

Parameter metadataModelName : The name for the metadata model to use in subsequent operations.

Parameter migrationProjectIdentifier : The migration project name or Amazon Resource Name (ARN).

Parameter properties : The properties of the metadata model.

Parameter selectionRules : A JSON string that identifies the source schema for the metadata model. For the selection rule format and examples, see Selection rules in DMS Schema Conversion.

Usage:

  • Accepts only source selection rules, where server-name in the object locator matches the source data provider.
  • Supports only explicit rule actions.
  • Exactly one rule is allowed.

Implementation

Future<StartMetadataModelCreationResponse> startMetadataModelCreation({
  required String metadataModelName,
  required String migrationProjectIdentifier,
  required MetadataModelProperties properties,
  required String selectionRules,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonDMSv20160101.StartMetadataModelCreation'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'MetadataModelName': metadataModelName,
      'MigrationProjectIdentifier': migrationProjectIdentifier,
      'Properties': properties,
      'SelectionRules': selectionRules,
    },
  );

  return StartMetadataModelCreationResponse.fromJson(jsonResponse.body);
}