Skip to content

start_simulation async

start_simulation(
    name: SimSpaceWeaverResourceName,
    role_arn: RoleArn,
    *,
    config_overrides: Optional[AsyncSimSpaceWeaverClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    description: Optional[Description] = None,
    schema_s3_location: Optional[S3Location] = None,
    maximum_duration: Optional[TimeToLiveString] = None,
    tags: Optional[TagMap] = None,
    snapshot_s3_location: Optional[S3Location] = None,
) -> StartSimulationOutput

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.

Parameters:

  • client_token (Optional[ClientToken], default: None ) –

    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.

  • name (SimSpaceWeaverResourceName) –

    The name of the simulation.

  • description (Optional[Description], default: None ) –

    The description of the simulation.

  • role_arn (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.

  • schema_s3_location (Optional[S3Location], default: None ) –

    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.

  • maximum_duration (Optional[TimeToLiveString], default: None ) –

    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.

  • tags (Optional[TagMap], default: None ) –

    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.

  • snapshot_s3_location (Optional[S3Location], default: None ) –

    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.

Raises:

Source code in docs_src/capo_simspaceweaver/_services/async_sim_space_weaver.py
async def start_simulation(
    self,
    name: "capo_simspaceweaver.types.sim_space_weaver_resource_name.SimSpaceWeaverResourceName",
    role_arn: "capo_simspaceweaver.types.role_arn.RoleArn",
    *,
    config_overrides: Optional[AsyncSimSpaceWeaverClientConfig] = None,
    client_token: Optional[
        "capo_simspaceweaver.types.client_token.ClientToken"
    ] = None,
    description: Optional[
        "capo_simspaceweaver.types.description.Description"
    ] = None,
    schema_s3_location: Optional[
        "capo_simspaceweaver.types.s3_location.S3Location"
    ] = None,
    maximum_duration: Optional[
        "capo_simspaceweaver.types.time_to_live_string.TimeToLiveString"
    ] = None,
    tags: Optional["capo_simspaceweaver.types.tag_map.TagMap"] = None,
    snapshot_s3_location: Optional[
        "capo_simspaceweaver.types.s3_location.S3Location"
    ] = None,
) -> "capo_simspaceweaver.types.start_simulation_output.StartSimulationOutput":
    """<p>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 <a href="https://docs.aws.amazon.com/simspaceweaver/latest/userguide/schema-reference.html">schema reference</a> in the <i>SimSpace Weaver User Guide</i>. For more information about snapshots, see <a href="https://docs.aws.amazon.com/simspaceweaver/latest/userguide/working-with_snapshots.html">Snapshots</a> in the <i>SimSpace Weaver User Guide</i>.</p>

    Args:
        client_token: <p>A value that you provide to ensure that repeated calls to this API operation using the same parameters complete only once. A <code>ClientToken</code> is also known as an <i>idempotency token</i>. A <code>ClientToken</code> expires after 24 hours.</p>
        name: <p>The name of the simulation.</p>
        description: <p>The description of the simulation.</p>
        role_arn: <p>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 <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>. For more information about IAM roles, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html">IAM roles</a> in the <i>Identity and Access Management User Guide</i>.</p>
        schema_s3_location: <p>The location of the simulation schema in Amazon Simple Storage Service (Amazon S3). For more information about Amazon S3, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html"> <i>Amazon Simple Storage Service User Guide</i> </a>.</p> <p>Provide a <code>SchemaS3Location</code> to start your simulation from a schema.</p> <p>If you provide a <code>SchemaS3Location</code> then you can't provide a <code>SnapshotS3Location</code>.</p>
        maximum_duration: <p>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 <code>14D</code>, or its equivalent in the other units. The default value is <code>14D</code>. A value equivalent to <code>0</code> makes the simulation immediately transition to <code>Stopping</code> as soon as it reaches <code>Started</code>.</p>
        tags: <p>A list of tags for the simulation. For more information about tags, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a> in the <i>Amazon Web Services General Reference</i>.</p>
        snapshot_s3_location: <p>The location of the snapshot .zip file in Amazon Simple Storage Service (Amazon S3). For more information about Amazon S3, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html"> <i>Amazon Simple Storage Service User Guide</i> </a>.</p> <p>Provide a <code>SnapshotS3Location</code> to start your simulation from a snapshot.</p> <p>The Amazon S3 bucket must be in the same Amazon Web Services Region as the simulation.</p> <p>If you provide a <code>SnapshotS3Location</code> then you can't provide a <code>SchemaS3Location</code>.</p>

    Raises:
        capo_simspaceweaver.errors.access_denied_exception.AccessDeniedException: <p/>
        capo_simspaceweaver.errors.conflict_exception.ConflictException: <p/>
        capo_simspaceweaver.errors.internal_server_exception.InternalServerException: <p/>
        capo_simspaceweaver.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p/>
        capo_simspaceweaver.errors.validation_exception.ValidationException: <p/>
        capo_simspaceweaver.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_simspaceweaver.types.start_simulation_input.StartSimulationInput]",
    ) -> AsyncOperationResponse[
        "capo_simspaceweaver.types.start_simulation_output.StartSimulationOutput"
    ]:
        import capo_simspaceweaver._operations.sim_space_weaver.start_simulation

        (
            output,
            http_response,
        ) = await capo_simspaceweaver._operations.sim_space_weaver.start_simulation.async_start_simulation(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_simspaceweaver.types.start_simulation_input.StartSimulationInput",
    ) -> dict[str, Any]:
        import capo_simspaceweaver.types.start_simulation_input

        return capo_simspaceweaver.types.start_simulation_input.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("StartSimulation", redact_input=_redact_input),
    )
    input_: capo_simspaceweaver.types.start_simulation_input.StartSimulationInput = {
        "name": name,
        "role_arn": role_arn,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if description is not None:
        input_["description"] = description
    if schema_s3_location is not None:
        input_["schema_s3_location"] = schema_s3_location
    if maximum_duration is not None:
        input_["maximum_duration"] = maximum_duration
    if tags is not None:
        input_["tags"] = tags
    if snapshot_s3_location is not None:
        input_["snapshot_s3_location"] = snapshot_s3_location

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output