updateJobStatus method
Updates the status for the specified job. Use this operation to confirm that you want to run a job or to cancel an existing job. For more information, see S3 Batch Operations in the Amazon S3 User Guide.
- Permissions
-
To use the
UpdateJobStatusoperation, you must have permission to perform thes3:UpdateJobStatusaction.
May throw BadRequestException.
May throw InternalServiceException.
May throw JobStatusException.
May throw NotFoundException.
May throw TooManyRequestsException.
Parameter accountId :
The Amazon Web Services account ID associated with the S3 Batch Operations
job.
Parameter jobId :
The ID of the job whose status you want to update.
Parameter requestedJobStatus :
The status that you want to move the specified job to.
Parameter statusUpdateReason :
A description of the reason why you want to change the specified job's
status. This field can be any string up to the maximum length.
Implementation
Future<UpdateJobStatusResult> updateJobStatus({
required String accountId,
required String jobId,
required RequestedJobStatus requestedJobStatus,
String? statusUpdateReason,
}) async {
final headers = <String, String>{
'x-amz-account-id': accountId.toString(),
};
final $query = <String, List<String>>{
'requestedJobStatus': [requestedJobStatus.value],
if (statusUpdateReason != null)
'statusUpdateReason': [statusUpdateReason],
};
final $result = await _protocol.send(
method: 'POST',
requestUri: '/v20180820/jobs/${Uri.encodeComponent(jobId)}/status',
queryParams: $query,
headers: headers,
exceptionFnMap: _exceptionFns,
);
return UpdateJobStatusResult.fromXml($result.body);
}