次の方法で共有


Entity.GetHeader Method

Definition

Overloads

GetHeader(String, RequestContext)

[Protocol Method] Get entity header given its GUID.

GetHeader(String, CancellationToken)

Get entity header given its GUID.

GetHeader(String, RequestContext)

Source:
Entity.cs

[Protocol Method] Get entity header given its GUID.

public virtual Azure.Response GetHeader (string guid, Azure.RequestContext context);
abstract member GetHeader : string * Azure.RequestContext -> Azure.Response
override this.GetHeader : string * Azure.RequestContext -> Azure.Response
Public Overridable Function GetHeader (guid As String, context As RequestContext) As 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 GetHeader 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 = client.GetHeader("<guid>", null);

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

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

GetHeader(String, CancellationToken)

Source:
Entity.cs

Get entity header given its GUID.

public virtual Azure.Response<Azure.Analytics.Purview.DataMap.AtlasEntityHeader> GetHeader (string guid, System.Threading.CancellationToken cancellationToken = default);
abstract member GetHeader : string * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Purview.DataMap.AtlasEntityHeader>
override this.GetHeader : string * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Purview.DataMap.AtlasEntityHeader>
Public Overridable Function GetHeader (guid As String, Optional cancellationToken As CancellationToken = Nothing) As 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 GetHeader.

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

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

This sample shows how to call GetHeader 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 = client.GetHeader("<guid>");

Applies to