createSimulationJob method

Future<CreateSimulationJobResponse> createSimulationJob({
  1. required String iamRole,
  2. required int maxJobDurationInSeconds,
  3. String? clientRequestToken,
  4. Compute? compute,
  5. List<DataSourceConfig>? dataSources,
  6. FailureBehavior? failureBehavior,
  7. LoggingConfig? loggingConfig,
  8. OutputLocation? outputLocation,
  9. List<RobotApplicationConfig>? robotApplications,
  10. List<SimulationApplicationConfig>? simulationApplications,
  11. Map<String, String>? tags,
  12. VPCConfig? vpcConfig,
})

Creates a simulation job.

May throw ResourceNotFoundException. May throw InvalidParameterException. May throw InternalServerException. May throw ThrottlingException. May throw LimitExceededException. May throw IdempotentParameterMismatchException. May throw ServiceUnavailableException.

Parameter iamRole : The IAM role name that allows the simulation instance to call the AWS APIs that are specified in its associated policies on your behalf. This is how credentials are passed in to your simulation job.

Parameter maxJobDurationInSeconds : The maximum simulation job duration in seconds (up to 14 days or 1,209,600 seconds. When maxJobDurationInSeconds is reached, the simulation job will status will transition to Completed.

Parameter clientRequestToken : Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Parameter compute : Compute information for the simulation job.

Parameter dataSources : Specify data sources to mount read-only files from S3 into your simulation. These files are available under /opt/robomaker/datasources/data_source_name.

Parameter failureBehavior : The failure behavior the simulation job.

Continue
Restart the simulation job in the same host instance.
Fail
Stop the simulation job and terminate the instance.

Parameter loggingConfig : The logging configuration.

Parameter outputLocation : Location for output files generated by the simulation job.

Parameter robotApplications : The robot application to use in the simulation job.

Parameter simulationApplications : The simulation application to use in the simulation job.

Parameter tags : A map that contains tag keys and tag values that are attached to the simulation job.

Parameter vpcConfig : If your simulation job accesses resources in a VPC, you provide this parameter identifying the list of security group IDs and subnet IDs. These must belong to the same VPC. You must provide at least one security group and one subnet ID.

Implementation

Future<CreateSimulationJobResponse> createSimulationJob({
  required String iamRole,
  required int maxJobDurationInSeconds,
  String? clientRequestToken,
  Compute? compute,
  List<DataSourceConfig>? dataSources,
  FailureBehavior? failureBehavior,
  LoggingConfig? loggingConfig,
  OutputLocation? outputLocation,
  List<RobotApplicationConfig>? robotApplications,
  List<SimulationApplicationConfig>? simulationApplications,
  Map<String, String>? tags,
  VPCConfig? vpcConfig,
}) async {
  ArgumentError.checkNotNull(iamRole, 'iamRole');
  _s.validateStringLength(
    'iamRole',
    iamRole,
    1,
    255,
    isRequired: true,
  );
  ArgumentError.checkNotNull(
      maxJobDurationInSeconds, 'maxJobDurationInSeconds');
  _s.validateStringLength(
    'clientRequestToken',
    clientRequestToken,
    1,
    64,
  );
  final $payload = <String, dynamic>{
    'iamRole': iamRole,
    'maxJobDurationInSeconds': maxJobDurationInSeconds,
    'clientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
    if (compute != null) 'compute': compute,
    if (dataSources != null) 'dataSources': dataSources,
    if (failureBehavior != null) 'failureBehavior': failureBehavior.toValue(),
    if (loggingConfig != null) 'loggingConfig': loggingConfig,
    if (outputLocation != null) 'outputLocation': outputLocation,
    if (robotApplications != null) 'robotApplications': robotApplications,
    if (simulationApplications != null)
      'simulationApplications': simulationApplications,
    if (tags != null) 'tags': tags,
    if (vpcConfig != null) 'vpcConfig': vpcConfig,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/createSimulationJob',
    exceptionFnMap: _exceptionFns,
  );
  return CreateSimulationJobResponse.fromJson(response);
}