Gets detailed information about the specified metadata model, including its definition and corresponding converted objects in the target database if applicable.
Required permissions: dms:DescribeMetadataModel. For more information, see Actions, resources, and condition keys for Database Migration Service.
Parameters:
-
selection_rules
(String)
–
A JSON string that identifies the metadata model to retrieve. 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 only explicit rule actions.
-
Exactly one rule is allowed.
-
migration_project_identifier
(MigrationProjectIdentifier)
–
The migration project name or Amazon Resource Name (ARN).
-
origin
(OriginTypeValue)
–
Specifies whether to retrieve metadata from the source or target tree. Valid values: SOURCE | TARGET
Raises:
Examples:
Retrieve a source table metadata model
The following example retrieves detailed information about the ExampleTable table in the ExampleSchema schema from the source metadata tree, including its SQL definition and references to the corresponding converted metadata models in the target database.
>>> await client.describe_metadata_model(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", "table-name": "ExampleTable"}, "rule-action": "explicit"}]}', origin='SOURCE')
Source code in docs_src/capo_database_migration_service/_services/async_database_migration_service.py
| async def describe_metadata_model(
self,
selection_rules: "capo_database_migration_service.types.string.String",
migration_project_identifier: "capo_database_migration_service.types.migration_project_identifier.MigrationProjectIdentifier",
origin: "capo_database_migration_service.types.origin_type_value.OriginTypeValue",
*,
config_overrides: Optional[AsyncDatabaseMigrationServiceClientConfig] = None,
) -> "capo_database_migration_service.types.describe_metadata_model_response.DescribeMetadataModelResponse":
"""<p>Gets detailed information about the specified metadata model, including its definition and corresponding converted objects in the target database if applicable.</p> <p> <b>Required permissions:</b> <code>dms:DescribeMetadataModel</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:
selection_rules: <p>A JSON string that identifies the metadata model to retrieve. 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 source or target selection rules depending on the <code>Origin</code> parameter. The <code>server-name</code> in the object locator must match the corresponding data provider.</p> </li> <li> <p>Supports only <code>explicit</code> rule actions.</p> </li> <li> <p>Exactly one rule is allowed.</p> </li> </ul>
migration_project_identifier: <p>The migration project name or Amazon Resource Name (ARN).</p>
origin: <p>Specifies whether to retrieve metadata from the source or target tree. Valid values: SOURCE | TARGET</p>
Raises:
capo_database_migration_service.errors.access_denied_fault.AccessDeniedFault: <p>DMS was denied access to the endpoint. Check that the role is correctly configured.</p>
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:
Retrieve a source table metadata model
The following example retrieves detailed information about the ExampleTable table in the ExampleSchema schema from the source metadata tree, including its SQL definition and references to the corresponding converted metadata models in the target database.
>>> await client.describe_metadata_model(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", "table-name": "ExampleTable"}, "rule-action": "explicit"}]}', origin='SOURCE')
"""
async def _handler(
req: "AsyncOperationRequest[capo_database_migration_service.types.describe_metadata_model_message.DescribeMetadataModelMessage]",
) -> AsyncOperationResponse[
"capo_database_migration_service.types.describe_metadata_model_response.DescribeMetadataModelResponse"
]:
import capo_database_migration_service._operations.amazon_dm_sv20160101.describe_metadata_model
(
output,
http_response,
) = await capo_database_migration_service._operations.amazon_dm_sv20160101.describe_metadata_model.async_describe_metadata_model(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DescribeMetadataModel")
)
input_: capo_database_migration_service.types.describe_metadata_model_message.DescribeMetadataModelMessage = {
"selection_rules": selection_rules,
"migration_project_identifier": migration_project_identifier,
"origin": origin,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|