startMetadataModelImport method

Future<StartMetadataModelImportResponse> startMetadataModelImport({
  1. required String migrationProjectIdentifier,
  2. required OriginTypeValue origin,
  3. required String selectionRules,
  4. bool? refresh,
})

Queues an import of metadata models (database objects such as tables, views, and procedures) from your data provider into the metadata tree. If other requests created by Start* operations are already in the migration project's queue, the import begins after they complete.

To check the status of the import request, call DescribeMetadataModelImports using the returned RequestIdentifier as a filter.

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

May throw AccessDeniedFault. May throw InvalidResourceStateFault. May throw KMSKeyNotAccessibleFault. May throw ResourceAlreadyExistsFault. May throw ResourceNotFoundFault. May throw ResourceQuotaExceededFault. May throw S3AccessDeniedFault. May throw S3ResourceNotFoundFault.

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

Parameter origin : Specifies the metadata tree to import into.

Parameter selectionRules : A JSON string that identifies the metadata models to import from the data provider. For the selection rule format and examples, see Selection rules in DMS Schema Conversion.

Usage:

  • Accepts source or target selection rules depending on the Origin parameter. The server-name in the object locator must match the corresponding data provider.
  • Supports explicit, include, and exclude rule actions.

Parameter refresh : Specifies whether to refresh the selected metadata models from the data provider.

When true, the import reloads the selected metadata models with current definitions and removes their existing subtree.

When false (default), the import loads the full subtree that has not yet been loaded into the metadata tree.

Implementation

Future<StartMetadataModelImportResponse> startMetadataModelImport({
  required String migrationProjectIdentifier,
  required OriginTypeValue origin,
  required String selectionRules,
  bool? refresh,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonDMSv20160101.StartMetadataModelImport'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'MigrationProjectIdentifier': migrationProjectIdentifier,
      'Origin': origin.value,
      'SelectionRules': selectionRules,
      if (refresh != null) 'Refresh': refresh,
    },
  );

  return StartMetadataModelImportResponse.fromJson(jsonResponse.body);
}