次の方法で共有


Entity.GetByUniqueAttributeAsync Method

Definition

Overloads

GetByUniqueAttributeAsync(String, Nullable<Boolean>, Nullable<Boolean>, String, CancellationToken)

Get complete definition of an entity given its type and unique attribute.

In addition to the typeName path parameter, attribute key-value pair(s) can be provided in the following format: attr:&lt;attrName>=<attrValue>.

NOTE: The attrName and attrValue should be unique across entities, eg. qualifiedName.

The REST request would look something like this: GET /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue.

GetByUniqueAttributeAsync(String, Nullable<Boolean>, Nullable<Boolean>, String, RequestContext)

[Protocol Method] Get complete definition of an entity given its type and unique attribute.

In addition to the typeName path parameter, attribute key-value pair(s) can be provided in the following format: attr:&lt;attrName>=<attrValue>.

NOTE: The attrName and attrValue should be unique across entities, eg. qualifiedName.

The REST request would look something like this: GET /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue.

GetByUniqueAttributeAsync(String, Nullable<Boolean>, Nullable<Boolean>, String, CancellationToken)

Source:
Entity.cs

Get complete definition of an entity given its type and unique attribute.

In addition to the typeName path parameter, attribute key-value pair(s) can be provided in the following format: attr:&lt;attrName>=<attrValue>.

NOTE: The attrName and attrValue should be unique across entities, eg. qualifiedName.

The REST request would look something like this: GET /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.AtlasEntityWithExtInfo>> GetByUniqueAttributeAsync (string typeName, bool? minExtInfo = default, bool? ignoreRelationships = default, string attribute = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetByUniqueAttributeAsync : string * Nullable<bool> * Nullable<bool> * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.AtlasEntityWithExtInfo>>
override this.GetByUniqueAttributeAsync : string * Nullable<bool> * Nullable<bool> * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.AtlasEntityWithExtInfo>>
Public Overridable Function GetByUniqueAttributeAsync (typeName As String, Optional minExtInfo As Nullable(Of Boolean) = Nothing, Optional ignoreRelationships As Nullable(Of Boolean) = Nothing, Optional attribute As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of AtlasEntityWithExtInfo))

Parameters

typeName
String

The name of the type.

minExtInfo
Nullable<Boolean>

Whether to return minimal information for referred entities.

ignoreRelationships
Nullable<Boolean>

Whether to ignore relationship attributes.

attribute
String

The qualified name of the entity. (This is only an example. qualifiedName can be changed to other unique attributes)

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

typeName is null.

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

Examples

This sample shows how to call GetByUniqueAttributeAsync.

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

Response<AtlasEntityWithExtInfo> response = await client.GetByUniqueAttributeAsync("<typeName>");

This sample shows how to call GetByUniqueAttributeAsync with all parameters.

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

Response<AtlasEntityWithExtInfo> response = await client.GetByUniqueAttributeAsync("<typeName>", minExtInfo: true, ignoreRelationships: true, attribute: "<attribute>");

Applies to

GetByUniqueAttributeAsync(String, Nullable<Boolean>, Nullable<Boolean>, String, RequestContext)

Source:
Entity.cs

[Protocol Method] Get complete definition of an entity given its type and unique attribute.

In addition to the typeName path parameter, attribute key-value pair(s) can be provided in the following format: attr:&lt;attrName>=<attrValue>.

NOTE: The attrName and attrValue should be unique across entities, eg. qualifiedName.

The REST request would look something like this: GET /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue.

public virtual System.Threading.Tasks.Task<Azure.Response> GetByUniqueAttributeAsync (string typeName, bool? minExtInfo, bool? ignoreRelationships, string attribute, Azure.RequestContext context);
abstract member GetByUniqueAttributeAsync : string * Nullable<bool> * Nullable<bool> * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetByUniqueAttributeAsync : string * Nullable<bool> * Nullable<bool> * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetByUniqueAttributeAsync (typeName As String, minExtInfo As Nullable(Of Boolean), ignoreRelationships As Nullable(Of Boolean), attribute As String, context As RequestContext) As Task(Of Response)

Parameters

typeName
String

The name of the type.

minExtInfo
Nullable<Boolean>

Whether to return minimal information for referred entities.

ignoreRelationships
Nullable<Boolean>

Whether to ignore relationship attributes.

attribute
String

The qualified name of the entity. (This is only an example. qualifiedName can be changed to other unique attributes)

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

typeName is null.

typeName 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 GetByUniqueAttributeAsync 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.GetByUniqueAttributeAsync("<typeName>", null, null, null, null);

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

This sample shows how to call GetByUniqueAttributeAsync 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.GetByUniqueAttributeAsync("<typeName>", true, true, "<attribute>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("attributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("lastModifiedTS").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("businessAttributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("attributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("lastModifiedTS").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("entityGuid").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("entityStatus").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("removePropagationsOnEntityDelete").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("endTime").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("startTime").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("timeZone").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("createTime").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("createdBy").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("customAttributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("guid").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("homeId").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("collectionId").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("isIncomplete").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("labels")[0].ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("confidence").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("createdBy").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("displayText").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("expression").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("relationGuid").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("steward").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("termGuid").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("provenanceType").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("proxy").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("relationshipAttributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("updateTime").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("updatedBy").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("version").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("contacts").GetProperty("<key>")[0].GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("contacts").GetProperty("<key>")[0].GetProperty("info").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("attributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("lastModifiedTS").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("businessAttributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("classifications")[0].GetProperty("attributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("classifications")[0].GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("classifications")[0].GetProperty("lastModifiedTS").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("classifications")[0].GetProperty("entityGuid").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("classifications")[0].GetProperty("entityStatus").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("classifications")[0].GetProperty("removePropagationsOnEntityDelete").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("endTime").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("startTime").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("timeZone").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("createTime").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("createdBy").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("customAttributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("guid").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("homeId").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("collectionId").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("isIncomplete").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("labels")[0].ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("meanings")[0].GetProperty("confidence").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("meanings")[0].GetProperty("createdBy").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("meanings")[0].GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("meanings")[0].GetProperty("displayText").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("meanings")[0].GetProperty("expression").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("meanings")[0].GetProperty("relationGuid").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("meanings")[0].GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("meanings")[0].GetProperty("steward").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("meanings")[0].GetProperty("termGuid").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("provenanceType").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("proxy").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("relationshipAttributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("updateTime").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("updatedBy").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("version").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("contacts").GetProperty("<key>")[0].GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("entity").GetProperty("contacts").GetProperty("<key>")[0].GetProperty("info").ToString());

Applies to