Saves a copy of a database migration assessment report to your Amazon S3 bucket. DMS can save your assessment report as a comma-separated value (CSV) or a PDF file.
Required permissions: dms:ExportMetadataModelAssessment. 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 a conversion assessment report for. 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.
-
file_name
(Optional[String], default:
None
)
–
The name of the assessment file to create in your Amazon S3 bucket.
-
assessment_report_types
(Optional[AssessmentReportTypesList], default:
None
)
–
The file format of the assessment file.
Raises:
Examples:
Export a conversion assessment report
The following example exports a conversion assessment report for all objects in the ExampleSchema schema.
>>> client.export_metadata_model_assessment(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-source-server.us-east-1.rds.amazonaws.com", "schema-name": "ExampleSchema"}, "rule-action": "explicit"}]}', file_name='example-assessment-report', assessment_report_types=['pdf', 'csv'])
Source code in docs_src/capo_database_migration_service/_services/database_migration_service.py
| def export_metadata_model_assessment(
self,
migration_project_identifier: "capo_database_migration_service.types.migration_project_identifier.MigrationProjectIdentifier",
selection_rules: "capo_database_migration_service.types.string.String",
*,
config_overrides: Optional[DatabaseMigrationServiceClientConfig] = None,
file_name: Optional[
"capo_database_migration_service.types.string.String"
] = None,
assessment_report_types: Optional[
"capo_database_migration_service.types.assessment_report_types_list.AssessmentReportTypesList"
] = None,
) -> "capo_database_migration_service.types.export_metadata_model_assessment_response.ExportMetadataModelAssessmentResponse":
"""<p>Saves a copy of a database migration assessment report to your Amazon S3 bucket. DMS can save your assessment report as a comma-separated value (CSV) or a PDF file. </p> <p> <b>Required permissions:</b> <code>dms:ExportMetadataModelAssessment</code>. For more information, see <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsdatabasemigrationservice.html">Actions, resources, and condition keys for Database Migration Service</a>.</p>
Args:
migration_project_identifier: <p>The migration project name or Amazon Resource Name (ARN).</p>
selection_rules: <p>A JSON string that identifies the metadata models to export a conversion assessment report for. For the selection rule format and examples, see <a href="https://docs.aws.amazon.com/dms/latest/userguide/sc-selection-rules.html">Selection rules in DMS Schema Conversion</a>.</p> <p>Usage:</p> <ul> <li> <p>Accepts only source selection rules, where <code>server-name</code> in the object locator matches the source data provider.</p> </li> <li> <p>Supports only <code>explicit</code> rule actions.</p> </li> </ul>
file_name: <p>The name of the assessment file to create in your Amazon S3 bucket.</p>
assessment_report_types: <p>The file format of the assessment file.</p>
Raises:
capo_database_migration_service.errors.resource_not_found_fault.ResourceNotFoundFault: <p>The resource could not be found.</p>
capo_database_migration_service.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
Export a conversion assessment report
The following example exports a conversion assessment report for all objects in the ExampleSchema schema.
>>> client.export_metadata_model_assessment(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-source-server.us-east-1.rds.amazonaws.com", "schema-name": "ExampleSchema"}, "rule-action": "explicit"}]}', file_name='example-assessment-report', assessment_report_types=['pdf', 'csv'])
"""
def _handler(
req: "OperationRequest[capo_database_migration_service.types.export_metadata_model_assessment_message.ExportMetadataModelAssessmentMessage]",
) -> OperationResponse[
"capo_database_migration_service.types.export_metadata_model_assessment_response.ExportMetadataModelAssessmentResponse"
]:
import capo_database_migration_service._operations.amazon_dm_sv20160101.export_metadata_model_assessment
output, http_response = (
capo_database_migration_service._operations.amazon_dm_sv20160101.export_metadata_model_assessment.export_metadata_model_assessment(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ExportMetadataModelAssessment")
)
input_: capo_database_migration_service.types.export_metadata_model_assessment_message.ExportMetadataModelAssessmentMessage = {
"migration_project_identifier": migration_project_identifier,
"selection_rules": selection_rules,
}
if file_name is not None:
input_["file_name"] = file_name
if assessment_report_types is not None:
input_["assessment_report_types"] = assessment_report_types
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|