Glossary.CreateTerms Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| CreateTerms(RequestContent, Nullable<Boolean>, RequestContext) |
[Protocol Method] Create glossary terms in bulk.
|
| CreateTerms(IEnumerable<AtlasGlossaryTerm>, Nullable<Boolean>, CancellationToken) |
Create glossary terms in bulk. |
CreateTerms(RequestContent, Nullable<Boolean>, RequestContext)
- Source:
- Glossary.cs
[Protocol Method] Create glossary terms in bulk.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler CreateTerms(IEnumerable<AtlasGlossaryTerm>, Nullable<Boolean>, CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.Response CreateTerms(Azure.Core.RequestContent content, bool? includeTermHierarchy = default, Azure.RequestContext context = default);
abstract member CreateTerms : Azure.Core.RequestContent * Nullable<bool> * Azure.RequestContext -> Azure.Response
override this.CreateTerms : Azure.Core.RequestContent * Nullable<bool> * Azure.RequestContext -> Azure.Response
Public Overridable Function CreateTerms (content As RequestContent, Optional includeTermHierarchy As Nullable(Of Boolean) = Nothing, Optional context As RequestContext = Nothing) As Response
Parameters
- 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
content is null.
Service returned a non-success status code.
Examples
This sample shows how to call CreateTerms and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Glossary client = new DataMapClient(endpoint, credential).GetGlossaryClient();
using RequestContent content = RequestContent.Create(new object[]
{
new
{
anchor = new
{
glossaryGuid = "c018ddaf-7c21-4b37-a838-dae5f110c3d8",
},
name = "ExampleTerm2",
status = "Approved",
shortDescription = "Example Short Description",
longDescription = "Example Long Description",
abbreviation = "T2",
resources = new object[]
{
new
{
displayName = "Example Display Name",
url = "Example Url",
}
},
},
new
{
anchor = new
{
glossaryGuid = "c018ddaf-7c21-4b37-a838-dae5f110c3d8",
},
name = "ExampleTerm3",
status = "Approved",
shortDescription = "Example Short Description",
longDescription = "Example Long Description",
abbreviation = "T3",
resources = new object[]
{
new
{
displayName = "Example Display Name",
url = "Example Url",
}
},
}
});
Response response = client.CreateTerms(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result[0].ToString());
Applies to
CreateTerms(IEnumerable<AtlasGlossaryTerm>, Nullable<Boolean>, CancellationToken)
- Source:
- Glossary.cs
Create glossary terms in bulk.
public virtual Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Analytics.Purview.DataMap.AtlasGlossaryTerm>> CreateTerms(System.Collections.Generic.IEnumerable<Azure.Analytics.Purview.DataMap.AtlasGlossaryTerm> body, bool? includeTermHierarchy = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateTerms : seq<Azure.Analytics.Purview.DataMap.AtlasGlossaryTerm> * Nullable<bool> * System.Threading.CancellationToken -> Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Analytics.Purview.DataMap.AtlasGlossaryTerm>>
override this.CreateTerms : seq<Azure.Analytics.Purview.DataMap.AtlasGlossaryTerm> * Nullable<bool> * System.Threading.CancellationToken -> Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Analytics.Purview.DataMap.AtlasGlossaryTerm>>
Public Overridable Function CreateTerms (body As IEnumerable(Of AtlasGlossaryTerm), Optional includeTermHierarchy As Nullable(Of Boolean) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of IReadOnlyList(Of AtlasGlossaryTerm))
Parameters
- body
- IEnumerable<AtlasGlossaryTerm>
An array of glossary term definitions to be created in bulk.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
body is null.
Examples
This sample shows how to call CreateTerms.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Glossary client = new DataMapClient(endpoint, credential).GetGlossaryClient();
Response<IReadOnlyList<AtlasGlossaryTerm>> response = client.CreateTerms(new AtlasGlossaryTerm[]
{
new AtlasGlossaryTerm
{
LongDescription = "Example Long Description",
Name = "ExampleTerm2",
ShortDescription = "Example Short Description",
Abbreviation = "T2",
Anchor = new AtlasGlossaryHeader
{
GlossaryGuid = "c018ddaf-7c21-4b37-a838-dae5f110c3d8",
},
Status = TermStatus.Approved,
Resources = {new ResourceLink
{
DisplayName = "Example Display Name",
Url = "Example Url",
}},
},
new AtlasGlossaryTerm
{
LongDescription = "Example Long Description",
Name = "ExampleTerm3",
ShortDescription = "Example Short Description",
Abbreviation = "T3",
Anchor = new AtlasGlossaryHeader
{
GlossaryGuid = "c018ddaf-7c21-4b37-a838-dae5f110c3d8",
},
Status = TermStatus.Approved,
Resources = {new ResourceLink
{
DisplayName = "Example Display Name",
Url = "Example Url",
}},
}
});