Skip to content

describe_metadata_model_children

describe_metadata_model_children(
    selection_rules: String,
    migration_project_identifier: MigrationProjectIdentifier,
    origin: OriginTypeValue,
    *,
    config_overrides: Optional[DatabaseMigrationServiceClientConfig] = None,
    marker: Optional[String] = None,
    max_records: Optional[IntegerOptional] = None,
) -> DescribeMetadataModelChildrenResponse

Gets a list of child metadata models for the specified metadata model in the database hierarchy.

Required permissions: dms:DescribeMetadataModelChildren. 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 whose children 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

  • marker (Optional[String], default: None ) –

    Specifies the unique pagination token that indicates where the next page should start. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.

  • max_records (Optional[IntegerOptional], default: None ) –

    The maximum number of metadata model children to include in the response. If more items exist than the specified MaxRecords value, a marker is included in the response so that the remaining results can be retrieved.

Raises:

Examples:

Retrieve children of a schema The following example retrieves the child metadata models of the ExampleSchema schema from the source metadata tree.

>>> client.describe_metadata_model_children(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"}]}', origin='SOURCE')
Source code in docs_src/capo_database_migration_service/_services/database_migration_service.py
def describe_metadata_model_children(
    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[DatabaseMigrationServiceClientConfig] = None,
    marker: Optional["capo_database_migration_service.types.string.String"] = None,
    max_records: Optional[
        "capo_database_migration_service.types.integer_optional.IntegerOptional"
    ] = None,
) -> "capo_database_migration_service.types.describe_metadata_model_children_response.DescribeMetadataModelChildrenResponse":
    """<p>Gets a list of child metadata models for the specified metadata model in the database hierarchy.</p> <p> <b>Required permissions:</b> <code>dms:DescribeMetadataModelChildren</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 whose children 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>
        marker: <p>Specifies the unique pagination token that indicates where the next page should start. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.</p>
        max_records: <p>The maximum number of metadata model children to include in the response. If more items exist than the specified MaxRecords value, a marker is included in the response so that the remaining results can be retrieved.</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 children of a schema
        The following example retrieves the child metadata models of the ExampleSchema schema from the source metadata tree.

        >>> client.describe_metadata_model_children(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"}]}', origin='SOURCE')
    """

    def _handler(
        req: "OperationRequest[capo_database_migration_service.types.describe_metadata_model_children_message.DescribeMetadataModelChildrenMessage]",
    ) -> OperationResponse[
        "capo_database_migration_service.types.describe_metadata_model_children_response.DescribeMetadataModelChildrenResponse"
    ]:
        import capo_database_migration_service._operations.amazon_dm_sv20160101.describe_metadata_model_children

        output, http_response = (
            capo_database_migration_service._operations.amazon_dm_sv20160101.describe_metadata_model_children.describe_metadata_model_children(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeMetadataModelChildren")
    )
    input_: capo_database_migration_service.types.describe_metadata_model_children_message.DescribeMetadataModelChildrenMessage = {
        "selection_rules": selection_rules,
        "migration_project_identifier": migration_project_identifier,
        "origin": origin,
    }
    if marker is not None:
        input_["marker"] = marker
    if max_records is not None:
        input_["max_records"] = max_records

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output