Share via


Glossary.AssignTermToEntities Method

Definition

Overloads

AssignTermToEntities(String, RequestContent, RequestContext)

[Protocol Method] Assign the given term to the provided list of related objects. Recommend using small batches with multiple API calls.

Entities Create Or Update operation is an alternative to assign a term to multiple entities.

AssignTermToEntities(String, IEnumerable<AtlasRelatedObjectId>, CancellationToken)

Assign the given term to the provided list of related objects. Recommend using small batches with multiple API calls.

Entities Create Or Update operation is an alternative to assign a term to multiple entities.

AssignTermToEntities(String, RequestContent, RequestContext)

Source:
Glossary.cs

[Protocol Method] Assign the given term to the provided list of related objects. Recommend using small batches with multiple API calls.

Entities Create Or Update operation is an alternative to assign a term to multiple entities.

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

Parameters

termId
String

The globally unique identifier for glossary term.

content
RequestContent

The content to send as the body of the request.

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

termId or content is null.

termId 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 AssignTermToEntities.

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

using RequestContent content = RequestContent.Create(new object[]
{
    new object()
});
Response response = client.AssignTermToEntities("<termId>", content);

Console.WriteLine(response.Status);

This sample shows how to call AssignTermToEntities with all parameters and request content.

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

using RequestContent content = RequestContent.Create(new object[]
{
    new
    {
        guid = "<guid>",
        typeName = "<typeName>",
        uniqueAttributes = new
        {
            key = new object(),
        },
        displayText = "<displayText>",
        entityStatus = "ACTIVE",
        relationshipType = "<relationshipType>",
        relationshipAttributes = new
        {
            attributes = new
            {
                key = new object(),
            },
            typeName = "<typeName>",
            lastModifiedTS = "<lastModifiedTS>",
        },
        relationshipGuid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a",
        relationshipStatus = "ACTIVE",
    }
});
Response response = client.AssignTermToEntities("<termId>", content);

Console.WriteLine(response.Status);

Applies to

AssignTermToEntities(String, IEnumerable<AtlasRelatedObjectId>, CancellationToken)

Source:
Glossary.cs

Assign the given term to the provided list of related objects. Recommend using small batches with multiple API calls.

Entities Create Or Update operation is an alternative to assign a term to multiple entities.

public virtual Azure.Response AssignTermToEntities (string termId, System.Collections.Generic.IEnumerable<Azure.Analytics.Purview.DataMap.AtlasRelatedObjectId> body, System.Threading.CancellationToken cancellationToken = default);
abstract member AssignTermToEntities : string * seq<Azure.Analytics.Purview.DataMap.AtlasRelatedObjectId> * System.Threading.CancellationToken -> Azure.Response
override this.AssignTermToEntities : string * seq<Azure.Analytics.Purview.DataMap.AtlasRelatedObjectId> * System.Threading.CancellationToken -> Azure.Response
Public Overridable Function AssignTermToEntities (termId As String, body As IEnumerable(Of AtlasRelatedObjectId), Optional cancellationToken As CancellationToken = Nothing) As Response

Parameters

termId
String

The globally unique identifier for glossary term.

body
IEnumerable<AtlasRelatedObjectId>

An array of related object IDs to which the term has to be associated.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

termId or body is null.

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

Examples

This sample shows how to call AssignTermToEntities.

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

Response response = client.AssignTermToEntities("<termId>", new AtlasRelatedObjectId[]
{
    new AtlasRelatedObjectId()
});

This sample shows how to call AssignTermToEntities with all parameters.

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

Response response = client.AssignTermToEntities("<termId>", new AtlasRelatedObjectId[]
{
    new AtlasRelatedObjectId
    {
        Guid = "<guid>",
        TypeName = "<typeName>",
        UniqueAttributes =
        {
            ["key"] = BinaryData.FromObjectAsJson(new object())
        },
        DisplayText = "<displayText>",
        EntityStatus = EntityStatus.Active,
        RelationshipType = "<relationshipType>",
        RelationshipAttributes = new AtlasStruct
        {
            Attributes =
            {
                ["key"] = BinaryData.FromObjectAsJson(new object())
            },
            TypeName = "<typeName>",
            LastModifiedTS = "<lastModifiedTS>",
        },
        RelationshipGuid = Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"),
        RelationshipStatus = StatusAtlasRelationship.Active,
    }
});

Applies to