cancelJob method
Cancels the specified job. You can only cancel a job before its
JobState
value changes to PreparingAppliance
.
Requesting the ListJobs
or DescribeJob
action
returns a job's JobState
as part of the response element data
returned.
May throw InvalidResourceException. May throw InvalidJobStateException. May throw KMSRequestFailedException.
Parameter jobId
:
The 39-character job ID for the job that you want to cancel, for example
JID123e4567-e89b-12d3-a456-426655440000
.
Implementation
Future<void> cancelJob({
required String jobId,
}) async {
ArgumentError.checkNotNull(jobId, 'jobId');
_s.validateStringLength(
'jobId',
jobId,
39,
39,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSIESnowballJobManagementService.CancelJob'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'JobId': jobId,
},
);
}