Shared Data Server - Get
This Eggplant Performance Test Controller REST method reads the value associated with the specified key in the Shared Data Server.
For this method to work, Shared Data Server must be running on the same machine as the Test Controller REST server. This is usually accomplished by enabling the Start the Shared Data Server at the beginning of the test option on the Test View > Shared Data Server tab in Studio.
URL
/test_controller/api/1.0/shared_data_server/get
HTTP Method
GET: Gets the value associated with the specified key in the Shared Data Server
URL Query Parameters
The following can be added to the URL as query parameters:
Parameter | Description |
---|---|
key | The key of a shared variable in Shared Data Server. |
timeout | A time interval, expressed in milliseconds. If the specified key does not yet exist, the server will wait up to this long before returning a 400 error. Pass 0 to check and return immediately, or -1 to wait forever. (Optional, default is 0 ) |
The specified key
must relate to a shared variable in Shared Data Server. Shared lists are currently not accessible via this API.
Response Parameters
Parameter | Type | Description |
---|---|---|
<key> | String or integer | The value of the shared variable associated with the specified key in Shared Data Server. |
If the specified key
does not exist and has not been created by the time the timeout
elapses, the response status will be 400
and the response body JSON will contain an error
key.
Example Request
http:/test_controller/api/1.0/shared_data_server/get?key=my_key&timeout=10000
Example Response
{
"my_key": "my_value"
}