terminateJob method
Terminates a job in a job queue. Jobs that are in the
STARTING or RUNNING state are terminated, which
causes them to transition to FAILED. Jobs that have not
progressed to the STARTING state are cancelled.
May throw ClientException.
May throw ServerException.
Parameter jobId :
The Batch job ID of the job to terminate.
Parameter reason :
A message to attach to the job that explains the reason for canceling it.
This message is returned by future DescribeJobs operations on the
job. It is also recorded in the Batch activity logs.
This parameter has as limit of 1024 characters.
Implementation
Future<void> terminateJob({
required String jobId,
required String reason,
}) async {
final $payload = <String, dynamic>{
'jobId': jobId,
'reason': reason,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/v1/terminatejob',
exceptionFnMap: _exceptionFns,
);
}