LogoLogo
HomeSign UpGithub
  • Home
  • Release Notes
  • Getting Started
    • Create your first Test
    • Create Run Settings
    • Analyze the results
      • Job Summary
      • Logs
      • State
      • Payload
    • Look deeper with Metrics
  • Concepts
    • Workspaces
      • Role Based Access Control (RBAC)
      • Invitation Management
      • GitHub Integration
      • Deletion of Workspaces
      • System Status
    • Understanding Tests
      • Stages Management
        • Init Stage
        • Running Stage(s)
        • Finished State
      • Generating Messages
        • Scripting Environment
        • State Object
      • Response Handler
      • Preview Tests
      • Exporting/Importing Tests
        • Import OpenAPI JSON/YAML
      • Locking/Unlocking a test
    • Stateful Simulation
      • Mapping the IoT device lifecycle
    • Protocol Settings
      • MQTT
      • HTTP
      • Using other protocols
    • Run Settings
      • Network Simulation
      • Execution Strategies
      • Client Distribution
    • Scenarios
    • Glob Storage
    • Metrics
    • Mailbox
    • Licensing and Limits
    • Deployment Models
  • Additional Helpers
    • External Libraries
    • Inbuilt Libraries
    • IoTIFY Helper Functions
      • Job Functions
      • Messaging Functions
      • Glob Functions
      • Metrics Functions
      • Mailbox Functions
      • Data Generation Functions
  • platform integrations
    • AWS IoT Connector
  • Guides
    • Smart City
    • Smart Home
    • Load Testing Kafka
  • IoT Testing
    • Overview
      • Feed offline sensor data from Google Sheets to your IoT platform
    • Functional Testing
      • Basic functional test
      • Geofencing Validation
    • Performance Testing
      • MQTT end to end latency Measurement
    • Security Testing
    • Load Testing
    • Test Automation & CI/CD integration
  • API
    • Simulation API
    • Glob APIs
    • Metrics API
  • Glossary
  • Create Account
  • TEMP
    • Getting Started
      • Beginner
      • Developer
      • Tester
    • Walkthrough
    • Protocol Settings
      • CoAP
      • Raw (TCP/UDP/TLS/DTLS)
      • LWM2M
      • NONE
    • Under the hood
    • Google Sheets API
    • Azure IoT
    • Losant IoT
      • Losant Connector
      • Parking Space Management
      • Waste Management
      • Connected Truck
      • Delivery Van
    • Google Cloud IoT Core
    • IBM Cloud
      • Simple Messaging
      • IBM Bluemix: Monitoring Energy Consumption
    • Dweet.io
    • JMeter and why it fails at IoT
Powered by GitBook
On this page
  • Run a template
  • Get Job Status

Was this helpful?

  1. API

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

Name
Type
Description

testID*

The ID of the test that needs to run

Headers

Name
Type
Description

Content-Type*

application/json

key*

API token for the account

domain*

The domain under which your account exists

Request Body

Name
Type
Description

runSettings*

Object

Defines the parameters for the simulation

jobName*

Unique name identifying the currently running job

rS: clients*

Number

Total number of clients

rS: iteration*

Number

Total number of iterations

rs: interval*

Number

Interval between two iterations

rS: captureLogs

Boolean

Capture all the log data to display on the results page

rS: captureState

Boolean

Capture all the state data to display on the results page

rS: capturePayload

Boolean

Capture all the payload data to display on the results page

{
    "success": true,
    "jobId": "$jobID",
    "jobName": "$jobName"
}
{
    "statusCode": 400,
    "message": "Error message",
    "error": "Error reason"
}

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

Name
Type
Description

workspaceID*

WorkspaceID for the workspace you're a part of

jobID*

Simulation ID as seen in the UI or returned by API while launching the simulation through the POST API.

Headers

Name
Type
Description

Accept*

application/json

Content-Type*

String

application/json

key*

String

API token for the account

domain*

String

The domain under which your account exists

{
    "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
                        }
                    }
                }
            }
        }
    }
}
{
    "statusCode": 400,
    "message": "Error message"
}
// 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
PreviousTest Automation & CI/CD integrationNextGlob APIs

Last updated 2 years ago

Was this helpful?