SageMaker / Client / query_lineage

query_lineage#

SageMaker.Client.query_lineage(**kwargs)#

Use this action to inspect your lineage and discover relationships between entities. For more information, see Querying Lineage Entities in the Amazon SageMaker Developer Guide.

See also: AWS API Documentation

Request Syntax

response = client.query_lineage(
    StartArns=[
        'string',
    ],
    Direction='Both'|'Ascendants'|'Descendants',
    IncludeEdges=True|False,
    Filters={
        'Types': [
            'string',
        ],
        'LineageTypes': [
            'TrialComponent'|'Artifact'|'Context'|'Action',
        ],
        'CreatedBefore': datetime(2015, 1, 1),
        'CreatedAfter': datetime(2015, 1, 1),
        'ModifiedBefore': datetime(2015, 1, 1),
        'ModifiedAfter': datetime(2015, 1, 1),
        'Properties': {
            'string': 'string'
        }
    },
    MaxDepth=123,
    MaxResults=123,
    NextToken='string'
)
Parameters:
  • StartArns (list) –

    A list of resource Amazon Resource Name (ARN) that represent the starting point for your lineage query.

    • (string) –

  • Direction (string) – Associations between lineage entities have a direction. This parameter determines the direction from the StartArn(s) that the query traverses.

  • IncludeEdges (boolean) – Setting this value to True retrieves not only the entities of interest but also the Associations and lineage entities on the path. Set to False to only return lineage entities that match your query.

  • Filters (dict) –

    A set of filtering parameters that allow you to specify which entities should be returned.

    • Properties - Key-value pairs to match on the lineage entities’ properties.

    • LineageTypes - A set of lineage entity types to match on. For example: TrialComponent, Artifact, or Context.

    • CreatedBefore - Filter entities created before this date.

    • ModifiedBefore - Filter entities modified before this date.

    • ModifiedAfter - Filter entities modified after this date.

    • Types (list) –

      Filter the lineage entities connected to the StartArn by type. For example: DataSet, Model, Endpoint, or ModelDeployment.

      • (string) –

    • LineageTypes (list) –

      Filter the lineage entities connected to the ``StartArn``(s) by the type of the lineage entity.

      • (string) –

    • CreatedBefore (datetime) –

      Filter the lineage entities connected to the ``StartArn``(s) by created date.

    • CreatedAfter (datetime) –

      Filter the lineage entities connected to the ``StartArn``(s) after the create date.

    • ModifiedBefore (datetime) –

      Filter the lineage entities connected to the ``StartArn``(s) before the last modified date.

    • ModifiedAfter (datetime) –

      Filter the lineage entities connected to the ``StartArn``(s) after the last modified date.

    • Properties (dict) –

      Filter the lineage entities connected to the ``StartArn``(s) by a set if property key value pairs. If multiple pairs are provided, an entity is included in the results if it matches any of the provided pairs.

      • (string) –

        • (string) –

  • MaxDepth (integer) – The maximum depth in lineage relationships from the StartArns that are traversed. Depth is a measure of the number of Associations from the StartArn entity to the matched results.

  • MaxResults (integer) – Limits the number of vertices in the results. Use the NextToken in a response to to retrieve the next page of results.

  • NextToken (string) – Limits the number of vertices in the request. Use the NextToken in a response to to retrieve the next page of results.

Return type:

dict

Returns:

Response Syntax

{
    'Vertices': [
        {
            'Arn': 'string',
            'Type': 'string',
            'LineageType': 'TrialComponent'|'Artifact'|'Context'|'Action'
        },
    ],
    'Edges': [
        {
            'SourceArn': 'string',
            'DestinationArn': 'string',
            'AssociationType': 'ContributedTo'|'AssociatedWith'|'DerivedFrom'|'Produced'|'SameAs'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • Vertices (list) –

      A list of vertices connected to the start entity(ies) in the lineage graph.

      • (dict) –

        A lineage entity connected to the starting entity(ies).

        • Arn (string) –

          The Amazon Resource Name (ARN) of the lineage entity resource.

        • Type (string) –

          The type of the lineage entity resource. For example: DataSet, Model, Endpoint, etc…

        • LineageType (string) –

          The type of resource of the lineage entity.

    • Edges (list) –

      A list of edges that connect vertices in the response.

      • (dict) –

        A directed edge connecting two lineage entities.

        • SourceArn (string) –

          The Amazon Resource Name (ARN) of the source lineage entity of the directed edge.

        • DestinationArn (string) –

          The Amazon Resource Name (ARN) of the destination lineage entity of the directed edge.

        • AssociationType (string) –

          The type of the Association(Edge) between the source and destination. For example ContributedTo, Produced, or DerivedFrom.

    • NextToken (string) –

      Limits the number of vertices in the response. Use the NextToken in a response to to retrieve the next page of results.

Exceptions