Partilhar via


Entity.GetHeaderAsync Method

Definition

Overloads

GetHeaderAsync(String, RequestContext)

[Protocol Method] Get entity header given its GUID.

GetHeaderAsync(String, CancellationToken)

Get entity header given its GUID.

GetHeaderAsync(String, RequestContext)

Source:
Entity.cs

[Protocol Method] Get entity header given its GUID.

public virtual System.Threading.Tasks.Task<Azure.Response> GetHeaderAsync (string guid, Azure.RequestContext context);
abstract member GetHeaderAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetHeaderAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetHeaderAsync (guid As String, context As RequestContext) As Task(Of Response)

Parameters

guid
String

The globally unique identifier of the entity.

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 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 GetHeaderAsync and parse the result.

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

Response response = await client.GetHeaderAsync("<guid>", null);

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

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

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

Response response = await client.GetHeaderAsync("<guid>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("attributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("lastModifiedTS").ToString());
Console.WriteLine(result.GetProperty("classificationNames")[0].ToString());
Console.WriteLine(result.GetProperty("classifications")[0].GetProperty("attributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("classifications")[0].GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("classifications")[0].GetProperty("lastModifiedTS").ToString());
Console.WriteLine(result.GetProperty("classifications")[0].GetProperty("entityGuid").ToString());
Console.WriteLine(result.GetProperty("classifications")[0].GetProperty("entityStatus").ToString());
Console.WriteLine(result.GetProperty("classifications")[0].GetProperty("removePropagationsOnEntityDelete").ToString());
Console.WriteLine(result.GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("endTime").ToString());
Console.WriteLine(result.GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("startTime").ToString());
Console.WriteLine(result.GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("timeZone").ToString());
Console.WriteLine(result.GetProperty("displayText").ToString());
Console.WriteLine(result.GetProperty("guid").ToString());
Console.WriteLine(result.GetProperty("isIncomplete").ToString());
Console.WriteLine(result.GetProperty("labels")[0].ToString());
Console.WriteLine(result.GetProperty("meaningNames")[0].ToString());
Console.WriteLine(result.GetProperty("meanings")[0].GetProperty("confidence").ToString());
Console.WriteLine(result.GetProperty("meanings")[0].GetProperty("createdBy").ToString());
Console.WriteLine(result.GetProperty("meanings")[0].GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("meanings")[0].GetProperty("displayText").ToString());
Console.WriteLine(result.GetProperty("meanings")[0].GetProperty("expression").ToString());
Console.WriteLine(result.GetProperty("meanings")[0].GetProperty("relationGuid").ToString());
Console.WriteLine(result.GetProperty("meanings")[0].GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("meanings")[0].GetProperty("steward").ToString());
Console.WriteLine(result.GetProperty("meanings")[0].GetProperty("termGuid").ToString());
Console.WriteLine(result.GetProperty("status").ToString());

Applies to

GetHeaderAsync(String, CancellationToken)

Source:
Entity.cs

Get entity header given its GUID.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.AtlasEntityHeader>> GetHeaderAsync (string guid, System.Threading.CancellationToken cancellationToken = default);
abstract member GetHeaderAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.AtlasEntityHeader>>
override this.GetHeaderAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.AtlasEntityHeader>>
Public Overridable Function GetHeaderAsync (guid As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of AtlasEntityHeader))

Parameters

guid
String

The globally unique identifier of the entity.

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 GetHeaderAsync.

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

Response<AtlasEntityHeader> response = await client.GetHeaderAsync("<guid>");

This sample shows how to call GetHeaderAsync with all parameters.

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

Response<AtlasEntityHeader> response = await client.GetHeaderAsync("<guid>");

Applies to