Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Contents:

Table of Contents

High Level Design

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.

Children Display
sorttitle
reversetrue

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.
  • Task Logs: Raw, text/plain logs of running or completed tasks.
  • Object Sets: Specifications of groups of Fedora Objects for use with tasks.
  • Object Stores: Sources or destinations of Fedora Objects and associated Datastreams.
  • Global Configuration: Properties that affect the global behavior of the application.
  • User Preferences: Properties that affect an individiaul user's experience of the application.
  • 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.

...

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.

Operations on Tasks

...

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/tasksusers

...

listUsers

Code Block
GET /cloudsync/api/rest/tasksusers

...

getUser

Code Block
GET /cloudsync/api/rest/tasksusers/{id}

...

updateUser

Code Block
PUT /cloudsync/api/rest/tasksusers/{id}

...

deleteUser

Code Block
DELETE /cloudsync/api/rest/tasksusers/{id}

Operations on Task Logs

...

Tasks

createTask

Code Block
POST /cloudsync/api/rest/tasks

listTasks

Code Block
GET /cloudsync/api/rest/tasklogstasks

...

getTask

Code Block
GET /cloudsync/api/rest/tasklogs/tasks/{id}

updateTask

Code Block
PUT /cloudsync/api/rest/tasks/{id}

...

deleteTask

Code Block
DELETE /cloudsync/api/rest/taskslogstasks/{id}

...

Object Sets

...

createObjectSet

Code Block
POST /cloudsync/api/rest/setsobjectsets

...

listObjectSets

Code Block
GET /cloudsync/api/rest/setsobjectsets

...

getObjectSet

Code Block
GET /cloudsync/api/rest/setsobjectsets/{id}

...

updateObjectSet

Code Block
PUT /cloudsync/api/rest/setsobjectsets/{id}

...

deleteObjectSet

Code Block
DELETE /cloudsync/api/rest/setsobjectsets/{id}

...

Object Stores

...

createObjectStore

Code Block
POST /cloudsync/api/rest/storesobjectstores

...

listObjectStores

Code Block
GET /cloudsync/api/rest/storesobjectstores

...

getObjectStore

Code Block
GET /cloudsync/api/rest/storesobjectstores/{id}

...

queryObjectStore

Code Block
GET /cloudsync/api/rest/storesobjectstores/{id}/objects[?set={set-id}&limit={limit}&offset={offset}]

...

updateObjectStore

Code Block
PUT /cloudsync/api/rest/stores/{id}

...

deleteObjectStore

Code Block
DELETE /cloudsync/api/rest/stores/{id}

Operations on Global Configuration

...

System Logs

listSystemLogs

Code Block
GET /cloudsync/api/rest/configsystemlogs

...

getSystemLog

Code Block
PUTGET /cloudsync/api/rest/systemlogs/config

Operations on Users

...

{id}

getSystemLogContent

(Returns text/plain content)

Code Block
POSTGET /cloudsync/api/rest/users

listUsers

Code Block
GET /cloudsync/api/rest/users

...

systemlogs/{id}/content

deleteSystemLog

Code Block
GETDELETE /cloudsync/api/rest/userssystemlogs/{id}

Task Logs

...

listTaskLogs

Code Block
PUTGET /cloudsync/api/rest/users/{id}

...

tasklogs

getTaskLog

Code Block
DELETEGET /cloudsync/api/rest/userstasklogs/{id}

Operations on System Logs

listSysLogs

Code Block
GET /cloudsync/api/rest/syslogs

...

getTaskLogContent

(Returns text/plain content)

Code Block
GET /cloudsync/api/rest/syslogstasklogs/{id}/content

...

deleteTaskLog

Code Block
DELETE /cloudsync/api/rest/syslogstasklogs/{id}