Simulation API

Run a template

POST https://nsim.iotify.io/api/test/:testID/run

This endpoint allows you to run a test with the required run settings.

Path Parameters

Headers

Request Body

{
    "success": true,
    "jobId": "$jobID",
    "jobName": "$jobName"
}

The parameters marked as rS: $parameter are parameters under the runSettings object.

For a list of all additional runSettings parameter you can use, check the Run Settings page of the documentation.

// Example curl command

curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" -H "key:$KEY" -H "domain:nsim.iotify.io" -d '{"jobName":"$JOBNAME","runSettings":{"interval":1000,"iteration":150,"clients":10}}' nsim.iotify.io/api/test/$TESTID/run

Get Job Status

GET https://nsim.iotify.io/api/jobs/:workspaceID/:jobID

This API returns the status and results of the simulation job

Query Parameters

Headers

{
    "jobId": "$jobID",
    "testId": "$testID",
    "jobName": "$jobName",
    "workspaceId": "$workspaceID",
    "submitterId": "$submitterID",
    "runSettings": {
        "name": "Default",
        "interval": 1000,
        "iteration": 150,
        "clients": 10,
        "totalClients": 5,
        "clientIdOffset": 0
    },
    "currentInstance": 0,
    "results": {
        "result": {
            "total": 750,
            "success": 750,
            "failure": 0,
            "startAt": 1667282175065.829,
            "endAt": 1667282327070.1438,
            "duration": 152004.31469726562,
            "status": "finished",
            "eta": 0
        },
        "instances": {
            "0": {
                "result": {
                    "total": 750,
                    "success": 750,
                    "failure": 0,
                    "startAt": 1667282175065.829,
                    "endAt": 1667282327070.1438,
                    "duration": 152004.31469726562,
                    "status": "finished",
                    "eta": 0
                },
                "iterations": {
                    "0": {
                        "result": {
                            "total": 5,
                            "success": 5,
                            "failure": 0,
                            "startAt": 1667282175065.829,
                            "endAt": 1667282177692.3975,
                            "duration": 2626.568359375,
                            "status": "finished",
                            "eta": 0
                        }
                    },
                    
                    .............
                    
                    "149": {
                        "result": {
                            "total": 5,
                            "success": 5,
                            "failure": 0,
                            "startAt": 1667282327068.5632,
                            "endAt": 1667282327070.1438,
                            "duration": 1.58056640625,
                            "status": "finished",
                            "eta": 0
                        }
                    }
                }
            }
        }
    }
}
// Example curl command

curl -X GET -H "Accept: application/json" -H "Content-Type: application/json" -H "key:$KEY" -H "domain:nsim.iotify.io" nsim.iotify.io/api/jobs/$WORKSPACE/$JOB

Last updated