cancelJobRun method
Cancels a job run.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ValidationException.
Parameter applicationId :
The ID of the application on which the job run will be canceled.
Parameter jobRunId :
The ID of the job run to cancel.
Parameter shutdownGracePeriodInSeconds :
The duration in seconds to wait before forcefully terminating the job
after cancellation is requested.
Implementation
Future<CancelJobRunResponse> cancelJobRun({
required String applicationId,
required String jobRunId,
int? shutdownGracePeriodInSeconds,
}) async {
final $query = <String, List<String>>{
if (shutdownGracePeriodInSeconds != null)
'shutdownGracePeriodInSeconds': [
shutdownGracePeriodInSeconds.toString()
],
};
final response = await _protocol.send(
payload: null,
method: 'DELETE',
requestUri:
'/applications/${Uri.encodeComponent(applicationId)}/jobruns/${Uri.encodeComponent(jobRunId)}',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return CancelJobRunResponse.fromJson(response);
}