-
Notifications
You must be signed in to change notification settings - Fork 3
Collective API
{
"id": "1",
"peers": [],
"deliveryPolicy": "TO_ALL_MEMBERS"
}
GET | `/{id}` | Get a collective with a given id |
POST | `/` | Create a new collective (id is either set already or will be created) |
PUT | `/` | Update a collective |
PUT | `/{collectiveId}/{peerId}` | Add a peer with id 'peerId' to the collective with id 'collectiveId' |
DELETE | `/{collectiveId}/{peerId}` | Delete a peer with id 'peerId' from the collective with id 'collectiveId' |
DELETE | `/{id}` | Delete a collective with a given id |
GET | `/all` | Get all available collectives |
DELETE | `/all` | Delete all collectives |
GET | `/download` | Download a file containing all available collectives |
POST | `/upload` | Upload a file containing a one or multiple collectives |
Returns a collective with a given id. Returns a JSON object of collective.
Parameter:
id required - defines the id of the collective
Respond:
200 collective instance is returned in the body
404 there is no collective with such an id
Create a new collective. If the id is empty, a new one will be created, otherwise the defined one will be used. Note that if this id already exists, status code 409 will be returned.
Parameter:
body required - instance of a collective JSON object
Respond:
200 resource has been created and the created collective (with id) is returned in the body
409 resource could not be created because the id already exists
Updates an existing collective. Note that it is not possible to change the ID. Returns a JSON object of collective.
Parameter:
body required - instance of a peer JSON object
Respond:
200 collective instance is returned in the body
404 there is no such collective
Add a peer with id 'peerId' to the collective with id 'collectiveId'. Note that it is not checked if the peer really exists!
Parameter:
collectiveId required - id of the collective
peerId required - id of the peer
Respond:
200 collective instance is returned in the body
404 there is no such collective
Delete a peer with id 'peerId' from the collective with id 'collectiveId'.
Parameter:
collectiveId required - id of the collective
peerId required - id of the peer
Respond:
200 collective instance is returned in the body
404 there is no such collective
Deletes a collective with a given id. Returns a JSON object of deleted collective.
Parameter:
id required - defines the id of the collective
Respond:
200 collective instance is returned in the body
404 there is no collective with such an id
Returns all available collectives as a list of JSON objects.
Respond:
200 list of collective instances is returned in the body
Deletes all available collectives. Note: this action is irreversible!
Respond:
200 all collectives have been deleted
Download a file containing all available collective
Respond:
200 file is attached in the header of the response
Upload a file containing collectives as JSON objects. Each line of the passed file corresponds to a single JSON object/collective! The optional parameter delete (default is true) defines if all the available collectives should be deleted before inserting the ones from the file.
Parameter:
file required - parameter that defines the file with the collectives
delete optional (default is true) - defines if currently available collectives should be deleted
Respond:
200 collectives have been uploaded
501 file could not be handled
Copyright (c) 2014 Technische Universitat Wien (TUW), Distributed Systems Group E184 (http://dsg.tuwien.ac.at)
This work was partially supported by the EU FP7 FET SmartSociety (http://www.smart-society-project.eu/).
SmartCom
Communication as a Service