または AWS SDK DeleteTranscriptionJobで使用する CLI - AWS SDK コード例

AWS Doc SDK Examples GitHub リポジトリには他にも AWS SDK例があります。

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

または AWS SDK DeleteTranscriptionJobで使用する CLI

以下のコード例は、DeleteTranscriptionJob の使用方法を示しています。

アクション例は、より大きなプログラムからのコードの抜粋であり、コンテキスト内で実行する必要があります。次のコード例で、このアクションのコンテキストを確認できます。

.NET
AWS SDK for .NET
注記

の詳細については、「」を参照してください GitHub。用例一覧を検索し、AWS コード例リポジトリでの設定と実行の方法を確認してください。

/// <summary> /// Delete a transcription job. Also deletes the transcript associated with the job. /// </summary> /// <param name="jobName">Name of the transcription job to delete.</param> /// <returns>True if successful.</returns> public async Task<bool> DeleteTranscriptionJob(string jobName) { var response = await _amazonTranscribeService.DeleteTranscriptionJobAsync( new DeleteTranscriptionJobRequest() { TranscriptionJobName = jobName }); return response.HttpStatusCode == HttpStatusCode.OK; }
  • API 詳細については、 リファレンスDeleteTranscriptionJobの「」を参照してください。 AWS SDK for .NET API

CLI
AWS CLI

文字起こしジョブの 1 つを削除するには

次の delete-transcription-job 例では、トランスクリプションジョブの 1 つを削除します。

aws transcribe delete-transcription-job \ --transcription-job-name your-transcription-job

このコマンドでは何も出力されません。

詳細については、Amazon Transcribe デベロッパーガイドDeleteTranscriptionJob」の「」を参照してください。

  • API 詳細については、AWS CLI 「 コマンドリファレンスDeleteTranscriptionJob」の「」を参照してください。

JavaScript
SDK JavaScript (v3) の場合
注記

の詳細については、「」を参照してください GitHub。用例一覧を検索し、AWS コード例リポジトリでの設定と実行の方法を確認してください。

文字起こしジョブを削除します。

// Import the required AWS SDK clients and commands for Node.js import { DeleteTranscriptionJobCommand } from "@aws-sdk/client-transcribe"; import { transcribeClient } from "./libs/transcribeClient.js"; // Set the parameters export const params = { TranscriptionJobName: "JOB_NAME", // Required. For example, 'transciption_demo' }; export const run = async () => { try { const data = await transcribeClient.send( new DeleteTranscriptionJobCommand(params) ); console.log("Success - deleted"); return data; // For unit tests. } catch (err) { console.log("Error", err); } }; run();

クライアントを作成します。

import { TranscribeClient } from "@aws-sdk/client-transcribe"; // Set the AWS Region. const REGION = "REGION"; //e.g. "us-east-1" // Create an Amazon Transcribe service client object. const transcribeClient = new TranscribeClient({ region: REGION }); export { transcribeClient };
Python
SDK Python 用 (Boto3)
注記

の詳細については、「」を参照してください GitHub。用例一覧を検索し、AWS コード例リポジトリでの設定と実行の方法を確認してください。

def delete_job(job_name, transcribe_client): """ Deletes a transcription job. This also deletes the transcript associated with the job. :param job_name: The name of the job to delete. :param transcribe_client: The Boto3 Transcribe client. """ try: transcribe_client.delete_transcription_job(TranscriptionJobName=job_name) logger.info("Deleted job %s.", job_name) except ClientError: logger.exception("Couldn't delete job %s.", job_name) raise
  • API 詳細については、AWS SDKPython (Boto3) APIリファレンス のDeleteTranscriptionJob「」の「」を参照してください。