Previous Article | matchIT Hub Index | Next Article |
Resources relative to http://host:8080/matchITHub/engines/<engine>
REST resource | Summary |
---|---|
POST tables/<0,1,2> | Add a single data record to a table. Form data: data=<data> timeout=<timeout> |
POST tables/<0,1,2> | Add a block of data to a table. <data_block> |
POST tables/<0,1,2>/files | Specify a filename for the service to load input data from. Form data:filename=<filename> delimiter=<delim> nomore="true"/"false" encoding=<encoding> timeout=<timeout> |
POST tables/<0,1,2>/update | Update a data record, the unique ref of the record to update is extracted from data Form data:data=<data> timeout=<timeout> |
POST tables/<0,1,2>/update | Upload a block of transactions to a table <data_block> |
POST tables/<0,1,2>/update/files | Specify a filename for the service to load transactions from Form data: filename=<filename> delimiter=<delim> nomore="true"/"false" encoding=<encoding> timeout=<timeout> |
PUT tables/<0,1,2>/eof | Inform the engine that no more data will be added |
DELETE tables/<0,1,2>/eof | Inform the engine to allow more data to be added |
GET unprocessed | Returns the number of unprocessed records |
GET tables/<0,1,2>/<unique_ref> | Get a record from a table by it’s uniqueId |
DELETE tables/<0,1,2>/<unique_ref> | Delete a record from a table by it’s uniqueId |
DELETE tables/<0,1,2> | Clear the data in a table |
POST /matchITHub/engines/<engine>/tables/<table> data=<data>, timeout=<timeout>
Request
Type | Name | Description |
---|---|---|
PathParam | engine | The id of the engine to modify |
PathParam | table | The number of the table to modify (0, 1, or 2) |
FormParam | data | A data record to add |
FormParam | timeout | Timeout in milliseconds (default 1000) |
Description
Adds data to the engine's input 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-urlencode "data=,57,MR,MATTHEW,KASPAR,AVIATION SERVICES INC,14824 BOWE ROAD,BARNWELD,NEW YORK,13304" --data-urlencode "timeout=1000" http://localhost:8080/matchITHub/engines/1/tables/1 {"status":"OK"}
POST /matchITHub/engines/<engine>/tables/<table> <data_block>
Request
Type | Name | Description |
---|---|---|
PathParam | engine | The id of the engine to modify |
PathParam | table | The number of the table to modify (0, 1, or 2) |
text/plain | n/a | Block of data records |
Description
Uploads a block of data records to add to the engine's input buffer.
The content of this POST is a plain text block of records. Records should be separated by a new line characters and each record must start with the delimiter character used for that record.
POST /matchITHub/engines/<engine>/tables/<table>/files filename=<filename>, delimiter=<delim>, nomore="true/false", encoding=<encoding>, timeout=<timeout>
Request
Type | Name | Description |
---|---|---|
PathParam | engine | The id of the engine to modify |
PathParam | table | The number of the table to modify (0, 1, or 2) |
FormParam | filename | Name of input file to load data from |
FormParam | delimiter | The field delimiter used in the file |
FormParam | nomore | "true" if no more data will be added to this table |
FormParam | encoding | The encoding used 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
Specify a filename for the service to load input data from. Filenames are added to a list and processed in the order added. If no delimiter is specified, each record must start with the delimiter character used for that record. If no encoding is specified, UTF-8 is used. The file must be accessible from the service. If adding data from a different machine, post the data in blocks or use the Proxy Engine.
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-urlencode "filename=D:\testdata\inputfile.txt" --data-urlencode "delimiter=\t" --data-urlencode "encoding=UTF-8" --data "nomore=true" http://localhost:8080/matchITHub/engines/1/tables/1/files {"status":"OK"}
POST /matchITHub/engines/<engine>/tables/<table>/update data=<data>, timeout=<timeout>
Request
Type | Name | Description |
---|---|---|
PathParam | engine | The id of the engine to modify |
PathParam | table | The number of the table to modify (0, 1, or 2) |
FormParam | data | A data record to update |
FormParam | timeout | Timeout in milliseconds (default 1000) |
Description
Update a record with the new data. The unique ID of the record to update is extracted from the data.
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.
POST /matchITHub/engines/<engine>/tables/<table>/update <block_data>
Request
Type | Name | Description |
---|---|---|
PathParam | engine | The id of the engine to modify |
PathParam | table | The number of the table to modify (0 or 1) |
text/plain | n/a | Block of transaction records |
Description
Uploads a block of transaction records to add to the engine's input buffer.
The content of this POST is a plain text block of records. Records should be separated by a new line characters and each record must start with the delimiter character used for that record.
Transactions
The first field in a transaction is the transaction type. Transaction types are:
- A(dd)
- U(pdate)
- D(elete)
The rest of the fields depend on the transaction type. I.e.:
- |A|record
- |U|record
- |D|unique_ref
or - |D|record
Where <record> is the record (matching the table layout) to add or update and <unique_ref> identifies the record to delete. A delete transaction can either contain just the unique_ref of the record to delete or can contain a record matching the table layout that contains the unique_ref - all other fields are ignored and can be empty.
POST /matchITHub/engines/<engine>/tables/<table>/update/files filename=<filename>, delimiter=<delim>, nomore="true/false", encoding=<encoding>, timeout=<timeout>
Request
Type | Name | Description |
---|---|---|
PathParam | engine | The id of the engine to modify |
PathParam | table | The number of the table to modify (0, 1, or 2) |
FormParam | filename | Name of input file to load data from |
FormParam | delimiter | The field delimiter used in the file |
FormParam | nomore | "true" if no more data will be added to this table |
FormParam | encoding | The encoding used 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
Specify a filename for the service to load update transaction data from. Filenames are added to the same list used for input data and processed in the order added. If no delimiter is specified, each record must start with the delimiter character used for that record. 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.
PUT /matchITHub/engines/<engine>/tables/<table>/eof
Request
Type | Name | Description |
---|---|---|
PathParam | engine | The id of the engine to modify |
PathParam | table | The number of the table to modify (0, 1, or 2) |
Description
Informs the engine that no more data will be added for the indicated table.
Usage Example
Using cURL:
curl -X PUT http://localhost:8080/matchITHub/engines/1/tables/1/eof {"status":"OK"}
DELETE /matchITHub/engines/<engine>/tables/<table>/eof
Request
Type | Name | Description |
---|---|---|
PathParam | engine | The id of the engine to modify |
PathParam | table | The number of the table to modify (0, 1, or 2) |
Description
Informs the engine to allow more data to be added for the indicated table.
Usage Example
Using cURL:
curl -X DELETE http://localhost:8080/matchITHub/engines/1/tables/1/eof {"status":"OK"}
GET /matchITHub/engines/<engine>/unprocessed
Request
Type | Name | Description |
---|---|---|
PathParam | engine | The id of the engine to query |
Response
Name | Value | Description |
---|---|---|
unprocesseCount | <count> | Count of unprocessed records |
Description
Returns the number of records that have not yet been processed.
Usage Examples
Using a browser:
Using cURL:
curl http://localhost:8080/matchITHub/engines/1/unprocessed {"status":"OK","unprocessedCount":0}
GET /matchITHub/engines/<engine>/tables/<table>/<unique_ref>
Request
Type | Name | Description |
---|---|---|
PathParam | engine | The id of the engine to modify |
PathParam | table | The number of the table to modify (0, 1, or 2) |
PathParam | engine | The unique ID of the record to fetch |
Response
Name | Value | Description |
---|---|---|
result | <data record> | The record requested |
Description
Get a record with the specified unique ID.
Usage Examples
Using a browser:
Using cURL:
curl http://localhost:8080/matchITHub/engines/1/tables/1/17 {"status":"OK","result":"\t17\tROBERT HANSEN\tSTATEWEST AIRLINES INC\t4909 EAST MCDOWELL ROAD\tFT COLLINS\tCOLORADO\t80524"}
DELETE /matchITHub/engines/<engine>/tables/<table>/<unique_ref>
Request
Type | Name | Description |
---|---|---|
PathParam | engine | The id of the engine to modify |
PathParam | table | The number of the table to modify (0, 1, or 2) |
PathParam | unique_ref | The unique ID of the record to delete |
Description
Delete a record with the specified unique ID.
Usage Example
Using cURL:
curl -X DELETE http://localhost:8080/matchITHub/engines/1/tables/1/17 {"status":"OK"}
DELETE /matchITHub/engines/<engine>/tables/<table>
Request
Type | Name | Description |
---|---|---|
PathParam | engine | The id of the engine to modify |
PathParam | table | The number of the table to modify (0, 1, or 2) |
HeaderParam | async | Introduced in v2.0.4.27. Delete table asynchronously (true, false). Defaults to false |
Description
Removes and discards all data relating to the indicated table. This includes: buffered input data, cached records, clusters, matching pairs, matching groups.
Usage Example
Using cURL:
curl -X DELETE -H "async: true" http://localhost:8080/matchITHub/engines/1/tables/2 {"status":"OK"}
Previous Article | matchIT Hub Index | Next Article |