

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 終止服務任務
<a name="terminate-service-jobs"></a>

使用 [https://docs.aws.amazon.com/batch/latest/APIReference/API_TerminateServiceJob.html](https://docs.aws.amazon.com/batch/latest/APIReference/API_TerminateServiceJob.html)操作停止執行中的服務任務。

終止特定服務任務：

```
aws batch terminate-service-job \
  --job-id a4d6c728-8ee8-4c65-8e2a-9a5e8f4b7c3d \
  --reason "Job terminated by user request"
```

當您終止服務任務時， 會 AWS Batch 停止任務並通知目標服務。對於 SageMaker 訓練任務，這也會停止 SageMaker AI 中的訓練任務。