DatabaseMigrationService / Client / start_metadata_model_export_as_script

start_metadata_model_export_as_script

DatabaseMigrationService.Client.start_metadata_model_export_as_script(**kwargs)

Queues an export of metadata models (database objects such as tables, views, and procedures) as a data definition language (DDL) script. The script is stored as a ZIP archive in the Amazon S3 bucket associated with the migration project. If other requests created by Start* operations are already in the migration project’s queue, the export begins after they complete.

When exporting from the target metadata tree, the export applies only to metadata models created by conversion. Metadata models imported from the database are skipped.

To check the status of the export request, call DescribeMetadataModelExportsAsScript using the returned RequestIdentifier as a filter.

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

See also: AWS API Documentation

Request Syntax

response = client.start_metadata_model_export_as_script(
    MigrationProjectIdentifier='string',
    SelectionRules='string',
    Origin='SOURCE'|'TARGET',
    FileName='string'
)
Parameters:
  • MigrationProjectIdentifier (string) –

    [REQUIRED]

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

  • SelectionRules (string) –

    [REQUIRED]

    A JSON string that identifies the metadata models to export as a SQL script. 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.

  • Origin (string) –

    [REQUIRED]

    Specifies the metadata tree to export from.

  • FileName (string) – The name for the exported file. When you omit this parameter, the service generates a name from the data provider engine name and an export timestamp.

Return type:

dict

Returns:

Response Syntax

{
    'RequestIdentifier': 'string'
}

Response Structure

  • (dict) –

    • RequestIdentifier (string) –

      The identifier for the export request.

Exceptions

  • DatabaseMigrationService.Client.exceptions.AccessDeniedFault

  • DatabaseMigrationService.Client.exceptions.InvalidResourceStateFault

  • DatabaseMigrationService.Client.exceptions.ResourceAlreadyExistsFault

  • DatabaseMigrationService.Client.exceptions.ResourceNotFoundFault

  • DatabaseMigrationService.Client.exceptions.KMSKeyNotAccessibleFault

  • DatabaseMigrationService.Client.exceptions.ResourceQuotaExceededFault

  • DatabaseMigrationService.Client.exceptions.S3ResourceNotFoundFault

  • DatabaseMigrationService.Client.exceptions.S3AccessDeniedFault