你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

ConversationAuthoringClient.GetDeploymentJobStatus 方法

定义

[协议方法]获取现有部署作业的状态。

  • 协议方法 允许显式创建请求并处理高级方案的响应。
public virtual Azure.Response GetDeploymentJobStatus (string projectName, string deploymentName, string jobId, Azure.RequestContext context = default);
abstract member GetDeploymentJobStatus : string * string * string * Azure.RequestContext -> Azure.Response
override this.GetDeploymentJobStatus : string * string * string * Azure.RequestContext -> Azure.Response
Public Overridable Function GetDeploymentJobStatus (projectName As String, deploymentName As String, jobId As String, Optional context As RequestContext = Nothing) As Response

参数

projectName
String

要使用的项目的名称。

deploymentName
String

要使用的项目的特定部署的名称。

jobId
String

作业 ID。

context
RequestContext

请求上下文,它可以基于每个调用替代客户端管道的默认行为。

返回

从服务返回的响应。

例外

projectNamedeploymentNamejobId 为 null。

projectNamedeploymentNamejobId 是空字符串,预期为非空。

服务返回了不成功状态代码。

示例

此示例演示如何使用所需参数调用 GetDeploymentJobStatus 并分析结果。

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

Response response = client.GetDeploymentJobStatus("<projectName>", "<deploymentName>", "<jobId>");

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").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("details")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("<test>").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").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("<test>").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());

注解

可以在服务 REST API 文档中找到其他信息: https://learn.microsoft.com/rest/api/language/2023-04-01/conversational-analysis-authoring/get-deployment-status

适用于