Partilhar via


Entity.GetByIds Method

Definition

Overloads

GetByIds(IEnumerable<String>, Nullable<Boolean>, Nullable<Boolean>, RequestContext)

[Protocol Method] List entities in bulk identified by its GUIDs.

GetByIds(IEnumerable<String>, Nullable<Boolean>, Nullable<Boolean>, CancellationToken)

List entities in bulk identified by its GUIDs.

GetByIds(IEnumerable<String>, Nullable<Boolean>, Nullable<Boolean>, RequestContext)

Source:
Entity.cs

[Protocol Method] List entities in bulk identified by its GUIDs.

public virtual Azure.Response GetByIds (System.Collections.Generic.IEnumerable<string> guid, bool? minExtInfo, bool? ignoreRelationships, Azure.RequestContext context);
abstract member GetByIds : seq<string> * Nullable<bool> * Nullable<bool> * Azure.RequestContext -> Azure.Response
override this.GetByIds : seq<string> * Nullable<bool> * Nullable<bool> * Azure.RequestContext -> Azure.Response
Public Overridable Function GetByIds (guid As IEnumerable(Of String), minExtInfo As Nullable(Of Boolean), ignoreRelationships As Nullable(Of Boolean), context As RequestContext) As Response

Parameters

guid
IEnumerable<String>

An array of GUIDs of entities to list.

minExtInfo
Nullable<Boolean>

Whether to return minimal information for referred entities.

ignoreRelationships
Nullable<Boolean>

Whether to ignore relationship 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

guid is null.

Service returned a non-success status code.

Examples

This sample shows how to call GetByIds 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.GetByIds(new string[] { "<guid>" }, null, null, null);

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

This sample shows how to call GetByIds 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(apiVersion: "2023-09-01");

Response response = client.GetByIds(new string[] { "<guid>" }, true, true, 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

GetByIds(IEnumerable<String>, Nullable<Boolean>, Nullable<Boolean>, CancellationToken)

Source:
Entity.cs

List entities in bulk identified by its GUIDs.

public virtual Azure.Response<Azure.Analytics.Purview.DataMap.AtlasEntitiesWithExtInfo> GetByIds (System.Collections.Generic.IEnumerable<string> guid, bool? minExtInfo = default, bool? ignoreRelationships = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetByIds : seq<string> * Nullable<bool> * Nullable<bool> * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Purview.DataMap.AtlasEntitiesWithExtInfo>
override this.GetByIds : seq<string> * Nullable<bool> * Nullable<bool> * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Purview.DataMap.AtlasEntitiesWithExtInfo>
Public Overridable Function GetByIds (guid As IEnumerable(Of String), Optional minExtInfo As Nullable(Of Boolean) = Nothing, Optional ignoreRelationships As Nullable(Of Boolean) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of AtlasEntitiesWithExtInfo)

Parameters

guid
IEnumerable<String>

An array of GUIDs of entities to list.

minExtInfo
Nullable<Boolean>

Whether to return minimal information for referred entities.

ignoreRelationships
Nullable<Boolean>

Whether to ignore relationship attributes.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

guid is null.

Examples

This sample shows how to call GetByIds.

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

Response<AtlasEntitiesWithExtInfo> response = client.GetByIds(new string[] { "<guid>" });

This sample shows how to call GetByIds with all parameters.

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

Response<AtlasEntitiesWithExtInfo> response = client.GetByIds(new string[] { "<guid>" }, minExtInfo: true, ignoreRelationships: true);

Applies to