startSimulation method

Future<StartSimulationOutput> startSimulation({
  1. required String name,
  2. required String roleArn,
  3. String? clientToken,
  4. String? description,
  5. String? maximumDuration,
  6. S3Location? schemaS3Location,
  7. S3Location? snapshotS3Location,
  8. Map<String, String>? tags,
})

Starts a simulation with the given name. You must choose to start your simulation from a schema or from a snapshot. For more information about the schema, see the schema reference in the SimSpace Weaver User Guide. For more information about snapshots, see Snapshots in the SimSpace Weaver User Guide.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ValidationException.

Parameter name : The name of the simulation.

Parameter roleArn : The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that the simulation assumes to perform actions. For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference. For more information about IAM roles, see IAM roles in the Identity and Access Management User Guide.

Parameter clientToken : A value that you provide to ensure that repeated calls to this API operation using the same parameters complete only once. A ClientToken is also known as an idempotency token. A ClientToken expires after 24 hours.

Parameter description : The description of the simulation.

Parameter maximumDuration : The maximum running time of the simulation, specified as a number of minutes (m or M), hours (h or H), or days (d or D). The simulation stops when it reaches this limit. The maximum value is 14D, or its equivalent in the other units. The default value is 14D. A value equivalent to 0 makes the simulation immediately transition to Stopping as soon as it reaches Started.

Parameter schemaS3Location : The location of the simulation schema in Amazon Simple Storage Service (Amazon S3). For more information about Amazon S3, see the Amazon Simple Storage Service User Guide .

Provide a SchemaS3Location to start your simulation from a schema.

If you provide a SchemaS3Location then you can't provide a SnapshotS3Location.

Parameter snapshotS3Location : The location of the snapshot .zip file in Amazon Simple Storage Service (Amazon S3). For more information about Amazon S3, see the Amazon Simple Storage Service User Guide .

Provide a SnapshotS3Location to start your simulation from a snapshot.

The Amazon S3 bucket must be in the same Amazon Web Services Region as the simulation.

If you provide a SnapshotS3Location then you can't provide a SchemaS3Location.

Parameter tags : A list of tags for the simulation. For more information about tags, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference.

Implementation

Future<StartSimulationOutput> startSimulation({
  required String name,
  required String roleArn,
  String? clientToken,
  String? description,
  String? maximumDuration,
  S3Location? schemaS3Location,
  S3Location? snapshotS3Location,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'Name': name,
    'RoleArn': roleArn,
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'Description': description,
    if (maximumDuration != null) 'MaximumDuration': maximumDuration,
    if (schemaS3Location != null) 'SchemaS3Location': schemaS3Location,
    if (snapshotS3Location != null) 'SnapshotS3Location': snapshotS3Location,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/startsimulation',
    exceptionFnMap: _exceptionFns,
  );
  return StartSimulationOutput.fromJson(response);
}