Share via


Lineage.GetLineage Method

Definition

Overloads

GetLineage(String, LineageDirection, Nullable<Int32>, CancellationToken)

Get lineage info of the entity specified by GUID.

GetLineage(String, String, Nullable<Int32>, RequestContext)

[Protocol Method] Get lineage info of the entity specified by GUID.

GetLineage(String, LineageDirection, Nullable<Int32>, CancellationToken)

Source:
Lineage.cs

Get lineage info of the entity specified by GUID.

public virtual Azure.Response<Azure.Analytics.Purview.DataMap.AtlasLineageInfo> GetLineage (string guid, Azure.Analytics.Purview.DataMap.LineageDirection direction, int? depth = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetLineage : string * Azure.Analytics.Purview.DataMap.LineageDirection * Nullable<int> * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Purview.DataMap.AtlasLineageInfo>
override this.GetLineage : string * Azure.Analytics.Purview.DataMap.LineageDirection * Nullable<int> * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Purview.DataMap.AtlasLineageInfo>
Public Overridable Function GetLineage (guid As String, direction As LineageDirection, Optional depth As Nullable(Of Integer) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of AtlasLineageInfo)

Parameters

guid
String

The globally unique identifier of the entity.

direction
LineageDirection

The direction of the lineage, which could be INPUT, OUTPUT or BOTH.

depth
Nullable<Int32>

The number of hops for lineage.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

guid is null.

guid is an empty string, and was expected to be non-empty.

Examples

This sample shows how to call GetLineage.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Lineage client = new DataMapClient(endpoint, credential).GetLineageClient();

Response<AtlasLineageInfo> response = client.GetLineage("<guid>", LineageDirection.Input);

This sample shows how to call GetLineage with all parameters.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Lineage client = new DataMapClient(endpoint, credential).GetLineageClient();

Response<AtlasLineageInfo> response = client.GetLineage("<guid>", LineageDirection.Input, depth: 1234);

Applies to

GetLineage(String, String, Nullable<Int32>, RequestContext)

Source:
Lineage.cs

[Protocol Method] Get lineage info of the entity specified by GUID.

public virtual Azure.Response GetLineage (string guid, string direction, int? depth = default, Azure.RequestContext context = default);
abstract member GetLineage : string * string * Nullable<int> * Azure.RequestContext -> Azure.Response
override this.GetLineage : string * string * Nullable<int> * Azure.RequestContext -> Azure.Response
Public Overridable Function GetLineage (guid As String, direction As String, Optional depth As Nullable(Of Integer) = Nothing, Optional context As RequestContext = Nothing) As Response

Parameters

guid
String

The globally unique identifier of the entity.

direction
String

The direction of the lineage, which could be INPUT, OUTPUT or BOTH. Allowed values: "INPUT" | "OUTPUT" | "BOTH".

depth
Nullable<Int32>

The number of hops for lineage.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The response returned from the service.

Exceptions

guid or direction is null.

guid is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

This sample shows how to call GetLineage and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Lineage client = new DataMapClient(endpoint, credential).GetLineageClient();

Response response = client.GetLineage("<guid>", "INPUT");

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());

This sample shows how to call GetLineage with all parameters and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Lineage client = new DataMapClient(endpoint, credential).GetLineageClient();

Response response = client.GetLineage("<guid>", "INPUT", depth: 1234);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("baseEntityGuid").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("attributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("lastModifiedTS").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("classificationNames")[0].ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("attributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("lastModifiedTS").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("entityGuid").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("entityStatus").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("removePropagationsOnEntityDelete").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("endTime").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("startTime").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("timeZone").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("displayText").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("guid").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("isIncomplete").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("labels")[0].ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("meaningNames")[0].ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("confidence").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("createdBy").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("displayText").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("expression").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("relationGuid").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("steward").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("termGuid").ToString());
Console.WriteLine(result.GetProperty("guidEntityMap").GetProperty("<key>").GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("widthCounts").GetProperty("<key>").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("lineageDepth").ToString());
Console.WriteLine(result.GetProperty("lineageWidth").ToString());
Console.WriteLine(result.GetProperty("childrenCount").ToString());
Console.WriteLine(result.GetProperty("lineageDirection").ToString());
Console.WriteLine(result.GetProperty("parentRelations")[0].GetProperty("childEntityId").ToString());
Console.WriteLine(result.GetProperty("parentRelations")[0].GetProperty("relationshipId").ToString());
Console.WriteLine(result.GetProperty("parentRelations")[0].GetProperty("parentEntityId").ToString());
Console.WriteLine(result.GetProperty("relations")[0].GetProperty("fromEntityId").ToString());
Console.WriteLine(result.GetProperty("relations")[0].GetProperty("relationshipId").ToString());
Console.WriteLine(result.GetProperty("relations")[0].GetProperty("toEntityId").ToString());

Applies to