Creates a new Endpoint test in ThousandEyes, based on properties provided in the POST data. In order to create a new test, the user attempting the creation must be an Account Admin.
Regular users are blocked from using any of the POST-based methods.
Request
Example - http test
$ curl -i https://api.thousandeyes.com/v6/endpoint-tests/http-server/new.json \
-d '{ "authType": "NONE",
"flagPing": true,
"flagTraceroute": true,
"groupId": 42,
"httpTimeLimit": 5000,
"maxMachines": 5,
"interval" : 3600,
"sslVersion": 0,
"targetResponseTime": 5000,
"testName": "HTTP test",
"url": "www.example.com",
"verifyCertHostname": true
}' \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-u noreply@thousandeyes.com:g351mw5xqhvkmh1vq6zfm51c62wyzib2
Field | Data Type | Units | Notes |
---|
testName | string | n/a | - |
url | string | n/a | test target URL, for example “www.example.com”. Optionally, it can specify a protocol (http or https). If the protocol is not specified, “https” is used by default |
maxMachines | integer | [1-5000] | maximal number of agents which can execute this test |
interval | Required | Optional | integer |
[120, 300, 600, 900, 1800, 3600] | interval in seconds that the test will execute on | groupId | integer |
n/a | unique ID of the label, which can be retrieved or created by Labels API | sslVersion | integer |
n/a | ssl protocol version (0 - AUTO, 3 - SSL v3, 4 - TSL v1.0, 5 - TSL 1.1, 6 - TSL 1.2) | targetResponseTime | integer |
milliseconds | affects the colours of agents and legends on the view page. The value is compared with actual response time in order to determine the color scale (from green to red) | verifyCertHostname | boolean |
n/a | flag indicating if a certificate should be verified | authType | string |
n/a | authentication type: NONE, BASIC or NTLM | username | string |
n/a | user name if authentication was specified to BASIC or NTLM | password | string |
n/a | password if authentication was specified to BASIC or NTLM | httpTimeLimit | integer |
milliseconds | maximum amount of time in milliseconds the agents wait before a request times out | flagPing | boolean |
n/a | optional flag indicating if test should run ping. If not specified, true is used by default | flagTraceroute | boolean |
n/a | optional flag indicating if test should run traceroute. If not specified, true is used by default | port | integer |
n/a | port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443) |
Example - network test
$ curl -i https://api.thousandeyes.com/v6/endpoint-tests/agent-to-server/new.json \
-d '{ "flagPing": true,
"flagTraceroute": true,
"interval" : 3600,
"groupId": "23020",
"maxMachines": 5,
"serverName": "www.example.com",
"port": 80,
"testName": "Network test"
}' \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-u noreply@thousandeyes.com:g351mw5xqhvkmh1vq6zfm51c62wyzib2
Field | Data Type | Units | Notes |
---|
testName | string | n/a | - |
serverName | string | n/a | a server address without a protocol (for example “www.example.com”) or IP address |
maxMachines | integer | [1-5000] | maximal number of agents which can execute this test |
interval | Required | Optional | integer |
[120, 300, 600, 900, 1800, 3600] | interval in seconds that the test will execute on | groupId | integer |
n/a | unique ID of the label, which can be retrieved or created by Labels API | flagPing | boolean |
n/a | optional flag indicating if test should run ping. If not specified, true is used by default | flagTraceroute | boolean |
n/a | optional flag indicating if test should run traceroute. If not specified, true is used by default | port | integer |
n/a | port number, if not specified, it’s set to 80 by default |
Response
If a test is successfully created, an HTTP/201 CREATED response will be returned, and the test definition will be returned. See the example below.
Response does not include the results of the test. Once the test has been run, results can be retrieved using Endpoint Test Data endpoints. API test data endpoints URLs are provided in test definition output upon test creation. See the example below.
HTTP/1.1 201 Created
Server: nginx
Date: Mon, 17 Feb 2020 13:41:02 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: no-store
X-Organization-Rate-Limit-Limit: 600
X-Organization-Rate-Limit-Remaining: 599
X-Organization-Rate-Limit-Reset: 1490622120
Strict-Transport-Security: max-age=31536000
X-Server-Name: 1-3
For more information on our HTTP response status codes, see the response status codes documentation.
Body
{
"endpointTest": [
{
"alertsEnabled": 0,
"apiLinks": [
{
"href": "https://api.thousandeyes.com/v6/endpoint-data/tests/net/metrics/9902783",
"rel": "data"
},
{
"href": "https://api.thousandeyes.com/v6/endpoint-data/tests/net/path-vis/9902783",
"rel": "data"
},
{
"href": "https://api.thousandeyes.com/v6/endpoint-data/tests/web/http-server/9902783",
"rel": "data"
},
{
"href": "https://api.thousandeyes.com/v6/endpoint-tests/9902783",
"rel": "self"
}
],
"authType": "NONE",
"bandwidthMeasurements": 0,
"bgpMeasurements": 0,
"createdBy": "API User (noprely@thousandeyes.com)",
"createdDate": "2020-02-17 11:11:19",
"enabled": 1,
"followRedirects": 1,
"httpTargetTime": 5000,
"httpTimeLimit": 5000,
"httpVersion": 1,
"interval": 60,
"modifiedBy": "API User (noprely@thousandeyes.com)",
"modifiedDate": "2020-02-17 11:11:19",
"mtuMeasurements": 0,
"networkMeasurements": 1,
"port": 443,
"protocol": "TCP",
"savedEvent": 0,
"server": "www.example.com",
"sslVersion": "Auto",
"sslVersionId": 0,
"testId": 9902783,
"testName": "HTTP test",
"type": "http-server",
"url": "https://www.example.com",
"useNtlm": 0,
"usePublicBgp": 0,
"username": "",
"verifyCertificate": 1
}
]
}