Partager via


ConversationAuthoringClient.GetDeploymentJobStatusAsync Méthode

Définition

[Méthode de protocole] Obtient le status d’un travail de déploiement existant.

  • Cette méthode de protocole permet la création explicite de la demande et le traitement de la réponse pour les scénarios avancés.
public virtual System.Threading.Tasks.Task<Azure.Response> GetDeploymentJobStatusAsync (string projectName, string deploymentName, string jobId, Azure.RequestContext context = default);
abstract member GetDeploymentJobStatusAsync : string * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetDeploymentJobStatusAsync : string * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetDeploymentJobStatusAsync (projectName As String, deploymentName As String, jobId As String, Optional context As RequestContext = Nothing) As Task(Of Response)

Paramètres

projectName
String

Nom du projet à utiliser.

deploymentName
String

Nom du déploiement spécifique du projet à utiliser.

jobId
String

ID du travail.

context
RequestContext

Contexte de demande, qui peut remplacer les comportements par défaut du pipeline client par appel.

Retours

Réponse retournée par le service.

Exceptions

projectName, deploymentName ou jobId a la valeur Null.

projectName, deploymentName ou jobId est une chaîne vide, et était censé être non vide.

Le service a retourné un code de status non réussi.

Exemples

Cet exemple montre comment appeler GetDeploymentJobStatusAsync avec les paramètres requis et analyser le résultat.

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

Response response = await client.GetDeploymentJobStatusAsync("<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());

Remarques

Vous trouverez des informations supplémentaires dans la documentation de l’API REST de service : https://learn.microsoft.com/rest/api/language/2023-04-01/conversational-analysis-authoring/get-deployment-status

S’applique à