Step 4: Get your IP address and port number - AWS SimSpace Weaver

Step 4: Get your IP address and port number

You must get the IP address and port number of your view (custom) app so that you can connect to the simulation. The following procedure assumes that you don't know anything about your simulation (such as the simulation name). You can use this procedure at any time to find the IP address and port number for a custom app or service app. The following example output is for a project named MyProject.

Docker
To get your IP address and port number
  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 ListSimulations API to get the name of your simulation.

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

    If you use AWS IAM Identity Center (successor to AWS Single Sign-On) 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.12.3. 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 (successor to AWS Single Sign-On) in the AWS Command Line Interface User Guide and Named profiles for the AWS CLI in the AWS Command Line Interface User Guide.

    Example output:

    
    {
        "Simulations": [
            {
                "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. Use the DescribeSimulation API to get a list of domains in your simulation.

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

    Look for the Domains section in the LiveSimulationState section of the output.

    Example output:

    
        "LiveSimulationState": {
            "Domains": [
                {
                    "Type": "",
                    "Name": "MySpatialSimulation",
                    "Lifecycle": "Unknown"
                },
                {
                    "Type": "",
                    "Name": "MyViewDomain",
                    "Lifecycle": "ByRequest"
                }
            ],
    
    
  4. Use the ListApps API to get a list of custom apps in a domain. The domain name for the view (custom) app in the sample project is MyViewDomain. Look for the app name in the output.

    .\weaver-project-name-cli.bat list-apps --simulation simulation-name --domain domain-name

    Example output:

     
    {
        "Apps": [
            {
                "Status": "STARTED",
                "Domain": "MyViewDomain",
                "TargetStatus": "STARTED",
                "Name": "ViewApp",
                "Simulation": "MyProjectSimulation_22-10-04_22_10_15"
            }
        ]
    }
    
    
  5. Use the DescribeApp API to get the IP address and port number. For the sample project, the domain name is MyViewDomain and the app name is ViewApp.

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

    The IP address and port number are in the EndpointInfo block in the output. The IP address is the value of Address and the port number is the value of Actual.

    Example output:

    
    {
        "Status": "STARTED",
        "Domain": "MyViewDomain",
        "TargetStatus": "STARTED",
        "Simulation": "MyProjectSimulation_22-10-04_22_10_15",
        "LaunchOverrides": {
            "LaunchCommands": []
        },
        "EndpointInfo": {
            "IngressPortMappings": [
                {
                    "Declared": 7000,
                    "Actual": 4321
                }
            ],
            "Address": "198.51.100.135"
        },
        "Name": "ViewApp"
    }
    
    
    Note

    The value of Declared is the port number that your app code should bind to. The value of Actual is the port number that SimSpace Weaver exposes to clients to connect to your app. SimSpace Weaver maps the Declared port to the Actual port.

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 IP address and port number
  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 ListSimulations API to get the name of your simulation.

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

    If you use AWS IAM Identity Center (successor to AWS Single Sign-On) 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.12.3. 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 (successor to AWS Single Sign-On) in the AWS Command Line Interface User Guide and Named profiles for the AWS CLI in the AWS Command Line Interface User Guide.

    Example output:

    
    {
        "Simulations": [
            {
                "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. Use the DescribeSimulation API to get a list of domains in your simulation.

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

    Look for the Domains section in the LiveSimulationState section of the output.

    Example output:

    
        "LiveSimulationState": {
            "Domains": [
                {
                    "Type": "",
                    "Name": "MySpatialSimulation",
                    "Lifecycle": "Unknown"
                },
                {
                    "Type": "",
                    "Name": "MyViewDomain",
                    "Lifecycle": "ByRequest"
                }
            ],
    
    
  4. Use the ListApps API to get a list of custom apps in a domain. The domain name for the view (custom) app in the sample project is MyViewDomain. Look for the app name in the output.

    ./weaver-project-name-cli.sh list-apps --simulation simulation-name --domain domain-name

    Example output:

     
    {
        "Apps": [
            {
                "Status": "STARTED",
                "Domain": "MyViewDomain",
                "TargetStatus": "STARTED",
                "Name": "ViewApp",
                "Simulation": "MyProjectSimulation_22-10-04_22_10_15"
            }
        ]
    }
    
    
  5. Use the DescribeApp API to get the IP address and port number. For the sample project, the domain name is MyViewDomain and the app name is ViewApp.

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

    The IP address and port number are in the EndpointInfo block in the output. The IP address is the value of Address and the port number is the value of Actual.

    Example output:

    
    {
        "Status": "STARTED",
        "Domain": "MyViewDomain",
        "TargetStatus": "STARTED",
        "Simulation": "MyProjectSimulation_22-10-04_22_10_15",
        "LaunchOverrides": {
            "LaunchCommands": []
        },
        "EndpointInfo": {
            "IngressPortMappings": [
                {
                    "Declared": 7000,
                    "Actual": 4321
                }
            ],
            "Address": "198.51.100.135"
        },
        "Name": "ViewApp"
    }
    
    
    Note

    The value of Declared is the port number that your app code should bind to. The value of Actual is the port number that SimSpace Weaver exposes to clients to connect to your app. SimSpace Weaver maps the Declared port to the Actual port.