start_metadata_model_export_as_script
async
¶
start_metadata_model_export_as_script(
migration_project_identifier: MigrationProjectIdentifier,
selection_rules: String,
origin: OriginTypeValue,
*,
config_overrides: Optional[AsyncDatabaseMigrationServiceClientConfig] = None,
file_name: Optional[String] = None,
) -> StartMetadataModelExportAsScriptResponse
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.
Parameters:
-
migration_project_identifier(MigrationProjectIdentifier) –The migration project name or Amazon Resource Name (ARN).
-
selection_rules(String) –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
Originparameter. Theserver-namein the object locator must match the corresponding data provider. -
Supports
explicit,include, andexcluderule actions.
-
-
origin(OriginTypeValue) –Specifies the metadata tree to export from.
-
file_name(Optional[String], default:None) –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.
Raises:
-
AccessDeniedFault–DMS was denied access to the endpoint. Check that the role is correctly configured.
-
InvalidResourceStateFault–The resource is in a state that prevents it from being used for database migration.
-
KMSKeyNotAccessibleFault–DMS cannot access the KMS key.
-
ResourceAlreadyExistsFault–The resource you are attempting to create already exists.
-
ResourceNotFoundFault–The resource could not be found.
-
ResourceQuotaExceededFault–The quota for this resource quota has been exceeded.
-
S3AccessDeniedFault–Insufficient privileges are preventing access to an Amazon S3 object.
-
S3ResourceNotFoundFault–A specified Amazon S3 bucket, bucket folder, or other object can't be found.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Export converted metadata models as DDL scripts The following example queues an export of converted metadata models for all objects in the ExampleSchema schema as data definition language (DDL) scripts to the S3 bucket associated with the migration project.
>>> await client.start_metadata_model_export_as_script(migration_project_identifier='arn:aws:dms:us-east-1:111122223333:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS', selection_rules='{"rules": [{"rule-type": "selection","rule-id": "1","rule-name": "1","object-locator": {"server-name": "example-target-server.us-east-1.rds.amazonaws.com", "schema-name": "ExampleSchema"},"rule-action": "explicit"}]}', origin='TARGET', file_name='ExampleScript')
Source code in docs_src/capo_database_migration_service/_services/async_database_migration_service.py
9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 | |