AWS SimSpace Weaver

2023/04/28 - AWS SimSpace Weaver - 1 new3 updated api methods

Changes  Added a new CreateSnapshot API. For the StartSimulation API, SchemaS3Location is now optional, added a new SnapshotS3Location parameter. For the DescribeSimulation API, added SNAPSHOT_IN_PROGRESS simulation state, deprecated SchemaError, added new fields: StartError and SnapshotS3Location.

CreateSnapshot (new) Link ¶

Creates a snapshot of the specified simulation. A snapshot is a file that contains simulation state data at a specific time. The state data saved in a snapshot includes entity data from the State Fabric, the simulation configuration specified in the schema, and the clock tick number. You can use the snapshot to initialize a new simulation. For more information about snapshots, see Snapshots in the SimSpace Weaver User Guide.

You specify a Destination when you create a snapshot. The Destination is the name of an Amazon S3 bucket and an optional ObjectKeyPrefix. The ObjectKeyPrefix is usually the name of a folder in the bucket. SimSpace Weaver creates a snapshot folder inside the Destination and places the snapshot file there.

The snapshot file is an Amazon S3 object. It has an object key with the form: object-key-prefix/snapshot/simulation-name-YYMMdd-HHmm-ss.zip, where:

  • YY is the 2-digit year

  • MM is the 2-digit month

  • dd is the 2-digit day of the month

  • HH is the 2-digit hour (24-hour clock)

  • mm is the 2-digit minutes

  • ss is the 2-digit seconds

See also: AWS API Documentation

Request Syntax

client.create_snapshot(
    Destination={
        'BucketName': 'string',
        'ObjectKeyPrefix': 'string'
    },
    Simulation='string'
)
type Destination:

dict

param Destination:

[REQUIRED]

The Amazon S3 bucket and optional folder (object key prefix) where SimSpace Weaver creates the snapshot file.

type Simulation:

string

param Simulation:

[REQUIRED]

The name of the simulation.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

DescribeSimulation (updated) Link ¶
Changes (response)
{'SnapshotS3Location': {'BucketName': 'string', 'ObjectKey': 'string'},
 'StartError': 'string',
 'Status': {'SNAPSHOT_IN_PROGRESS'}}

Returns the current state of the given simulation.

See also: AWS API Documentation

Request Syntax

client.describe_simulation(
    Simulation='string'
)
type Simulation:

string

param Simulation:

[REQUIRED]

The name of the simulation.

rtype:

dict

returns:

Response Syntax

{
    'Arn': 'string',
    'CreationTime': datetime(2015, 1, 1),
    'Description': 'string',
    'ExecutionId': 'string',
    'LiveSimulationState': {
        'Clocks': [
            {
                'Status': 'UNKNOWN'|'STARTING'|'STARTED'|'STOPPING'|'STOPPED',
                'TargetStatus': 'UNKNOWN'|'STARTED'|'STOPPED'
            },
        ],
        'Domains': [
            {
                'Lifecycle': 'Unknown'|'PerWorker'|'BySpatialSubdivision'|'ByRequest',
                'Name': 'string'
            },
        ]
    },
    'LoggingConfiguration': {
        'Destinations': [
            {
                'CloudWatchLogsLogGroup': {
                    'LogGroupArn': 'string'
                }
            },
        ]
    },
    'MaximumDuration': 'string',
    'Name': 'string',
    'RoleArn': 'string',
    'SchemaError': 'string',
    'SchemaS3Location': {
        'BucketName': 'string',
        'ObjectKey': 'string'
    },
    'SnapshotS3Location': {
        'BucketName': 'string',
        'ObjectKey': 'string'
    },
    'StartError': 'string',
    'Status': 'UNKNOWN'|'STARTING'|'STARTED'|'STOPPING'|'STOPPED'|'FAILED'|'DELETING'|'DELETED'|'SNAPSHOT_IN_PROGRESS',
    'TargetStatus': 'UNKNOWN'|'STARTED'|'STOPPED'|'DELETED'
}

Response Structure

  • (dict) --

    • Arn (string) --

      The Amazon Resource Name (ARN) of the simulation. For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

    • CreationTime (datetime) --

      The time when the simulation was created, expressed as the number of seconds and milliseconds in UTC since the Unix epoch (0:0:0.000, January 1, 1970).

    • Description (string) --

      The description of the simulation.

    • ExecutionId (string) --

      A universally unique identifier (UUID) for this simulation.

    • LiveSimulationState (dict) --

      A collection of additional state information, such as domain and clock configuration.

      • Clocks (list) --

        A list of simulation clocks.

        • (dict) --

          Status information about the simulation clock.

          • Status (string) --

            The current status of the simulation clock.

          • TargetStatus (string) --

            The desired status of the simulation clock.

      • Domains (list) --

        A list of domains for the simulation. For more information about domains, see Key concepts: Domains in the SimSpace Weaver User Guide.

        • (dict) --

          A collection of app instances that run the same executable app code and have the same launch options and commands.

          For more information about domains, see Key concepts: Domains in the SimSpace Weaver User Guide.

          • Lifecycle (string) --

            The type of lifecycle management for apps in the domain. Indicates whether apps in this domain are managed (SimSpace Weaver starts and stops the apps) or unmanaged (you must start and stop the apps).

            Lifecycle types

            • PerWorker – Managed: SimSpace Weaver starts one app on each worker.

            • BySpatialSubdivision – Managed: SimSpace Weaver starts one app for each spatial partition.

            • ByRequest – Unmanaged: You use the StartApp API to start the apps and use the StopApp API to stop the apps.

          • Name (string) --

            The name of the domain.

    • LoggingConfiguration (dict) --

      Settings that control how SimSpace Weaver handles your simulation log data.

      • Destinations (list) --

        A list of the locations where SimSpace Weaver sends simulation log data.

        • (dict) --

          The location where SimSpace Weaver sends simulation log data.

          • CloudWatchLogsLogGroup (dict) --

            An Amazon CloudWatch Logs log group that stores simulation log data. For more information about log groups, see Working with log groups and log streams in the Amazon CloudWatch Logs User Guide.

            • LogGroupArn (string) --

              The Amazon Resource Name (ARN) of the Amazon CloudWatch Logs log group for the simulation. For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference. For more information about log groups, see Working with log groups and log streams in the Amazon CloudWatch Logs User Guide.

    • MaximumDuration (string) --

      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.

    • Name (string) --

      The name of the simulation.

    • RoleArn (string) --

      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.

    • SchemaError (string) --

      An error message that SimSpace Weaver returns only if there is a problem with the simulation schema.

    • SchemaS3Location (dict) --

      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.

    • SnapshotS3Location (dict) --

      A location in Amazon Simple Storage Service (Amazon S3) where SimSpace Weaver stores simulation data, such as your app .zip files and schema file. For more information about Amazon S3, see the Amazon Simple Storage Service User Guide.

    • StartError (string) --

      An error message that SimSpace Weaver returns only if a problem occurs when the simulation is in the STARTING state.

    • Status (string) --

      The current lifecycle state of the simulation.

    • TargetStatus (string) --

      The desired lifecycle state of the simulation.

ListSimulations (updated) Link ¶
Changes (response)
{'Simulations': {'Status': {'SNAPSHOT_IN_PROGRESS'}}}

Lists the SimSpace Weaver simulations in the Amazon Web Services account used to make the API call.

See also: AWS API Documentation

Request Syntax

client.list_simulations(
    MaxResults=123,
    NextToken='string'
)
type MaxResults:

integer

param MaxResults:

The maximum number of simulations to list.

type NextToken:

string

param NextToken:

If SimSpace Weaver returns nextToken, then there are more results available. The value of nextToken is a unique pagination token for each page. To retrieve the next page, call the operation again using the returned token. Keep all other arguments unchanged. If no results remain, then nextToken is set to null. Each pagination token expires after 24 hours. If you provide a token that isn't valid, then you receive an HTTP 400 ValidationException error.

rtype:

dict

returns:

Response Syntax

{
    'NextToken': 'string',
    'Simulations': [
        {
            'Arn': 'string',
            'CreationTime': datetime(2015, 1, 1),
            'Name': 'string',
            'Status': 'UNKNOWN'|'STARTING'|'STARTED'|'STOPPING'|'STOPPED'|'FAILED'|'DELETING'|'DELETED'|'SNAPSHOT_IN_PROGRESS',
            'TargetStatus': 'UNKNOWN'|'STARTED'|'STOPPED'|'DELETED'
        },
    ]
}

Response Structure

  • (dict) --

    • NextToken (string) --

      If SimSpace Weaver returns nextToken, then there are more results available. The value of nextToken is a unique pagination token for each page. To retrieve the next page, call the operation again using the returned token. Keep all other arguments unchanged. If no results remain, then nextToken is set to null. Each pagination token expires after 24 hours. If you provide a token that isn't valid, then you receive an HTTP 400 ValidationException error.

    • Simulations (list) --

      The list of simulations.

      • (dict) --

        A collection of data about the simulation.

        • Arn (string) --

          The Amazon Resource Name (ARN) of the simulation. For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

        • CreationTime (datetime) --

          The time when the simulation was created, expressed as the number of seconds and milliseconds in UTC since the Unix epoch (0:0:0.000, January 1, 1970).

        • Name (string) --

          The name of the simulation.

        • Status (string) --

          The current status of the simulation.

        • TargetStatus (string) --

          The desired status of the simulation.

StartSimulation (updated) Link ¶
Changes (request)
{'SnapshotS3Location': {'BucketName': 'string', 'ObjectKey': 'string'}}

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.

See also: AWS API Documentation

Request Syntax

client.start_simulation(
    ClientToken='string',
    Description='string',
    MaximumDuration='string',
    Name='string',
    RoleArn='string',
    SchemaS3Location={
        'BucketName': 'string',
        'ObjectKey': 'string'
    },
    SnapshotS3Location={
        'BucketName': 'string',
        'ObjectKey': 'string'
    },
    Tags={
        'string': 'string'
    }
)
type ClientToken:

string

param 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.

This field is autopopulated if not provided.

type Description:

string

param Description:

The description of the simulation.

type MaximumDuration:

string

param 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.

type Name:

string

param Name:

[REQUIRED]

The name of the simulation.

type RoleArn:

string

param RoleArn:

[REQUIRED]

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.

type SchemaS3Location:

dict

param 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.

type SnapshotS3Location:

dict

param 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.

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

type Tags:

dict

param 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.

  • (string) --

    • (string) --

rtype:

dict

returns:

Response Syntax

{
    'Arn': 'string',
    'CreationTime': datetime(2015, 1, 1),
    'ExecutionId': 'string'
}

Response Structure

  • (dict) --

    • Arn (string) --

      The Amazon Resource Name (ARN) of the simulation. For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

    • CreationTime (datetime) --

      The time when the simulation was created, expressed as the number of seconds and milliseconds in UTC since the Unix epoch (0:0:0.000, January 1, 1970).

    • ExecutionId (string) --

      A universally unique identifier (UUID) for this simulation.