startJobRun method

Future<StartJobRunResponse> startJobRun({
  1. required String applicationId,
  2. required String executionRoleArn,
  3. String? clientToken,
  4. ConfigurationOverrides? configurationOverrides,
  5. JobRunExecutionIamPolicy? executionIamPolicy,
  6. int? executionTimeoutMinutes,
  7. JobDriver? jobDriver,
  8. JobRunMode? mode,
  9. String? name,
  10. RetryPolicy? retryPolicy,
  11. Map<String, String>? tags,
})

Starts a job run.

May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter applicationId : The ID of the application on which to run the job.

Parameter executionRoleArn : The execution role ARN for the job run.

Parameter clientToken : The client idempotency token of the job run to start. Its value must be unique for each request.

Parameter configurationOverrides : The configuration overrides for the job run.

Parameter executionIamPolicy : You can pass an optional IAM policy. The resulting job IAM role permissions will be an intersection of this policy and the policy associated with your job execution role.

Parameter executionTimeoutMinutes : The maximum duration for the job run to run. If the job run runs beyond this duration, it will be automatically cancelled.

Parameter jobDriver : The job driver for the job run.

Parameter mode : The mode of the job run when it starts.

Parameter name : The optional job run name. This doesn't have to be unique.

Parameter retryPolicy : The retry policy when job run starts.

Parameter tags : The tags assigned to the job run.

Implementation

Future<StartJobRunResponse> startJobRun({
  required String applicationId,
  required String executionRoleArn,
  String? clientToken,
  ConfigurationOverrides? configurationOverrides,
  JobRunExecutionIamPolicy? executionIamPolicy,
  int? executionTimeoutMinutes,
  JobDriver? jobDriver,
  JobRunMode? mode,
  String? name,
  RetryPolicy? retryPolicy,
  Map<String, String>? tags,
}) async {
  _s.validateNumRange(
    'executionTimeoutMinutes',
    executionTimeoutMinutes,
    0,
    1000000,
  );
  final $payload = <String, dynamic>{
    'executionRoleArn': executionRoleArn,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (configurationOverrides != null)
      'configurationOverrides': configurationOverrides,
    if (executionIamPolicy != null) 'executionIamPolicy': executionIamPolicy,
    if (executionTimeoutMinutes != null)
      'executionTimeoutMinutes': executionTimeoutMinutes,
    if (jobDriver != null) 'jobDriver': jobDriver,
    if (mode != null) 'mode': mode.value,
    if (name != null) 'name': name,
    if (retryPolicy != null) 'retryPolicy': retryPolicy,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/applications/${Uri.encodeComponent(applicationId)}/jobruns',
    exceptionFnMap: _exceptionFns,
  );
  return StartJobRunResponse.fromJson(response);
}