Entity.UpdateByUniqueAttribute Method

Definition

Overloads

UpdateByUniqueAttribute(String, AtlasEntityWithExtInfo, String, CancellationToken)

Update entity partially - Allow a subset of attributes to be updated on an entity which is identified by its type and unique attribute eg: Referenceable.qualifiedName. Null updates are not possible.

In addition to the typeName path parameter, attribute key-value pair(s) can be provided in the following format:

attr:<attrName>=<attrValue>. NOTE: The attrName and attrValue should be unique across entities, eg. qualifiedName.

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

UpdateByUniqueAttribute(String, RequestContent, String, RequestContext)

[Protocol Method] Update entity partially - Allow a subset of attributes to be updated on an entity which is identified by its type and unique attribute eg: Referenceable.qualifiedName. Null updates are not possible.

In addition to the typeName path parameter, attribute key-value pair(s) can be provided in the following format:

attr:<attrName>=<attrValue>. NOTE: The attrName and attrValue should be unique across entities, eg. qualifiedName.

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

UpdateByUniqueAttribute(String, AtlasEntityWithExtInfo, String, CancellationToken)

Source:
Entity.cs

Update entity partially - Allow a subset of attributes to be updated on an entity which is identified by its type and unique attribute eg: Referenceable.qualifiedName. Null updates are not possible.

In addition to the typeName path parameter, attribute key-value pair(s) can be provided in the following format:

attr:<attrName>=<attrValue>. NOTE: The attrName and attrValue should be unique across entities, eg. qualifiedName.

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

public virtual Azure.Response<Azure.Analytics.Purview.DataMap.EntityMutationResult> UpdateByUniqueAttribute (string typeName, Azure.Analytics.Purview.DataMap.AtlasEntityWithExtInfo atlasEntityWithExtInfo, string attribute = default, System.Threading.CancellationToken cancellationToken = default);
abstract member UpdateByUniqueAttribute : string * Azure.Analytics.Purview.DataMap.AtlasEntityWithExtInfo * string * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Purview.DataMap.EntityMutationResult>
override this.UpdateByUniqueAttribute : string * Azure.Analytics.Purview.DataMap.AtlasEntityWithExtInfo * string * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Purview.DataMap.EntityMutationResult>
Public Overridable Function UpdateByUniqueAttribute (typeName As String, atlasEntityWithExtInfo As AtlasEntityWithExtInfo, Optional attribute As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of EntityMutationResult)

Parameters

typeName
String

The name of the type.

atlasEntityWithExtInfo
AtlasEntityWithExtInfo

An instance of an entity along with extended info - like hive_table, hive_database.

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 or atlasEntityWithExtInfo is null.

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

Examples

This sample shows how to call UpdateByUniqueAttribute.

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

AtlasEntityWithExtInfo atlasEntityWithExtInfo = new AtlasEntityWithExtInfo();
Response<EntityMutationResult> response = client.UpdateByUniqueAttribute("<typeName>", atlasEntityWithExtInfo);

This sample shows how to call UpdateByUniqueAttribute with all parameters.

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

AtlasEntityWithExtInfo atlasEntityWithExtInfo = new AtlasEntityWithExtInfo
{
    ReferredEntities =
    {
        ["key"] = new AtlasEntity
        {
            Attributes =
            {
                ["key"] = BinaryData.FromObjectAsJson(new object())
            },
            TypeName = "<typeName>",
            LastModifiedTS = "<lastModifiedTS>",
            BusinessAttributes =
            {
                ["key"] = BinaryData.FromObjectAsJson(new object())
            },
            Classifications = {new AtlasClassification
            {
                Attributes =
                {
                    ["key"] = BinaryData.FromObjectAsJson(new object())
                },
                TypeName = "<typeName>",
                LastModifiedTS = "<lastModifiedTS>",
                EntityGuid = "<entityGuid>",
                EntityStatus = EntityStatus.Active,
                RemovePropagationsOnEntityDelete = true,
                ValidityPeriods = {new TimeBoundary
                {
                    EndTime = "<endTime>",
                    StartTime = "<startTime>",
                    TimeZone = "<timeZone>",
                }},
            }},
            CreateTime = 1234L,
            CreatedBy = "<createdBy>",
            CustomAttributes =
            {
                ["key"] = "<customAttributes>"
            },
            Guid = "<guid>",
            HomeId = "<homeId>",
            IsIncomplete = true,
            Labels = {"<labels>"},
            Meanings = {new AtlasTermAssignmentHeader
            {
                Confidence = 1234,
                CreatedBy = "<createdBy>",
                Description = "<description>",
                DisplayText = "<displayText>",
                Expression = "<expression>",
                RelationGuid = Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"),
                Status = AtlasTermAssignmentStatus.Discovered,
                Steward = "<steward>",
                TermGuid = Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"),
            }},
            ProvenanceType = 1234,
            Proxy = true,
            RelationshipAttributes =
            {
                ["key"] = BinaryData.FromObjectAsJson(new object())
            },
            Status = EntityStatus.Active,
            UpdateTime = 1234L,
            UpdatedBy = "<updatedBy>",
            Version = 1234L,
            Contacts =
            {
                ["key"] = {new ContactInfo
                {
                    Id = "<id>",
                    Info = "<info>",
                }}
            },
        }
    },
    Entity = default,
};
Response<EntityMutationResult> response = client.UpdateByUniqueAttribute("<typeName>", atlasEntityWithExtInfo, attribute: "<attribute>");

Applies to

UpdateByUniqueAttribute(String, RequestContent, String, RequestContext)

Source:
Entity.cs

[Protocol Method] Update entity partially - Allow a subset of attributes to be updated on an entity which is identified by its type and unique attribute eg: Referenceable.qualifiedName. Null updates are not possible.

In addition to the typeName path parameter, attribute key-value pair(s) can be provided in the following format:

attr:<attrName>=<attrValue>. NOTE: The attrName and attrValue should be unique across entities, eg. qualifiedName.

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

public virtual Azure.Response UpdateByUniqueAttribute (string typeName, Azure.Core.RequestContent content, string attribute = default, Azure.RequestContext context = default);
abstract member UpdateByUniqueAttribute : string * Azure.Core.RequestContent * string * Azure.RequestContext -> Azure.Response
override this.UpdateByUniqueAttribute : string * Azure.Core.RequestContent * string * Azure.RequestContext -> Azure.Response
Public Overridable Function UpdateByUniqueAttribute (typeName As String, content As RequestContent, Optional attribute As String = Nothing, Optional context As RequestContext = Nothing) As Response

Parameters

typeName
String

The name of the type.

content
RequestContent

The content to send as the body of the request.

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 or content 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 UpdateByUniqueAttribute and parse the result.

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

using RequestContent content = RequestContent.Create(new object());
Response response = client.UpdateByUniqueAttribute("<typeName>", content);

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

This sample shows how to call UpdateByUniqueAttribute with all parameters and request content and parse the result.

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

using RequestContent content = RequestContent.Create(new
{
    referredEntities = new
    {
        key = new
        {
            attributes = new
            {
                key = new object(),
            },
            typeName = "<typeName>",
            lastModifiedTS = "<lastModifiedTS>",
            businessAttributes = new
            {
                key = new object(),
            },
            classifications = new object[]
            {
                new
                {
                    attributes = new
                    {
                        key = new object(),
                    },
                    typeName = "<typeName>",
                    lastModifiedTS = "<lastModifiedTS>",
                    entityGuid = "<entityGuid>",
                    entityStatus = "ACTIVE",
                    removePropagationsOnEntityDelete = true,
                    validityPeriods = new object[]
                    {
                        new
                        {
                            endTime = "<endTime>",
                            startTime = "<startTime>",
                            timeZone = "<timeZone>",
                        }
                    },
                }
            },
            createTime = 1234L,
            createdBy = "<createdBy>",
            customAttributes = new
            {
                key = "<customAttributes>",
            },
            guid = "<guid>",
            homeId = "<homeId>",
            isIncomplete = true,
            labels = new object[]
            {
                "<labels>"
            },
            meanings = new object[]
            {
                new
                {
                    confidence = 1234,
                    createdBy = "<createdBy>",
                    description = "<description>",
                    displayText = "<displayText>",
                    expression = "<expression>",
                    relationGuid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a",
                    status = "DISCOVERED",
                    steward = "<steward>",
                    termGuid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a",
                }
            },
            provenanceType = 1234,
            proxy = true,
            relationshipAttributes = new
            {
                key = new object(),
            },
            status = "ACTIVE",
            updateTime = 1234L,
            updatedBy = "<updatedBy>",
            version = 1234L,
            contacts = new
            {
                key = new object[]
                {
                    new
                    {
                        id = "<id>",
                        info = "<info>",
                    }
                },
            },
        },
    },
});
Response response = client.UpdateByUniqueAttribute("<typeName>", content, attribute: "<attribute>");

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("guidAssignments").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("attributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("lastModifiedTS").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("classificationNames")[0].ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("classifications")[0].GetProperty("attributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("classifications")[0].GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("classifications")[0].GetProperty("lastModifiedTS").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("classifications")[0].GetProperty("entityGuid").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("classifications")[0].GetProperty("entityStatus").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("classifications")[0].GetProperty("removePropagationsOnEntityDelete").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("endTime").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("startTime").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("timeZone").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("displayText").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("guid").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("isIncomplete").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("labels")[0].ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("meaningNames")[0].ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("meanings")[0].GetProperty("confidence").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("meanings")[0].GetProperty("createdBy").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("meanings")[0].GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("meanings")[0].GetProperty("displayText").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("meanings")[0].GetProperty("expression").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("meanings")[0].GetProperty("relationGuid").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("meanings")[0].GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("meanings")[0].GetProperty("steward").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("meanings")[0].GetProperty("termGuid").ToString());
Console.WriteLine(result.GetProperty("mutatedEntities").GetProperty("<key>")[0].GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("attributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("lastModifiedTS").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("classificationNames")[0].ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("classifications")[0].GetProperty("attributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("classifications")[0].GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("classifications")[0].GetProperty("lastModifiedTS").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("classifications")[0].GetProperty("entityGuid").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("classifications")[0].GetProperty("entityStatus").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("classifications")[0].GetProperty("removePropagationsOnEntityDelete").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("endTime").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("startTime").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("timeZone").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("displayText").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("guid").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("isIncomplete").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("labels")[0].ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("meaningNames")[0].ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("meanings")[0].GetProperty("confidence").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("meanings")[0].GetProperty("createdBy").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("meanings")[0].GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("meanings")[0].GetProperty("displayText").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("meanings")[0].GetProperty("expression").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("meanings")[0].GetProperty("relationGuid").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("meanings")[0].GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("meanings")[0].GetProperty("steward").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("meanings")[0].GetProperty("termGuid").ToString());
Console.WriteLine(result.GetProperty("partialUpdatedEntities")[0].GetProperty("status").ToString());

Applies to