DescribeMetadataModel - AWS Database Migration Service

DescribeMetadataModel

Gets detailed information about the specified metadata model, including its definition and corresponding converted objects in the target database if applicable.

Request Syntax

{ "MigrationProjectIdentifier": "string", "Origin": "string", "SelectionRules": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

MigrationProjectIdentifier

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

Type: String

Length Constraints: Maximum length of 255.

Required: Yes

Origin

Specifies whether to retrieve metadata from the source or target tree. Valid values: SOURCE | TARGET

Type: String

Valid Values: SOURCE | TARGET

Required: Yes

SelectionRules

The JSON string that specifies which metadata model to retrieve. Only one selection rule with "rule-action": "explicit" can be provided. For more information, see Selection Rules in the DMS User Guide.

Type: String

Required: Yes

Response Syntax

{ "Definition": "string", "MetadataModelName": "string", "MetadataModelType": "string", "TargetMetadataModels": [ { "MetadataModelName": "string", "SelectionRules": "string" } ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

Definition

The SQL text of the metadata model. This field might not be populated for some metadata models.

Type: String

MetadataModelName

The name of the metadata model.

Type: String

MetadataModelType

The type of the metadata model.

Type: String

TargetMetadataModels

A list of counterpart metadata models in the target. This field is populated only when Origin is SOURCE and after the object has been converted by DMS Schema Conversion.

Type: Array of MetadataModelReference objects

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedFault

AWS DMS was denied access to the endpoint. Check that the role is correctly configured.

message

HTTP Status Code: 400

ResourceNotFoundFault

The resource could not be found.

message

HTTP Status Code: 400

Examples

Sample Request

This example illustrates retrieval of information about a specified metadata model. The provided selection rule specifies which metadata model to retrieve, while the origin parameter determines whether to fetch from the source or target database. The response includes definition and corresponding converted metadata models in the target database.

POST / HTTP/1.1 Host: dms.<region>.<domain> Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<SignedHeaders>, Signature=<Signature> X-Amz-Date: <Date> X-Amz-Target: AmazonDMSv20160101.DescribeMetadataModel { "MigrationProjectIdentifier": "arn:aws:dms:us-east-1:012345678901:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS", "SelectionRules": "{\"rules\": [{\"rule-type\": \"selection\", \"rule-id\": \"1\", \"rule-name\": \"1\", \"object-locator\": {\"server-name\": \"source-database-server.us-east-1.rds.amazonaws.com\", \"database-name\": \"database1\", \"schema-name\": \"schema1\", \"table-name\": \"Table1\"}, \"rule-action\": \"explicit\"} ]}", "Origin": "SOURCE" }

Sample Response

This example illustrates one usage of DescribeMetadataModel.

HTTP/1.1 200 OK x-amzn-RequestId: <RequestId> Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes> Date: <Date> { "MetadataModelName": "Table1", "MetadataModelType": "table", "TargetMetadataModels": [ { "MetadataModelName": "table1", "SelectionRules": "{\"rules\": [{\"rule-type\": \"selection\", \"rule-id\": \"1\", \"rule-name\": \"1\", \"object-locator\": {\"server-name\": \"target-database-server.us-east-1.rds.amazonaws.com\", \"schema-name\": \"database1_schema1\", \"table-name\": \"table1\"}, \"rule-action\": \"explicit\"} ]}" } ], "Definition": "CREATE TABLE schema1.Table1 (Column1 int, Column2 int);" }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: