Partilhar via


Entity.GetByUniqueAttribute Method

Definition

Overloads

GetByUniqueAttribute(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.

GetByUniqueAttribute(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.

GetByUniqueAttribute(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 Azure.Response GetByUniqueAttribute (string typeName, bool? minExtInfo, bool? ignoreRelationships, string attribute, Azure.RequestContext context);
abstract member GetByUniqueAttribute : string * Nullable<bool> * Nullable<bool> * string * Azure.RequestContext -> Azure.Response
override this.GetByUniqueAttribute : string * Nullable<bool> * Nullable<bool> * string * Azure.RequestContext -> Azure.Response
Public Overridable Function GetByUniqueAttribute (typeName As String, minExtInfo As Nullable(Of Boolean), ignoreRelationships As Nullable(Of Boolean), attribute As String, context As RequestContext) As 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 GetByUniqueAttribute 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.GetByUniqueAttribute("<typeName>", null, null, null, null);

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

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

GetByUniqueAttribute(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 Azure.Response<Azure.Analytics.Purview.DataMap.AtlasEntityWithExtInfo> GetByUniqueAttribute (string typeName, bool? minExtInfo = default, bool? ignoreRelationships = default, string attribute = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetByUniqueAttribute : string * Nullable<bool> * Nullable<bool> * string * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Purview.DataMap.AtlasEntityWithExtInfo>
override this.GetByUniqueAttribute : string * Nullable<bool> * Nullable<bool> * string * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Purview.DataMap.AtlasEntityWithExtInfo>
Public Overridable Function GetByUniqueAttribute (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 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 GetByUniqueAttribute.

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

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

This sample shows how to call GetByUniqueAttribute 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 = client.GetByUniqueAttribute("<typeName>", minExtInfo: true, ignoreRelationships: true, attribute: "<attribute>");

Applies to