Real Time Update

This API performs real time updates on tests that are already playing. Real time updates can be performed in two modes, NTX mode or Custom mode.

  • NTX mode: The complete .ntxx file can be used, or only the parts of the file that include the shapes which require updates. Partial shape updates are not supported; all shape attributes must be provided: latency and packet loss must be updated together and all bandwidth parameters must be updated together.
  • Custom mode: the Flow ID must be provided, Partial shape updates are not supported; all shape attributes must be provided: latency and packet loss must be updated together and all bandwidth parameters must be updated together.

Limitations

  • IP changes are not allowed, instead, use the Add Flow functionality in Multi User mode, or start an additional test.
  • A Custom real time update request is supported only if the start request was made in Custom mode (and not through the .ntxx file).
  • The "Default flow" cannot be changed through the real time update request.

NTX Mode

Request

The HTTP request holds an .ntxx string.

JSON

URL http://ip:port/shunra/api/emulation/ntx/{testToken}
HTTP Method PUT
HTTP Headers

Content-Type: multipart/form-data

Accept: application/json

Authorization: See Web Services Authentication.

Form Data

Two form data objects should be provided:

  1. "fileUpload" with .ntxx file.

  2. "metadata":
    {
        "testName":"myNtx",”
        networkScenario”:”3G”,
        "description":"This is my ntx"
    }

See RFC 1867, "Form-based File Upload in HTML"

www.ietf.org/rfc/rfc1867.txt

XML

URL http://ip:port/shunra/api/emulation/ntx/{testToken}
HTTP Method PUT
HTTP Headers

Content-Type: multipart/form-data

Accept: application/xml

Authorization: See Web Services Authentication.

Form Data

Two form data objects should be provided:

  1. "fileUpload" with .ntxx file.

  2. "metadata":
    <testMetadata>
       <testName>myNtx</testName>
       <description>This is my ntx</description>
       <networkScenario>3G</networkScenario>
    </testMetadata>
    

See RFC 1867, "Form-based File Upload in HTML"

www.ietf.org/rfc/rfc1867.txt

Response

HTTP Response Code 200 - OK
HTTP Headers  
HTTP Body
{
"emulationTest":{
"metadata":{"testName": "UpdateScenario", "description": "myAPIstrattesttest2", "dateCreated": 1463404165023, "startTime": 1463404165024,…},
"testToken": "92645d40-4ccd-4023-81f8-664c062eff45791a757e-4f37-44dc-9f7e-0678415af009",
"analyticsMetadata":{"date": 0, "type": null, "isAnalyzed": false, "hasTransactions": false, "hasTransactionRuns": false,…},
"history":{
"fieldHistory":{
"metadata_networkScenario":{"history":[{"changeDate": 1463404165023, "value": "ItamarTest1" }, {"changeDate": 1463404281251,…}
}
}
},
"transactions":{
"transactions":[]
}
}

Custom Mode

Request

The body of the request holds an array of flow objects to update. Although partial updates are supported, when providing parameters, values for Latency and Packet Loss must be provided together; also values for BandwidthIn and BandwidthOut must be provided together.

JSON

URL http://ip:port/shunra/api/emulation/custom/{testToken}
HTTP Method PUT
HTTP Headers

Content-Type: application/json

Accept: application/json

Authorization: See Web Services Authentication.

Body
{
    "flows": [{
        "flowId": "flow33",
        "latency": 500,
        "packetloss": 20.0,
        "bandwidthIn": 2048.0,
        "bandwidthOut": 2048.0,
        "isDefaultFlow": "true"
    }],
    "testMetadata": {
        "testName":"myNtx",
        "description":"it is my ntx",
        "networkScenario":"3G"
    }
}

XML

URL http://ip:port/shunra/api/emulation/custom/{testToken}
HTTP Method PUT
HTTP Headers

Content-Type: application/xml

Accept: application/xml

Authorization: See Web Services Authentication.

Body
<emulationCustomRequest>
    <flows>
        <flowId> flow33</flowId>
        <latency>500.0</latency>
        <packetloss>20.0</packetloss>
        <bandwidthIn>2048.0</bandwidthIn>
        <bandwidthOut>2048.0</bandwidthOut>
        <isDefaultFlow>true</isDefaultFlow>
    </flows>
    <testMetadata>
        <testName>myNtx</testName>
        <description>it is my ntx</description>
        <networkScenario>3G</networkScenario>
    </testMetadata>
</emulationCustomRequest>

Response

HTTP Response Code 200 - OK
HTTP Headers  
HTTP Body