startMetadataModelConversion method

Future<StartMetadataModelConversionResponse> startMetadataModelConversion({
  1. required String migrationProjectIdentifier,
  2. required String selectionRules,
})

Queues a conversion of the selected source metadata models (database objects such as tables, views, and procedures) to the target database format. If other requests created by Start* operations are already in the migration project's queue, the conversion begins after they complete.

The conversion request loads metadata models that are not yet in the metadata tree, but does not reload metadata models that are already present. If your source database has changed since the metadata was loaded, refresh the affected metadata models with StartMetadataModelImport before calling this operation. To check the status of the conversion request, call DescribeMetadataModelConversions using the returned RequestIdentifier as a filter.

To cancel a queued or in-progress request, call CancelMetadataModelConversion with the returned RequestIdentifier.

After the conversion completes successfully:

Required permissions: dms:StartMetadataModelConversion. 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 selectionRules : A JSON string that identifies the metadata models to convert. 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 explicit, include, and exclude rule actions.

Implementation

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

  return StartMetadataModelConversionResponse.fromJson(jsonResponse.body);
}