Endpoint Instant Tests

POST /v6/endpoint-instant/{testType} Creating instant test

Creates and runs a new Endpoint Instant test in ThousandEyes, based on properties provided in the POST data. In order to create and run an Instant test, the user attempting the creation must have Edit endpoint tests permission.

Request

  • {testType} corresponds to any of the following options:

    • agent-to-server - endpoint network test
    • http-server - endpoint http test
  • Request body should contain fields to be set during creation.

Body example - http test

{ "authType": "NONE", "flagPing": true, "flagTraceroute": true, "groupId": "26286", "httpTimeLimit": 5000, "maxMachines": 5, "sslVersion": 0, "targetResponseTime": 5000, "testName": "HTTP test", "url": "www.example.com", "verifyCertHostname": true }

FieldData TypeUnitsNotes
testNamestringn/a-
urlstringn/atest 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
maxMachinesinteger[1-100000]maximal number of agents which can execute this test
groupIdintegern/aunique ID of the label, which can be retrieved or created by Labels API
sslVersionintegern/assl protocol version (0 - AUTO, 3 - SSL v3, 4 - TSL v1.0, 5 - TSL 1.1, 6 - TSL 1.2)
targetResponseTimeintegermillisecondsaffects 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)
verifyCertHostnamebooleann/aflag indicating if a certificate should be verified
authTypestringn/aauthentication type: NONE, BASIC or NTLM
usernamestringn/auser name if authentication was specified to BASIC or NTLM
passwordstringn/apassword if authentication was specified to BASIC or NTLM
httpTimeLimitintegermillisecondsmaximum amount of time in milliseconds the agents wait before a request times out
flagPingbooleann/aoptional flag indicating if test should run ping. If not specified, true is used by default
flagTraceroutebooleann/aoptional flag indicating if test should run traceroute. If not specified, true is used by default
portintegern/aport number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443)

Body example - network test

{ "flagPing": true, "flagTraceroute": true, "groupId": "23020", "maxMachines": 5, "serverName": "www.example.com", "testName": "Network test" }

FieldData TypeUnitsNotes
testNamestringn/a-
serverNamestringn/aa server address without a protocol (for example “www.example.com”) or IP address
maxMachinesinteger[1-100000]maximal number of agents which can execute this test
groupIdintegern/aunique ID of the label, which can be retrieved or created by Labels API
flagPingbooleann/aoptional flag indicating if test should run ping. If not specified, true is used by default
flagTraceroutebooleann/aoptional flag indicating if test should run traceroute. If not specified, true is used by default
portintegern/aport number, if not specified, it’s set to 80 by default

Response

If an instant 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 instant test. Once the instant 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 instant 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 } ] }

POST /v6/endpoint-instant/{testId}/rerun Rerunning instant test

Reruns an existing Endpoint Instant test in ThousandEyes. In order to rerun an Instant test, the user attempting this must have Edit endpoint tests permission.

Request

  • {testId} the ID of the Instant test you wish to rerun.
  • There is no request body for this request.

Response

There is no response body for this request. See the example below.

Once the instant test is reran, results can be retrieved using Endpoint Test Data endpoints.

Example

$curl -X POST -i https://api.thousandeyes.com/v6/endpoint-instant/348811/rerun \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -u noreply@thousandeyes.com:g351mw5xqhvkmh1vq6zfm51c62wyzib2

HTTP/1.1 200 OK Server: nginx Date: Tue, 14 Mar 2017 18:10:22 GMT Content-Length: 0 Connection: keep-alive Cache-Control: no-store X-Organization-Rate-Limit-Limit: 970 X-Organization-Rate-Limit-Remaining: 969 X-Organization-Rate-Limit-Reset: 1489515060 X-Instant-Test-Rate-Limit-Limit: 97 X-Instant-Test-Rate-Limit-Remaining: 96 X-Instant-Test-Rate-Limit-Reset: 1489515060 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.