Step 7: Get simulation details - AWS SimSpace Weaver

Step 7: Get simulation details

The SimSpace Weaver app SDK provides a helper script that wraps around the AWS CLI. The script simplifies calls to the AWS CLI by providing the SimSpace Weaver service endpoint. You use this helper script to call the SimSpace Weaver APIs. The DescribeSimulation API provides details about your simulation, including its state. A simulation can be in one of the following states:

Simulation life cycle states
  1. STARTING – Initial state after you call StartSimulation

  2. STARTED – all spatial apps are launched and healthy

  3. STOPPING – Initial state after you call StopSimulation

  4. STOPPED – All compute resources are stopped

  5. DELETING – Initial state after you call DeleteSimulation

  6. DELETED – All resources assigned to the simulation are deleted

  7. FAILED – The simulation had a critical error/failure and stopped

  8. SNAPSHOT_IN_PROGRESS – A snapshot is in progress

Docker
To get your simulation details
  1. If you aren't there already, go to the tools folder for your project and platform. Your project-folder is path\project-name using the values that you provided when you created the project.

    At a Windows command prompt, enter:

    cd project-folder\tools\windows
  2. Use the CLI helper script to call the ListSimulations API.

    .\weaver-project-name-cli.bat list-simulations
    Important

    If you use AWS IAM Identity Center or named profiles for the AWS Command Line Interface (AWS CLI), you must use SimSpace Weaver app SDK version 1.12.1 or higher. The latest version is 1.16.0. For information about SimSpace Weaver versions, see SimSpace Weaver versions. The SimSpace Weaver app SDK scripts use the AWS CLI. If you use IAM Identity Center, you can either copy your IAM Identity Center profile for the AWS CLI to your default profile or provide the name of your IAM Identity Center profile to SimSpace Weaver app SDK scripts with the --profile cli-profile-name parameter. For more information, see Configuring the AWS CLI to use AWS IAM Identity Center in the AWS Command Line Interface User Guide and Configuration and credential file settings in the AWS Command Line Interface User Guide.

    The script should display details about your each of your simulations, similar to the following:

    {
        "Status": "STARTED",
        "CreationTime": 1664921418.09,
        "Name": "MyProjectSimulation_22-10-04_22_10_15",
        "Arn": "arn:aws:simspaceweaver:us-west-2:111122223333:simulation/MyProjectSimulation_22-10-04_22_10_15",
        "TargetStatus": "STARTED"
    }
    
  3. Call DescribeSimulation to get your simulation details. Substitute simulation-name with the Name of your simulation from the output of the previous step.

    .\weaver-project-name-cli.bat describe-simulation --simulation simulation-name

    The script should display more details about the simulation that you specified, similar to the following:

    
    {
    
        "Name": "MyProjectSimulation_22-10-04_22_10_15",
        "ExecutionId": "1a2b3c4d-0ab1-1234-567a-12ab34cd5e6f",
        "Arn": "arn:aws:simspaceweaver:us-west-2:111122223333:simulation/MyProjectSimulation_22-10-04_22_10_15",
        "RoleArn": "arn:aws:iam::111122223333:role/weaver-MyProject-app-role",
        "CreationTime": 1664921418.09,
        "Status": "STARTED",
        "TargetStatus": "STARTED",
        "SchemaS3Location": {
            "ObjectKey": "MyProject-schema.yaml",
            "BucketName": "weaver-myproject-111122223333-us-west-2"
        },
        "SchemaError": "[]",
        "LoggingConfiguration": {
            "Destinations": [
                {
                    "CloudWatchLogsLogGroup": {
                        "LogGroupArn": "arn:aws:logs:us-west-2:111122223333:log-group:MySimulationLogs"
                    }
                }
            ]
        },
        "LiveSimulationState": {
            "Domains": [
                {
                    "Type": "",
                    "Name": "MySpatialSimulation",
                    "Lifecycle": "Unknown"
                },
                {
                    "Type": "",
                    "Name": "MyViewDomain",
                    "Lifecycle": "ByRequest"
                }
            ],
            "Clocks": [
                {
                    "Status": "STARTED",
                    "TargetStatus": "STARTED"
                }
            ]
        },
        "MaximumDuration": "1H",
        "StartError": "[]"
    }
    
    
WSL
Important

We provide these instructions for your convenience. They are for use with Windows Subsystem for Linux (WSL), and are unsupported. For more information, see Set up your local environment for SimSpace Weaver.

To get your simulation details
  1. If you aren't there already, go to the tools folder for your project and platform.Your project-folder is path/project-name using the values that you provided when you created the project.

    At a Linux shell prompt, enter:

    cd project-folder/tools/linux
  2. Use the CLI helper script to call the ListSimulations API.

    ./weaver-project-name-cli.sh list-simulations
    Important

    If you use AWS IAM Identity Center or named profiles for the AWS Command Line Interface (AWS CLI), you must use SimSpace Weaver app SDK version 1.12.1 or higher. The latest version is 1.16.0. For information about SimSpace Weaver versions, see SimSpace Weaver versions. The SimSpace Weaver app SDK scripts use the AWS CLI. If you use IAM Identity Center, you can either copy your IAM Identity Center profile for the AWS CLI to your default profile or provide the name of your IAM Identity Center profile to SimSpace Weaver app SDK scripts with the --profile cli-profile-name parameter. For more information, see Configuring the AWS CLI to use AWS IAM Identity Center in the AWS Command Line Interface User Guide and Configuration and credential file settings in the AWS Command Line Interface User Guide.

    The script should display details about your each of your simulations, similar to the following:

    {
        "Status": "STARTED",
        "CreationTime": 1664921418.09,
        "Name": "MyProjectSimulation_22-10-04_22_10_15",
        "Arn": "arn:aws:simspaceweaver:us-west-2:111122223333:simulation/MyProjectSimulation_22-10-04_22_10_15",
        "TargetStatus": "STARTED"
    }
    
  3. Call DescribeSimulation to get your simulation details. Substitute simulation-name with the Name of your simulation from the output of the previous step.

    ./weaver-project-name-cli.sh describe-simulation --simulation simulation-name

    The script should display more details about the simulation that you specified, similar to the following:

    
    {
    
        "Name": "MyProjectSimulation_22-10-04_22_10_15",
        "ExecutionId": "1a2b3c4d-0ab1-1234-567a-12ab34cd5e6f",
        "Arn": "arn:aws:simspaceweaver:us-west-2:111122223333:simulation/MyProjectSimulation_22-10-04_22_10_15",
        "RoleArn": "arn:aws:iam::111122223333:role/weaver-MyProject-app-role",
        "CreationTime": 1664921418.09,
        "Status": "STARTED",
        "TargetStatus": "STARTED",
        "SchemaS3Location": {
            "ObjectKey": "MyProject-schema.yaml",
            "BucketName": "weaver-myproject-111122223333-us-west-2"
        },
        "SchemaError": "[]",
        "LoggingConfiguration": {
            "Destinations": [
                {
                    "CloudWatchLogsLogGroup": {
                        "LogGroupArn": "arn:aws:logs:us-west-2:111122223333:log-group:MySimulationLogs"
                    }
                }
            ]
        },
        "LiveSimulationState": {
            "Domains": [
                {
                    "Type": "",
                    "Name": "MySpatialSimulation",
                    "Lifecycle": "Unknown"
                },
                {
                    "Type": "",
                    "Name": "MyViewDomain",
                    "Lifecycle": "ByRequest"
                }
            ],
            "Clocks": [
                {
                    "Status": "STARTED",
                    "TargetStatus": "STARTED"
                }
            ]
        },
        "MaximumDuration": "1H",
        "StartError": "[]"
    }