API for Generating Custom Mode Virtual Locations

You can generate either a new virtual location or modify an existing virtual location.

To generate a new virtual location set the "locationMetadata" to null and define the required parameters as described below.

To modify an existing virtual location, initialize the "locationMetadata" with the existing virtual locations "locationMetadata" and define the required parameters as described below. The value of each parameter of the original virtual location is retained unless a new value is provided.

Parameters:

  • id: the virtual location's ID. If the parameter is not passed when creating a new virtual location, the ID will be generated by the Location Editor and returned in the response.
  • name: the virtual location's name

    default for a new virtual location is "null"

  • description: the virtual location's description

    default for a new virtual location is "null"

  • latency: the required latency

    default for a new virtual location is "0"

  • packetloss: the required packet loss

    default for a new virtual location is "0"

  • bandwidthIn: the required downstream bandwidth

    default for a new virtual location is "0" (unlimited)

  • bandwidthOut: the required upstream bandwidth

    default for a new virtual location is "0" (unlimited)

  • isCaptureClientPl: set packet capture to true when a single client is going to use the virtual location for later analyzing the transactions from the NV Test Manager

    default for a new virtual location is "false"

  • sharedBandwidth: when set to "false", each client using the virtual locations when running the test will get its own bandwidth, the defined bandwidth; default for a new virtual location is "true"
  • excludeIpRange: IP address to exclude from the emulation also if included in the Start Test request;

    default for a new virtual location is "null"

    When running emulation using Dynamic Filters, there should be no excluded IPs in the virtual location.

    IP address can also be excluded in the Start Emulation request, per virtual location or for all of the virtual locations in the request.

    To remove all the excluded ranges when modifying a virtual location, send an empty list (excludeIpRange=[] ).

All parameters are optional.

Request

JSON

URL http://ip:port/shunra/api/locationeditor/location/custom
HTTP Method POST
HTTP Headers

Content-Type: application/json

Accept: application/json

Authorization: See Web Services Authentication.

Body (New Location)
{
    "parameters": {
        "id": "1234567890",
        "name": "locName",
        "description": "description",
        "latency": 129,
        "packetloss": 0.1,
        "bandwidthIn": 2000.0,
        "bandwidthOut": 1000.0,
        "isCaptureClientPl": false,
        "sharedBandwidth": true,
        "excludeIpRange": [{
            "from": "172.30.2.50",
            "to": "172.30.2.52",
            "port": 8080,
            "protocol": 6
        }]
    }
}
Body (Existing Location)
{
    "locationMetadata": {
        "srcIp": null,
        "destIp": null,
        "srcIpRange": {
            "include": [],
            "exclude": [{
                "from": "172.30.2.50",
                "to": "172.30.2.52",
                "port": 8080,
                "protocol": 6
            }]
        },
        "destIpRange": {
            "include": [],
            "exclude": [{
                "from": "172.30.2.50",
                "to": "172.30.2.52",
                "port": 8080,
                "protocol": 6
            }]
        },
        "id": "1234567890",
        "name": "locName",
        "type": "CUSTOM",
        "description": "description",
        "ntx": null,
        "selectedFlow": null,
        "latency": 129,
        "packetloss": 0.1,
        "bandwidthIn": 2000.0,
        "bandwidthOut": 1000.0,
        "isCaptureClientPl": false,
        "sharedBandwidth": true,
        "ntxMetadata": null,
        "glMetadata": null
    },
    "parameters": {
        "latency": 143,
        "bandwidthIn": 1500.0,
        "bandwidthOut": 750.0,
        "excludeIpRange": []
    }
}

XML

URL http://ip:port/shunra/api/locationeditor/location/custom
HTTP Method POST
HTTP Headers

Content-Type: application/xml

Accept: application/xml

Authorization: See Web Services Authentication.

Body (New Location)
<?xml version="1.0" encoding="UTF-8" ?>
<locationMetadataRequest>
    <parameters>
        <id>1234567890</id>
        <name>locName</name>
        <description>description</description>
        <latency>129</latency>
        <packetloss>0.1</packetloss>
        <bandwidthIn>2000</bandwidthIn>
        <bandwidthOut>1000</bandwidthOut>
        <isCaptureClientPl>false</isCaptureClientPl>
        <sharedBandwidth>true</sharedBandwidth>
        <excludeIpRange>
            <from>172.30.2.50</from>
            <to>172.30.2.52</to>
            <port>8080</port>
            <protocol>6</protocol>
        </excludeIpRange>
    </parameters>
</locationMetadataRequest>
Body (Existing Location)
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<locationMetadataRequest>
    <id>1234567890</id>
    <locationMetadata>
        <srcIpRange>
            <exclude>
                <from>172.30.2.50</from>
                <to>172.30.2.52</to>
                <port>8080</port>
                <protocol>6</protocol>
            </exclude>
        </srcIpRange>
        <destIpRange>
            <exclude>
                <from>172.30.2.50</from>
                <to>172.30.2.52</to>
                <port>8080</port>
                <protocol>6</protocol>
            </exclude>
        </destIpRange>
        <id>1234567890</id>
        <name>locName</name>
        <type>CUSTOM</type>
        <description>description</description>
        <latency>129</latency>
        <packetloss>0.1</packetloss>
        <bandwidthIn>2000.0</bandwidthIn>
        <bandwidthOut>1000.0</bandwidthOut>
        <isCaptureClientPl>false</isCaptureClientPl>
        <sharedBandwidth>true</sharedBandwidth>
    </locationMetadata>
    <parameters>
        <latency>143</latency>
        <bandwidthIn>1500</bandwidthIn>
        <bandwidthOut>750</bandwidthOut>
        <excludeIpRange>
            <from>172.30.2.50</from>
            <to>172.30.2.51</to>
            <port>8080</port>
            <protocol>6</protocol>
        </excludeIpRange>
    </parameters>
</locationMetadataRequest>

 

Response

JSON

HTTP Response Code 200 - OK
HTTP Headers

Date: Thu, 15 Mar 2014 15:55:38 GMT

Content-Type: application/json; charset=UTF-8

HTTP Body
{
    "id": "1234567890",
    "locationMetadata": {
        "srcIp": null,
        "destIp": null,
        "srcIpRange": {
            "include": [],
            "exclude": [{
                "from": "172.30.2.50",
                "to": "172.30.2.52",
                "port": 8080,
                "protocol": 6
            }]
        },
        "destIpRange": {
            "include": [],
            "exclude": [{
                "from": "172.30.2.50",
                "to": "172.30.2.52",
                "port": 8080,
                "protocol": 6
            }]
        },
        "id": "1234567890",
        "name": "locName",
        "type": "CUSTOM",
        "description": "description",
        "ntx": null,
        "selectedFlow": null,
        "latency": 129,
        "packetloss": 0.1,
        "bandwidthIn": 2000.0,
        "bandwidthOut": 1000.0,
        "isCaptureClientPl": true,
        "sharedBandwidth": true,
        "ntxMetadata": null,
        "glMetadata": null
    }
}

XML

HTTP Response Code 200 - OK
HTTP Headers

Date: Thu, 15 Mar 2014 15:55:38 GMT

Content-Type: application/json; charset=UTF-8

HTTP Body
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<generatedLocation>
    <id>1234567890</id>
    <locationMetadata>
        <srcIpRange>
            <exclude>
                <from>172.30.2.50</from>
                <to>172.30.2.52</to>
                <port>8080</port>
                <protocol>6</protocol>
            </exclude>
        </srcIpRange>
        <destIpRange>
            <exclude>
                <from>172.30.2.50</from>
                <to>172.30.2.52</to>
                <port>8080</port>
                <protocol>6</protocol>
            </exclude>
        </destIpRange>
        <id>1234567890</id>
        <name>locName</name>
        <type>CUSTOM</type>
        <description>description</description>
        <latency>129</latency>
        <packetloss>0.1</packetloss>
        <bandwidthIn>2000.0</bandwidthIn>
        <bandwidthOut>1000.0</bandwidthOut>
        <isCaptureClientPl>false</isCaptureClientPl>
        <sharedBandwidth>true</sharedBandwidth>
    </locationMetadata>
</generatedLocation>