Entity.BatchGetByUniqueAttributesAsync Method

Definition

Overloads

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

[Protocol Method] Bulk API to retrieve list of entities identified by its unique attributes. In addition to the typeName path parameter, attribute key-value pair(s) can be provided in the following format

typeName=&lt;typeName>&attr_1:&lt;attrName>=&lt;attrValue>&attr_2:&lt;attrName>=&lt;attrValue>&attr_3:&lt;attrName>=&lt;attrValue>

NOTE: The attrName should be an unique attribute for the given entity-type. The REST request would look something like this

GET /v2/entity/bulk/uniqueAttribute/type/hive_db?attr_1:qualifiedName=db1@cl1&attr_2:qualifiedName=db2@cl1

Note: at least one unique attribute must be provided.

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

Bulk API to retrieve list of entities identified by its unique attributes. In addition to the typeName path parameter, attribute key-value pair(s) can be provided in the following format

typeName=&lt;typeName>&attr_1:&lt;attrName>=&lt;attrValue>&attr_2:&lt;attrName>=&lt;attrValue>&attr_3:&lt;attrName>=&lt;attrValue>

NOTE: The attrName should be an unique attribute for the given entity-type. The REST request would look something like this

GET /v2/entity/bulk/uniqueAttribute/type/hive_db?attr_1:qualifiedName=db1@cl1&attr_2:qualifiedName=db2@cl1

Note: at least one unique attribute must be provided.

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

Source:
Entity.cs

[Protocol Method] Bulk API to retrieve list of entities identified by its unique attributes. In addition to the typeName path parameter, attribute key-value pair(s) can be provided in the following format

typeName=&lt;typeName>&attr_1:&lt;attrName>=&lt;attrValue>&attr_2:&lt;attrName>=&lt;attrValue>&attr_3:&lt;attrName>=&lt;attrValue>

NOTE: The attrName should be an unique attribute for the given entity-type. The REST request would look something like this

GET /v2/entity/bulk/uniqueAttribute/type/hive_db?attr_1:qualifiedName=db1@cl1&attr_2:qualifiedName=db2@cl1

Note: at least one unique attribute must be provided.

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

attrNQualifiedName
String

Qualified name of an entity. E.g. to find 2 entities you can set attrs_1:qualifiedName=db1@cl1&attrs_2:qualifiedName=db2@cl1. (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 BatchGetByUniqueAttributesAsync 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.BatchGetByUniqueAttributesAsync("<typeName>", null, null, null, null);

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

This sample shows how to call BatchGetByUniqueAttributesAsync 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.BatchGetByUniqueAttributesAsync("<typeName>", true, true, "<attr_N:qualifiedName>", 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("entities")[0].GetProperty("attributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("lastModifiedTS").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("businessAttributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("classifications")[0].GetProperty("attributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("classifications")[0].GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("classifications")[0].GetProperty("lastModifiedTS").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("classifications")[0].GetProperty("entityGuid").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("classifications")[0].GetProperty("entityStatus").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("classifications")[0].GetProperty("removePropagationsOnEntityDelete").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("endTime").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("startTime").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("timeZone").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("createTime").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("createdBy").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("customAttributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("guid").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("homeId").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("collectionId").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("isIncomplete").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("labels")[0].ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("meanings")[0].GetProperty("confidence").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("meanings")[0].GetProperty("createdBy").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("meanings")[0].GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("meanings")[0].GetProperty("displayText").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("meanings")[0].GetProperty("expression").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("meanings")[0].GetProperty("relationGuid").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("meanings")[0].GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("meanings")[0].GetProperty("steward").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("meanings")[0].GetProperty("termGuid").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("provenanceType").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("proxy").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("relationshipAttributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("updateTime").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("updatedBy").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("version").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("contacts").GetProperty("<key>")[0].GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("entities")[0].GetProperty("contacts").GetProperty("<key>")[0].GetProperty("info").ToString());

Applies to

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

Source:
Entity.cs

Bulk API to retrieve list of entities identified by its unique attributes. In addition to the typeName path parameter, attribute key-value pair(s) can be provided in the following format

typeName=&lt;typeName>&attr_1:&lt;attrName>=&lt;attrValue>&attr_2:&lt;attrName>=&lt;attrValue>&attr_3:&lt;attrName>=&lt;attrValue>

NOTE: The attrName should be an unique attribute for the given entity-type. The REST request would look something like this

GET /v2/entity/bulk/uniqueAttribute/type/hive_db?attr_1:qualifiedName=db1@cl1&attr_2:qualifiedName=db2@cl1

Note: at least one unique attribute must be provided.

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

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.

attrNQualifiedName
String

Qualified name of an entity. E.g. to find 2 entities you can set attrs_1:qualifiedName=db1@cl1&attrs_2:qualifiedName=db2@cl1. (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 BatchGetByUniqueAttributesAsync.

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

Response<AtlasEntitiesWithExtInfo> response = await client.BatchGetByUniqueAttributesAsync("<typeName>");

This sample shows how to call BatchGetByUniqueAttributesAsync with all parameters.

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

Response<AtlasEntitiesWithExtInfo> response = await client.BatchGetByUniqueAttributesAsync("<typeName>", minExtInfo: true, ignoreRelationships: true, attrNQualifiedName: "<attr_N:qualifiedName>");

Applies to