Follow

Update a Test

Description

This API enables you to update any available test configuration parameter. This function includes parameters to identify both the user and the test

  

API v4

URL

https://a.blazemeter.com/api/v4/tests/testID

Request Parameters

Parameter Description
Api Key Identifies the user. How to get the API Key?
Test ID Identifies the test. How to get the Test ID?
Post Body The parameters you wish to update. See list Below

cURL

curl -X put https://a.blazemeter.com/api/v4/tests/testID  -H "Content-Type: application/json" -H "x-api-key: 62f7f52eb342c3ec1e31" -d '{"name": "New Name3","configuration": {"location": "us-west-1","type": "jmeter","concurrency": 200,"dedicatedIpsEnabled": "false","plugins": {"splitCSV": {"enabled": "false"}}}}'

Python

import requests

def testUpdate(test_id):
	return requests.put('https://a.blazemeter.com/api/v4/tests/{0}/'.format(test_id), headers={"x-api-key": "65f7f52eb362c4ec2e31"}, json={"name": "New Name3","configuration": {"location": "us-west-1","type": "jmeter","concurrency": 200,"dedicatedIpsEnabled": "false","plugins": {"splitCSV": {"enabled": "false"}}}})

res = testUpdate(testID )
print res.json()

The Test Object

The Test object contains the following parameters:

Parameter Description Modifiable
name The verbal identifier of the test    ✔
location The Geolocation of the load generators. Download list here.    ✔
rampup The timeframe in which the load will be increased from 0 to the Max concurrent users set    ✔
iterations The number of iterations the test will run until finished. Infinite iteration presented as '-1'    ✔   
concurrency Max number of threads active concurrently per engine    ✔
dedicatedIpsEnabled True will use the Dedicated IPs you've purchased. More info    ✔
.splitCSV.enabled True will split the CSV/s . More info    ✔
reportEmail.enabled True if you like to receive an Email at test's end    ✔
duration The period of time for which the test will run until shut down    ✔
jmeter.version The Jmeter version used to run this test, e.g '2.12 blazemeter'    ✔
type Can be a Jmeter, URL list or Webdriver Test    ✖
created The time the test was started at    ✖
updated The time the test was last updated    ✖
id The unique identifier of the test. The 'Test ID'.    ✖
filename the name of the JMX script uploaded    ✖
userId The unique identifier of the user    ✖
consoleArgs Command line arguments for the console    ✔
engineArgs Command line arguments for the engine/s    ✔

Example Response

{
    "api_version": 4,
    "error": null,
    "result": {
        "id": 5543109,
        "name": "New_Name",
        "draftId": "td_2016_07_14_14_46_37_136992_422",
        "userId": 136992,
        "lastRunTime": 1489410339,
        "created": 1487494074,
        "updated": 1489939765,
        "projectId": 152150,
        "lastUpdatedById": 136992,
        "configuration": {
            "location": "us-east-1",
            "duration": 60,
            "type": "jmeter",
            "concurrency": 50,
            "dedicatedIpsEnabled": false,
            "javaVersion": "1.8",
            "canControlRampup": false,
            "targetThreads": 50,
            "plugins": {
                "remoteControl": [],
                "splitCSV": {
                    "enabled": false
                },
                "reportEmail": {
                    "enabled": false
                },
                "jmeter": {
                    "filename": "Demo.jmx",
                    "version": "3.1",
                    "consoleArgs": "-Jtarget_host=10.7.42.12",
                    "enginesArgs": "-Jtarget_host=10.7.42.12",
                    "override": {
                        "rampup": 300,
                        "iterations": -1,
                        "duration": 60
                    }
                }
            }
        }
    },
    "test": {
        "id": 5543109,
        "name": "New_Name",
        "draftId": "td_2016_07_14_14_46_37_136992_422",
        "userId": 136992,
        "lastRunTime": 1489410339,
        "created": 1487494074,
        "updated": 1489939765,
        "projectId": 152150,
        "lastUpdatedById": 136992,
        "configuration": {
            "location": "us-east-1",
            "duration": 60,
            "type": "jmeter",
            "concurrency": 50,
            "dedicatedIpsEnabled": false,
            "javaVersion": "1.8",
            "canControlRampup": false,
            "targetThreads": 50,
            "plugins": {
                "remoteControl": [],
                "splitCSV": {
                    "enabled": false
                },
                "reportEmail": {
                    "enabled": false
                },
                "jmeter": {
                    "filename": "Demo.jmx",
                    "version": "3.1",
                    "consoleArgs": "-Jtarget_host=10.7.42.12",
                    "enginesArgs": "-Jtarget_host=10.7.42.12",
                    "override": {
                        "rampup": 300,
                        "iterations": -1,
                        "duration": 60
                    }
                }
            }
        }
    }
}

 

 

API v2 

URL

https://a.blazemeter.com:443/api/latest/tests/testID

Request Parameters

Parameter Description
Api Key Identifies the user. How to get the API Key?
Test ID Identifies the test. How to get the Test ID?
Post Body The parameters you wish to update. See list Below

cURL

curl -X put https://a.blazemeter.com:443/api/latest/tests/testID  -H "Content-Type: application/json" -H "x-api-key: 62f7f52eb342c3ec1e31" -d '{"name": "New Name3","configuration": {"location": "us-west-1","type": "jmeter","concurrency": 200,"dedicatedIpsEnabled": "false","plugins": {"splitCSV": {"enabled": "false"}}}}'

Python

import requests

def testUpdate(test_id):
	return requests.put('https://a.blazemeter.com/api/latest/tests/{0}/'.format(test_id), headers={"x-api-key": "65f7f52eb362c4ec2e31"}, json={"name": "New Name3","configuration": {"location": "us-west-1","type": "jmeter","concurrency": 200,"dedicatedIpsEnabled": "false","plugins": {"splitCSV": {"enabled": "false"}}}})

res = testUpdate(testID )
print res.json()

The Test Object

The Test object contains the following parameters:

Parameter Description Modifiable
name The verbal identifier of the test    ✔
location The Geolocation of the load generators. Download list here.    ✔
rampup The timeframe in which the load will be increased from 0 to the Max concurrent users set    ✔
iterations The number of iterations the test will run until finished. Infinite iteration presented as '-1'    ✔   
concurrency Max number of threads active concurrently per engine    ✔
dedicatedIpsEnabled True will use the Dedicated IPs you've purchased. More info    ✔
.splitCSV.enabled True will split the CSV/s . More info    ✔
reportEmail.enabled True if you like to receive an Email at test's end    ✔
duration The period of time for which the test will run until shut down    ✔
jmeter.version The Jmeter version used to run this test, e.g '2.12 blazemeter'    ✔
type Can be a Jmeter, URL list or Webdriver Test    ✖
created The time the test was started at    ✖
updated The time the test was last updated    ✖
id The unique identifier of the test. The 'Test ID'.    ✖
filename the name of the JMX script uploaded    ✖
userId The unique identifier of the user    ✖

Example Response

{
    "api_version": 2,
    "error": null,
    "result": {
        "id": 50969227,
        "name": "New_Name",
        "draftId": "td_2015_05_05_21_15_13_67295_9842",
        "userId": 674495,
        "created": 1430849615,
        "updated": 1432758706,
        "configuration": {
            "location": "us-central1-a",
            "type": "jmeter",
            "concurrency": 50,
            "dedicatedIpsEnabled": false,
            "plugins": {
                "splitCSV": {
                    "enabled": false
                },
                "reportEmail": {
                    "enabled": true
                },
                "jmeter": {
                    "filename": "Demo.jmx",
                    "version": "2.11blazemeter",
                    "override": {
                        "rampup": 300,
                        "iterations": -1,
                        "duration": 50
                    }
                }
            }
        }
    },
    "test": {
        "id": 50969227,
        "name": "New_Name",
        "draftId": "td_2015_05_05_21_15_13_67295_9842",
        "userId": 674495,
        "created": 1430849615,
        "updated": 1432758706,
        "configuration": {
            "location": "us-central1-a",
            "type": "jmeter",
            "concurrency": 50,
            "dedicatedIpsEnabled": false,
            "plugins": {
                "splitCSV": {
                    "enabled": false
                },
                "reportEmail": {
                    "enabled": true
                },
                "jmeter": {
                    "filename": "Demo.jmx",
                    "version": "3.1",
                    "override": {
                        "rampup": 300,
                        "iterations": -1,
                        "duration": 50
                    }
                }
            }
        }
    }
}
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.