Contents:
High Level Design
![](/download/attachments/25464461/High%20Level%20Design.png?version=1&modificationDate=1303452932222&api=v2)
Web UI Mockups
Info |
---|
All comments (from anyone) are welcome! Please add your comments to the first mockup page listed below, as it represents the latest thinking. |
REST API Design
Introduction
The CloudSync REST API is a web-accessible, resource-oriented API that exposes operations on the key entities of the service:
...
Code Block |
---|
http://example.org/cloudsync/api/rest/ |
Common MIME Types, Status Codes, and Response Headers
- Unless otherwise stated, requests and responses will always be in JSON or XML format. The default format is XML ("application/xml") unless ".json" is specified at the end of the URL or content negotiation is used to denote a preference for the "application/json" MIME type.
- When GET is used to retrieve information about a resource, success is indicated by a 200 OK response code.
- When POST is used to add a resource (e.g. addTaskcreateTask), a successful (201 Created) response will include a Content-Location header that provides the URI of the new resource. The last portion of that URI will be the newly-allocated id of that resource, which is an opaque, URI-safe string, and the response body will be the representation of the new resource, as if GET had been called on the new URI.
- When PUT is used to update a resource (e.g. updateTask), success is indicated by a 200 OK response code, and the response body will be the updated representation of the resource, as if requested via GET.
- When DELETE is used to remove a resource (e.g. deleteTask), success is indicated by a 204 No Content response code, and the response body will be empty.
Configuration
getConfiguration
Code Block |
---|
GET /cloudsync/api/rest/configuration |
updateConfiguration
Code Block |
---|
PUT /cloudsync/api/rest/configuration |
Users
createUser
Code Block |
---|
POST /cloudsync/api/rest/users |
listUsers
Code Block |
---|
GET /cloudsync/api/rest/users |
getUser
Code Block |
---|
GET /cloudsync/api/rest/users/{id} |
updateUser
Code Block |
---|
PUT /cloudsync/api/rest/users/{id} |
deleteUser
Code Block |
---|
DELETE /cloudsync/api/rest/users/{id} |
Tasks
createTask
Code Block |
---|
POST /cloudsync/api/rest/tasks |
listTasks
Code Block |
---|
GET /cloudsync/api/rest/tasks |
getTask
Code Block |
---|
GET /cloudsync/api/rest/tasks/{id} |
updateTask
Code Block |
---|
PUT /cloudsync/api/rest/tasks/{id} |
deleteTask
Code Block |
---|
DELETE /cloudsync/api/rest/tasks/{id} |
Object Sets
...
createObjectSet
Code Block |
---|
POST /cloudsync/api/rest/objectsets |
...
listObjectSets
Code Block |
---|
GET /cloudsync/api/rest/objectsets |
...
getObjectSet
Code Block |
---|
GET /cloudsync/api/rest/objectsets/{id} |
...
updateObjectSet
Code Block |
---|
PUT /cloudsync/api/rest/objectsets/{id} |
...
deleteObjectSet
Code Block |
---|
DELETE /cloudsync/api/rest/objectsets/{id} |
Object Stores
...
createObjectStore
Code Block |
---|
POST /cloudsync/api/rest/objectstores |
...
listObjectStores
Code Block |
---|
GET /cloudsync/api/rest/objectstores |
...
getObjectStore
Code Block |
---|
GET /cloudsync/api/rest/objectstores/{id} |
...
queryObjectStore
Code Block |
---|
GET /cloudsync/api/rest/objectstores/{id}/objects[?set={objectset-idset}&limit={limit}&offset={offset}] |
...
updateObjectStore
Code Block |
---|
PUT /cloudsync/api/rest/stores/{id} |
...
deleteObjectStore
Code Block |
---|
DELETE /cloudsync/api/rest/stores/{id} |
System Logs
listSystemLogs
Code Block |
---|
GET /cloudsync/api/rest/logs/systemsystemlogs |
getSystemLog
Code Block |
---|
GET /cloudsync/api/rest/logs/system/systemlogs/{id} |
getSystemLogContent
(Returns text/plain content)
Code Block |
---|
GET /cloudsync/api/rest/systemlogs/{id}/content |
deleteSystemLog
Code Block |
---|
DELETE /cloudsync/api/rest/logs/systemsystemlogs/{id} |
Task Logs
listTaskLogs
Code Block |
---|
GET /cloudsync/api/rest/logs/taskstasklogs |
getTaskLog
Code Block |
---|
GET /cloudsync/api/rest/logs/tasks/tasklogs/{id} |
getTaskLogContent
(Returns text/plain content)
Code Block |
---|
GET /cloudsync/api/rest/tasklogs/{id}/content |
deleteTaskLog
Code Block |
---|
DELETE /cloudsync/api/rest/logs/taskstasklogs/{id} |