Entity.BatchSetClassificationsAsync 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 |
|---|---|
| BatchSetClassificationsAsync(AtlasEntityHeaders, CancellationToken) |
Set classifications on entities in bulk. |
| BatchSetClassificationsAsync(RequestContent, RequestContext) |
[Protocol Method] Set classifications on entities in bulk.
|
BatchSetClassificationsAsync(AtlasEntityHeaders, CancellationToken)
- Source:
- Entity.cs
Set classifications on entities in bulk.
public virtual System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<string>>> BatchSetClassificationsAsync(Azure.Analytics.Purview.DataMap.AtlasEntityHeaders body, System.Threading.CancellationToken cancellationToken = default);
abstract member BatchSetClassificationsAsync : Azure.Analytics.Purview.DataMap.AtlasEntityHeaders * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<string>>>
override this.BatchSetClassificationsAsync : Azure.Analytics.Purview.DataMap.AtlasEntityHeaders * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<string>>>
Public Overridable Function BatchSetClassificationsAsync (body As AtlasEntityHeaders, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of IReadOnlyList(Of String)))
Parameters
- body
- AtlasEntityHeaders
Body parameter.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
body is null.
Examples
This sample shows how to call BatchSetClassificationsAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Entity client = new DataMapClient(endpoint, credential).GetEntityClient();
AtlasEntityHeaders body = new AtlasEntityHeaders
{
GuidHeaderMap =
{
["9fb74c11-ac48-4650-95bc-760665c5bd92"] = new AtlasEntityHeader
{
Attributes =
{
["qualifiedName"] = BinaryData.FromObjectAsJson("https://exampleaccount1.core.windows.net")
},
TypeName = "azure_storage_account",
Classifications = {new AtlasClassification
{
TypeName = "MICROSOFT.PERSONAL.EMAIL",
}},
},
["7fcc43ab-55ea-45d4-9971-ce0443cb10bb"] = new AtlasEntityHeader
{
Attributes =
{
["qualifiedName"] = BinaryData.FromObjectAsJson("https://exampleaccount2.core.windows.net")
},
TypeName = "azure_storage_account",
Classifications = {new AtlasClassification
{
TypeName = "MICROSOFT.PERSONAL.IPADDRESS",
}},
}
},
};
Response<IReadOnlyList<string>> response = await client.BatchSetClassificationsAsync(body);
Applies to
BatchSetClassificationsAsync(RequestContent, RequestContext)
- Source:
- Entity.cs
[Protocol Method] Set classifications on entities in bulk.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler BatchSetClassificationsAsync(AtlasEntityHeaders, CancellationToken) convenience overload with strongly typed models first.
public virtual System.Threading.Tasks.Task<Azure.Response> BatchSetClassificationsAsync(Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member BatchSetClassificationsAsync : Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.BatchSetClassificationsAsync : Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function BatchSetClassificationsAsync (content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of 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 BatchSetClassificationsAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Entity client = new DataMapClient(endpoint, credential).GetEntityClient();
using RequestContent content = RequestContent.Create(new
{
guidHeaderMap = new Dictionary<string, object>
{
["9fb74c11-ac48-4650-95bc-760665c5bd92"] = new
{
attributes = new
{
qualifiedName = "https://exampleaccount1.core.windows.net",
},
typeName = "azure_storage_account",
classifications = new object[]
{
new
{
typeName = "MICROSOFT.PERSONAL.EMAIL",
}
},
},
["7fcc43ab-55ea-45d4-9971-ce0443cb10bb"] = new
{
attributes = new
{
qualifiedName = "https://exampleaccount2.core.windows.net",
},
typeName = "azure_storage_account",
classifications = new object[]
{
new
{
typeName = "MICROSOFT.PERSONAL.IPADDRESS",
}
},
}
},
});
Response response = await client.BatchSetClassificationsAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result[0].ToString());