-
Notifications
You must be signed in to change notification settings - Fork 3
Peer API
{
"name": "Peer1",
"deliveryPolicy": "AT_LEAST_ONE",
"peerAddressList": [
{
"type": "Email",
"values": [
"some.email@provider.com"
]
},
{
"type": "REST",
"values": [
"http://localhost:8080/peer1"
]
}
]
}
GET | `/{id}` | Get a peer with a given id |
POST | `/` | Create a new peer (id is either set already or will be created) |
PUT | `/` | Update a peer |
DELETE | `/{id}` | Delete a peer with a given id |
GET | `/all` | Get all available peers |
DELETE | `/all` | Delete all peers |
GET | `/download` | Download a file containing all available peers |
POST | `/upload` | Upload a file containing a one or multiple peers |
Returns a peer with a given id. Returns a JSON object of Peer.
Parameter:
id required - defines the id of the peer
Respond:
200 peer instance is returned in the body
404 there is no peer with such an id
Create a new peer. 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 peer JSON object
Respond:
200 resource has been created and the created peer (with id) is returned in the body
409 resource could not be created because the id already exists
Updates an existing peer. Note that it is not possible to change the ID. Returns a JSON object of Peer.
Parameter:
body required - instance of a peer JSON object
Respond:
200 peer instance is returned in the body
404 there is no such peer
Deletes a peer with a given id. Returns a JSON object of deleted peer.
Parameter:
id required - defines the id of the peer
Respond:
200 peer instance is returned in the body
404 there is no peer with such an id
Returns all available peers as a list of JSON objects.
Respond:
200 list of peer instance is returned in the body
Deletes all available peers. Note: this action is irreversible!
Respond:
200 all peers have been deleted
Download a file containing all available peers
Respond:
200 file is attached in the header of the response
Upload a file containing peers. The optional parameter delete (default is true) defines if all the available peers should be deleted before inserting the ones from the file.
Parameter:
file required - parameter that defines the file with the peers
delete optional (default is true) - defines if currently available peers should be deleted
Respond:
200 peers 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