Share via


Lineage.GetLineageAsync Method

Definition

Overloads

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

Get lineage info of the entity specified by GUID.

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

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

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

Source:
Lineage.cs

Get lineage info of the entity specified by GUID.

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

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

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

This sample shows how to call GetLineageAsync 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 = await client.GetLineageAsync("<guid>", LineageDirection.Input, depth: 1234);

Applies to

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

Source:
Lineage.cs

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

public virtual System.Threading.Tasks.Task<Azure.Response> GetLineageAsync (string guid, string direction, int? depth = default, Azure.RequestContext context = default);
abstract member GetLineageAsync : string * string * Nullable<int> * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetLineageAsync : string * string * Nullable<int> * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetLineageAsync (guid As String, direction As String, Optional depth As Nullable(Of Integer) = Nothing, Optional context As RequestContext = Nothing) As Task(Of 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 GetLineageAsync 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 = await client.GetLineageAsync("<guid>", "INPUT");

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

This sample shows how to call GetLineageAsync 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 = await client.GetLineageAsync("<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