Previous Article | matchIT Hub Index | Next Article |
Resources relative to http://host:8080/matchITHub
Before you can start adding data to the matchIT Hub Service you must create an instance of a Hub Engine.
REST resource | Summary |
---|---|
GET engines | get a list of instantiated engines |
POST engines | create engine/session and initialize. Form data: activation_code=<code> |
DELETE engines/<engine id> | delete engine/session |
GET /matchITHub/engines
Response
Name | Value | Description |
---|---|---|
ids | <engine>,<engine>,... | Comma separated list of the ids of all current engine instances |
Description
Returns a list of active engine numbers.
Usage Examples
Using a browser:
Using cURL:
curl -X GET http://localhost:8080/matchITHub/engines {"status":"OK","ids":""}
POST /matchITHub/engines
Request
Type | Name | Description |
---|---|---|
FormParam | activation_code | The hub activation code |
FormParam | name | A name to give the engine instance |
Response
Name | Value | Description |
---|---|---|
Engine | <engine> | The id of a newly created engine instance |
Description
Initialises an instance of the engine and applies the activation_code.
The activation_code can be omitted, in which case a valid activation code must be PUT to the Initialization resource before the engine instance can be used.
If you supply a name for an instance, you can use this as <engine> in the url instead of the instance number.
Usage Example
Using cURL:
curl -X POST --data "activation_code=<activation_code>" http://localhost:8080/matchITHub/engines {"status":"OK","engine":1}Or:
curl -X POST --data-urlencode "activation_code@activation.txt" http://localhost:8080/matchITHub/engines {"status":"OK","engine":1}
DELETE /matchITHub/engines/<engine>?force=true/false
Request
engineType | Name | Description |
---|---|---|
PathParam | engine | The id number (or name) of the engine instance to delete |
QueryParam | force | True/false. Force the deletion of an engine that is in use. (default false) |
Description
Deletes the specified engine instance. If the instance is in use (i.e., it has unprocessed input records or unretrieved results), a 403 (FORBIDDEN) error is returned unless force=true is specified.
Usage Example
Using cURL:
If the engine is not in use:
curl -X DELETE http://localhost:8080/matchITHub/engines/1
{"status":"OK"}
If the engine is in use:
curl -X DELETE http://localhost:8080/matchITHub/engines/1
{"status":"FAIL","errorMsgs":["Engine in use. Specify force=true to override."]}
curl -X DELETE "http://localhost:8080/matchITHub/engines/1?force=true"
{"status":"OK"}
NOTE: In the last example, quotes are required around the url when ?force=true is included at the end.
Previous Article | matchIT Hub Index | Next Article |