Partilhar via


Entity.ImportBusinessMetadataAsync Method

Definition

Overloads

ImportBusinessMetadataAsync(BusinessMetadataOptions, CancellationToken)

Upload the file for creating Business Metadata in BULK.

ImportBusinessMetadataAsync(RequestContent, RequestContext)

[Protocol Method] Upload the file for creating Business Metadata in BULK

ImportBusinessMetadataAsync(BusinessMetadataOptions, CancellationToken)

Source:
Entity.cs

Upload the file for creating Business Metadata in BULK.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.BulkImportResult>> ImportBusinessMetadataAsync (Azure.Analytics.Purview.DataMap.BusinessMetadataOptions businessMetadataOptions, System.Threading.CancellationToken cancellationToken = default);
abstract member ImportBusinessMetadataAsync : Azure.Analytics.Purview.DataMap.BusinessMetadataOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.BulkImportResult>>
override this.ImportBusinessMetadataAsync : Azure.Analytics.Purview.DataMap.BusinessMetadataOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.BulkImportResult>>
Public Overridable Function ImportBusinessMetadataAsync (businessMetadataOptions As BusinessMetadataOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of BulkImportResult))

Parameters

businessMetadataOptions
BusinessMetadataOptions

Business metadata to send to the service.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

businessMetadataOptions is null.

Examples

This sample shows how to call ImportBusinessMetadataAsync.

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

BusinessMetadataOptions businessMetadataOptions = new BusinessMetadataOptions(BinaryData.FromObjectAsJson(new object()));
Response<BulkImportResult> response = await client.ImportBusinessMetadataAsync(businessMetadataOptions);

This sample shows how to call ImportBusinessMetadataAsync with all parameters.

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

BusinessMetadataOptions businessMetadataOptions = new BusinessMetadataOptions(BinaryData.FromObjectAsJson(new object()));
Response<BulkImportResult> response = await client.ImportBusinessMetadataAsync(businessMetadataOptions);

Applies to

ImportBusinessMetadataAsync(RequestContent, RequestContext)

Source:
Entity.cs

[Protocol Method] Upload the file for creating Business Metadata in BULK

public virtual System.Threading.Tasks.Task<Azure.Response> ImportBusinessMetadataAsync (Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member ImportBusinessMetadataAsync : Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.ImportBusinessMetadataAsync : Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function ImportBusinessMetadataAsync (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 ImportBusinessMetadataAsync 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
{
    file = new object(),
});
Response response = await client.ImportBusinessMetadataAsync(content);

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

This sample shows how to call ImportBusinessMetadataAsync with all 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
{
    file = new object(),
});
Response response = await client.ImportBusinessMetadataAsync(content);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("failedImportInfoList")[0].GetProperty("childObjectName").ToString());
Console.WriteLine(result.GetProperty("failedImportInfoList")[0].GetProperty("importStatus").ToString());
Console.WriteLine(result.GetProperty("failedImportInfoList")[0].GetProperty("parentObjectName").ToString());
Console.WriteLine(result.GetProperty("failedImportInfoList")[0].GetProperty("remarks").ToString());
Console.WriteLine(result.GetProperty("successImportInfoList")[0].GetProperty("childObjectName").ToString());
Console.WriteLine(result.GetProperty("successImportInfoList")[0].GetProperty("importStatus").ToString());
Console.WriteLine(result.GetProperty("successImportInfoList")[0].GetProperty("parentObjectName").ToString());
Console.WriteLine(result.GetProperty("successImportInfoList")[0].GetProperty("remarks").ToString());

Applies to