You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 29
Next »
Contents:
High Level Design
![](/download/attachments/25464461/High%20Level%20Design.png?version=1&modificationDate=1303452932222&api=v2)
Web UI Mockups
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:
- Configuration: Properties that affect the global behavior of the application.
- Users: Users that can login to the application. Includes per-user preferences.
- Tasks: Define work that is to be performed or is currently being performed.
- Object Sets: Specifications of groups of Fedora Objects for use with tasks.
- Object Stores: Sources or destinations of Fedora Objects and associated Datastreams.
- System Logs: Raw, text/plain logs of the application. Includes everything except Task Logs.
- Task Logs: Raw, text/plain logs of running or completed tasks.
The exact attributes and representations of these entities have not yet been determined.
The base URL of all REST API operations is the URL of the cloudsync app, plus /api/rest/. For example:
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. addTask), 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.
- 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
GET /cloudsync/api/rest/configuration
updateConfiguration
PUT /cloudsync/api/rest/configuration
Users
createUser
POST /cloudsync/api/rest/users
listUsers
GET /cloudsync/api/rest/users
getUser
GET /cloudsync/api/rest/users/{id}
updateUser
PUT /cloudsync/api/rest/users/{id}
deleteUser
DELETE /cloudsync/api/rest/users/{id}
Tasks
createTask
POST /cloudsync/api/rest/tasks
listTasks
GET /cloudsync/api/rest/tasks
getTask
GET /cloudsync/api/rest/tasks/{id}
updateTask
PUT /cloudsync/api/rest/tasks/{id}
deleteTask
DELETE /cloudsync/api/rest/tasks/{id}
Object Sets
createSet
POST /cloudsync/api/rest/objectsets
listSets
GET /cloudsync/api/rest/objectsets
getSet
GET /cloudsync/api/rest/objectsets/{id}
updateSet
PUT /cloudsync/api/rest/objectsets/{id}
deleteSet
DELETE /cloudsync/api/rest/objectsets/{id}
Object Stores
createStore
POST /cloudsync/api/rest/objectstores
listStores
GET /cloudsync/api/rest/objectstores
getStore
GET /cloudsync/api/rest/objectstores/{id}
queryStore
GET /cloudsync/api/rest/objectstores/{id}/objects[?set={objectset-id}&limit={limit}&offset={offset}]
updateStore
PUT /cloudsync/api/rest/stores/{id}
deleteStore
DELETE /cloudsync/api/rest/stores/{id}
System Logs
listSystemLogs
GET /cloudsync/api/rest/logs/system
getSystemLog
GET /cloudsync/api/rest/logs/system/{id}
deleteSystemLog
DELETE /cloudsync/api/rest/logs/system/{id}
Task Logs
listTaskLogs
GET /cloudsync/api/rest/logs/tasks
getTaskLog
GET /cloudsync/api/rest/logs/tasks/{id}
deleteTaskLog
DELETE /cloudsync/api/rest/logs/tasks/{id}