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

ConversationAuthoringClient.GetSwapDeploymentsJobStatusAsync 方法

定义

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

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

参数

projectName
String

要使用的项目的名称。

jobId
String

作业 ID。

context
RequestContext

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

返回

从服务返回的响应。

例外

projectNamejobId 为 null。

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

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

示例

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

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

Response response = await client.GetSwapDeploymentsJobStatusAsync("<projectName>", "<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-swap-deployments-status

适用于