Compartilhar via


TextAnalysisClient.AnalyzeTextOperationStatus Method

Definition

Overloads

AnalyzeTextOperationStatus(Guid, Nullable<Boolean>, Nullable<Int32>, Nullable<Int32>, RequestContext)

[Protocol Method] Get analysis status and results

AnalyzeTextOperationStatus(Guid, Nullable<Boolean>, Nullable<Int32>, Nullable<Int32>, CancellationToken)

Get analysis status and results.

AnalyzeTextOperationStatus(Guid, Nullable<Boolean>, Nullable<Int32>, Nullable<Int32>, RequestContext)

[Protocol Method] Get analysis status and results

public virtual Azure.Response AnalyzeTextOperationStatus (Guid jobId, bool? showStats, int? top, int? skip, Azure.RequestContext context);
abstract member AnalyzeTextOperationStatus : Guid * Nullable<bool> * Nullable<int> * Nullable<int> * Azure.RequestContext -> Azure.Response
override this.AnalyzeTextOperationStatus : Guid * Nullable<bool> * Nullable<int> * Nullable<int> * Azure.RequestContext -> Azure.Response
Public Overridable Function AnalyzeTextOperationStatus (jobId As Guid, showStats As Nullable(Of Boolean), top As Nullable(Of Integer), skip As Nullable(Of Integer), context As RequestContext) As Response

Parameters

jobId
Guid

job ID.

showStats
Nullable<Boolean>

(Optional) if set to true, response will contain request and document level statistics.

top
Nullable<Int32>

The maximum number of resources to return from the collection.

skip
Nullable<Int32>

An offset into the collection of the first resource to be returned.

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

Service returned a non-success status code.

Examples

This sample shows how to call AnalyzeTextOperationStatus and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
TextAnalysisClient client = new TextAnalysisClient(endpoint, credential);

Response response = client.AnalyzeTextOperationStatus(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null, null, null, null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString());

This sample shows how to call AnalyzeTextOperationStatus with all parameters and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
TextAnalysisClient client = new TextAnalysisClient(endpoint, credential);

Response response = client.AnalyzeTextOperationStatus(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), true, 1234, 1234, null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("displayName").ToString());
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());
Console.WriteLine(result.GetProperty("nextLink").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("lastUpdateDateTime").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("taskName").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("kind").ToString());
Console.WriteLine(result.GetProperty("statistics").GetProperty("documentsCount").ToString());
Console.WriteLine(result.GetProperty("statistics").GetProperty("validDocumentsCount").ToString());
Console.WriteLine(result.GetProperty("statistics").GetProperty("erroneousDocumentsCount").ToString());
Console.WriteLine(result.GetProperty("statistics").GetProperty("transactionsCount").ToString());

Applies to

AnalyzeTextOperationStatus(Guid, Nullable<Boolean>, Nullable<Int32>, Nullable<Int32>, CancellationToken)

Get analysis status and results.

public virtual Azure.Response<Azure.AI.Language.Text.AnalyzeTextOperationState> AnalyzeTextOperationStatus (Guid jobId, bool? showStats = default, int? top = default, int? skip = default, System.Threading.CancellationToken cancellationToken = default);
abstract member AnalyzeTextOperationStatus : Guid * Nullable<bool> * Nullable<int> * Nullable<int> * System.Threading.CancellationToken -> Azure.Response<Azure.AI.Language.Text.AnalyzeTextOperationState>
override this.AnalyzeTextOperationStatus : Guid * Nullable<bool> * Nullable<int> * Nullable<int> * System.Threading.CancellationToken -> Azure.Response<Azure.AI.Language.Text.AnalyzeTextOperationState>
Public Overridable Function AnalyzeTextOperationStatus (jobId As Guid, Optional showStats As Nullable(Of Boolean) = Nothing, Optional top As Nullable(Of Integer) = Nothing, Optional skip As Nullable(Of Integer) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of AnalyzeTextOperationState)

Parameters

jobId
Guid

job ID.

showStats
Nullable<Boolean>

(Optional) if set to true, response will contain request and document level statistics.

top
Nullable<Int32>

The maximum number of resources to return from the collection.

skip
Nullable<Int32>

An offset into the collection of the first resource to be returned.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call AnalyzeTextOperationStatus.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
TextAnalysisClient client = new TextAnalysisClient(endpoint, credential);

Response<AnalyzeTextOperationState> response = client.AnalyzeTextOperationStatus(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"));

This sample shows how to call AnalyzeTextOperationStatus with all parameters.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
TextAnalysisClient client = new TextAnalysisClient(endpoint, credential);

Response<AnalyzeTextOperationState> response = client.AnalyzeTextOperationStatus(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), showStats: true, top: 1234, skip: 1234);

Remarks

Get the status of an analysis job. A job can consist of one or more tasks. After all tasks succeed, the job transitions to the succeeded state and results are available for each task.

Applies to