This documents defines common Tapas APIs.
⬅️➡️ denotes a JSON Object and its direction of sending.
AuctionHouse (offering) | AuctionHouse (bidding) | |
---|---|---|
Auction ➡️ (over AuctionStartedEvent via Message Queue*) | HTTP POST @ /auction |
|
HTTP POST @ /bid |
⬅️ Bid | |
Task ➡️ | HTTP POST @ /taskwinner |
* The message queue is offered either by MQTT or PubSubHub.
TaskList (offering) | Bidding party (undefined endpoint) | |
---|---|---|
HTTP PATCH @ /tasks/<task-UUID> |
⬅️ TaskPatch (State.ASSIGNED) | |
(Executes task) | ||
HTTP PATCH @ /tasks/ |
⬅️ TaskPatch (State.EXECUTED, OutputData) |
URL: tapas-auction-house.<publicIP>.nio.io
Port: 8085
Media-Type application/auction+json
Body:
{
"auctionId": "1",
"auctionHouseUri": "https://127.0.0.1:8085/",
"taskUri":"http://example.org/tasks/cef2fa9d-367b-4e7f-bf06-3b1fea35f354",
"taskType":"COMPUTATION",
"deadline":"2021-12-24 12:00:00"
}
- Note that
deadline
is produced by using Java's defaulttoString()
method of thejava.sql.Timestamp
class - The
taskUri
should not only contain the server, but also the/tasks/<task-UUID>
, s.t. the original Task can be fetched
Response Codes
No codes defined as messages are sent by queue
No response body
Media-Type application/bid+json
Body:
{
"auctionId":"1",
"bidderName":"Group1",
"bidderAuctionHouseUri":"http://example.com/",
"bidderTaskListUri":"http://example.com/tasks/"
}
Response Codes
204
(No content) Bid was received and accepted404
(Not found) There never was an auction with that<auctionID>
410
(Gone) The Auction that was requested has already expired
No response body
Media-Type application/task+json
Body (Identical to Task):
{
"taskId":"cef2fa9d-367b-4e7f-bf06-3b1fea35f354",
"taskName":"task1",
"taskType":"COMPUTATION",
"taskStatus":"ASSIGNED",
"originalTaskUri":"http://example.org/tasks/cef2fa9d-367b-4e7f-bf06-3b1fea35f354",
"serviceProvider":"tapas-group1",
"inputData":"1+1",
"outputData":"2"
}
Response Codes
202
(Accepted) The won task is accepted and can be done406
(Not Acceptable) The winning Auction House cannot execute the won task anymore
No response body
Media-Type application/json-patch+json
Body: See tapas-tasks
documentation
Response Codes
200
(Accepted) The patch was applied to the Task404
(Not Found) The Task requested to patch wasn't found406
(Not acceptable) An invalid patch request was made
Response Body For debugging purposes, the patched Task is returned.
Notes
- There is no request body
- The response's task types are the ones that are sought, i.e. that cannot be executed locally (this way, the crawling auction house should subscribe to the discovered auction house if it can offer that service)
Media-Type application/auctionhousediscovery+json
Response Codes
200
(Accepted) The request was received.
Response Body
{
"auctionHouseInfo": [
{
"auctionHouseUri":"http://example.org",
"webSubUri":"http://example.org",
"taskTypes":["COMPUTATION", "RANDOMTEXT"],
"timeStamp":"2021-12-24 12:00:00",
"groupName":"Group3"
},
{
"auctionHouseUri":"http://facemash.com",
"webSubUri":"http://facemash.com",
"taskTypes":["BIGROBOT"],
"timeStamp":"2021-12-24 12:00:00",
"groupName":"Group2"
}
]
}
(Cherrybot or PretendABot)
Input: None
Output: None
(Leubot)
Input: None
Output: None
Input: <OPERAND> <OPERATOR> <OPERAND>
Output: Integer result of computation
Valid Operands: All integers
Valid Operators: +
, -
, *
Input: None
Output: Randomly generated sentence
Input: None
Output: The measured humidity in percent
Input: None
Output: The measured temperature in degrees celsius