169
edits
m (→Terminology) |
|||
| Line 125: | Line 125: | ||
* '''Client Queue''': Entity within the message broker where all messages destined for a particular client of a user are sent (i.e. one queue per client). | * '''Client Queue''': Entity within the message broker where all messages destined for a particular client of a user are sent (i.e. one queue per client). | ||
== | == Agent API == | ||
The | The Agent API consists of a standard REST API, using HTTP GET, POST, PUT, and DELETE commands to retrieve and manipulate resources. The following table gives a summary of the API supported by the Agent: | ||
=== | {| class="wikitable" | ||
|- | |||
''' | ! GET | ||
! POST | |||
! PUT | |||
! DELETE | |||
! Path | |||
! Description | |||
|- | |||
| style="text-align: center;"| | |||
| style="text-align: center;"|X | |||
| style="text-align: center;"| | |||
| style="text-align: center;"| | |||
| /notifications | |||
| Used by web apps to send notifications. The body of the HTTP request should contain a JSON string of the following form: | |||
<pre> | |||
{"routing_key": "routing_key", | |||
"type": "the type of notification", | |||
"timestamp": "UNIX timestamp", | |||
"payload": "notification message"} | |||
</pre> | |||
All fields are mandatory. | |||
|- | |||
| style="text-align: center;"| X | |||
| style="text-align: center;"| | |||
| style="text-align: center;"| | |||
| style="text-align: center;"| | |||
| /users/'''name'''/subscriptions | |||
| Retrieves all subscriptions for the user with the specified name. Only the authenticated user corresponding to '''name''' has permission to view this list. The list is returned as a JSON string of the form: | |||
<pre> | |||
[{"routing_key": "routing_key", | |||
"app_name": "Name of app", | |||
"app_host": "domain of app"}, | |||
... | |||
] | |||
</pre> | |||
Each item in the JSON array corresponds to a subscription for the specified user. | |||
|- | |||
| style="text-align: center;"| | |||
| style="text-align: center;"| | |||
| style="text-align: center;"|X | |||
| style="text-align: center;"| | |||
| /users/'''name''' | |||
| To PUT a user (i.e. create new user account) you'll need an HTTP body looking like the following: | |||
<pre> | <pre> | ||
{ | {"password": "user's account password"} | ||
} | |||
</pre> | </pre> | ||
|} | |||
== Security Considerations == | == Security Considerations == | ||
edits