Utilizzare StopTextTranslationJob con un AWS SDK o CLI - Esempi di codice dell'AWS SDK

Ci sono altri AWS SDK esempi disponibili nel repository AWS Doc SDK Examples GitHub .

Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.

Utilizzare StopTextTranslationJob con un AWS SDK o CLI

I seguenti esempi di codice mostrano come utilizzareStopTextTranslationJob.

.NET
AWS SDK for .NET
Nota

C'è altro da fare GitHub. Trova l'esempio completo e scopri di più sulla configurazione e l'esecuzione nel Repository di esempi di codice AWS.

using System; using System.Threading.Tasks; using Amazon.Translate; using Amazon.Translate.Model; /// <summary> /// Shows how to stop a running Amazon Translation Service text translation /// job. /// </summary> public class StopTextTranslationJob { public static async Task Main() { var client = new AmazonTranslateClient(); var jobId = "1234567890abcdef01234567890abcde"; var request = new StopTextTranslationJobRequest { JobId = jobId, }; await StopTranslationJobAsync(client, request); } /// <summary> /// Sends a request to stop a text translation job. /// </summary> /// <param name="client">Initialized AmazonTrnslateClient object.</param> /// <param name="request">The request object to be passed to the /// StopTextJobAsync method.</param> public static async Task StopTranslationJobAsync( AmazonTranslateClient client, StopTextTranslationJobRequest request) { var response = await client.StopTextTranslationJobAsync(request); if (response.HttpStatusCode == System.Net.HttpStatusCode.OK) { Console.WriteLine($"{response.JobId} as status: {response.JobStatus}"); } } }
SAP ABAP
SDKper SAP ABAP
Nota

C'è altro da fare GitHub. Trova l'esempio completo e scopri di più sulla configurazione e l'esecuzione nel Repository di esempi di codice AWS.

"Stops an asynchronous batch translation job that is in progress." TRY. oo_result = lo_xl8->stoptexttranslationjob( "oo_result is returned for testing purposes." EXPORTING iv_jobid = iv_jobid ). MESSAGE 'Translation job stopped.' TYPE 'I'. CATCH /aws1/cx_xl8internalserverex . MESSAGE 'An internal server error occurred.' TYPE 'E'. CATCH /aws1/cx_xl8resourcenotfoundex . MESSAGE 'The resource you are looking for has not been found.' TYPE 'E'. CATCH /aws1/cx_xl8toomanyrequestsex. MESSAGE 'You have made too many requests within a short period of time.' TYPE 'E'. ENDTRY.