| Previous Article | matchIT Hub Index | Next Article |
Resources relative to http://host:8080/matchITHub/engines/<engine>
| REST resource | Summary |
|---|---|
| GET results/count | Returns the number of buffered results |
| POST results/next | Returns the next buffered result Form data: timeout=<timeout> |
| POST results | Download a block of results as plain text Form data: timeout=<timeout> |
| POST results/outputfile | Specify a filename for the service to write results to Form data:filename=<filename> encoding=<encoding> timeout=<timeout> |
| DELETE results | Clear the results |
GET /matchITHub/engines/<engine>/results/count
Request
| Type | Name | Description |
|---|---|---|
| PathParam | engine | The id of the engine to query |
Response
| Name | Value | Description |
|---|---|---|
| resultCount | <count> | Count of results |
Description
Returns the number of buffered results in the output buffer.
Usage Example
Using cURL:
curl http://localhost:8080/matchITHub/engines/1/results/count
{"status":"OK","resultCount":0}
POST /matchITHub/engines/<engine>/results/next timeout=<timeout>
Request
| Type | Name | Description |
|---|---|---|
| PathParam | engine | The id of the engine to query |
| FormParam | timeout | Timeout in milliseconds (default 1000) |
Response
| Name | Value | Description |
|---|---|---|
| result | <record> | Result record |
Description
Gets and returns the next buffered result and removes it from the output buffer.
If it fails to lock the engine for timeout milliseconds it will wait 2 seconds before trying again. Timeout should be non-zero to avoid deadlocking the engine.
Usage Example
Using cURL:
curl -X POST --data "timeout=1000" http://localhost:8080/matchITHub/engines/1/results/next
{"status":"OK","result":"\tMG\tlevel\tgroup\tbase_score\ttable\trecord"}
POST /matchITHub/engines/<engine>/results timeout=<timeout>
Request
| Type | Name | Description |
|---|---|---|
| PathParam | engine | The id of the engine to query |
| FormParam | timeout | Timeout in milliseconds (default 1000) |
| FormParam | limit | The maximum number of records to return in one go |
Response
Unlike other methods, this method does not return a application/json format response. Instead the response is a text/plain block of records delimited by newline
Description
Gets and returns all the results as a block of plain text.
If it fails to lock the engine for timeout milliseconds it will wait 2 seconds before trying again. Timeout should be non-zero to avoid deadlocking the engine.
Usage Example
Using cURL:
curl -X POST --data "timeout=1000" http://localhost:8080/matchITHub/engines/1/results
MG I 56 105 0 57
MG I 26 118 0 26
MG I 26 118 0 35
MG I 4 119 0 4
MG I 4 119 0 71
MG I 10 98 0 10
MG I 10 98 0 65
MG I 10 98 0 64
MG I 80 130 0 80
MG I 80 130 0 81
MG I 38 103 0 38
MG I 38 103 0 63
MG I 113 139 0 113
MG I 113 139 0 74
MG I 15 113 0 15
MG I 15 113 0 123
POST /matchITHub/engines/<engine>/results/outputfile filename=<filename>, encoding=<encoding>, timeout=<timeout>
Request
| Type | Name | Description |
|---|---|---|
| PathParam | engine | The id of the engine to query |
| FormDataParam | filename | Name of output file to write results to |
| FormParam | encoding | The encoding to use in the file: "UTF-8" (default), "ISO-8859-1", "US-ASCII", "UTF-16", "UTF-16BE", "UTF-16LE" |
| FormParam | timeout | Timeout in milliseconds (default 1000) |
Description
Sets the output filename for the Hub Service to write results to. If no encoding is specified, UTF-8 is used.
If it fails to lock the engine for timeout milliseconds it will wait 2 seconds before trying again. Timeout should be non-zero to avoid deadlocking the engine.
Usage Example
Using cURL:
curl -X POST --data "filename=D:\testing\outputfile.txt" http://localhost:8080/matchITHub/engines/1/results/outputfile
{"status":"OK"}
DELETE /matchITHub/engines/<engine>/results
Request
| Type | Name | Description |
|---|---|---|
| PathParam | engine | The id of the engine to modify |
Description
The output buffer is cleared; any buffered results are lost.
Usage Example
Using cURL:
curl -X DELETE http://localhost:8080/matchITHub/engines/1/results
{"status":"OK"}
| Previous Article | matchIT Hub Index | Next Article |