Versions Compared

Key

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

...

On

...

this

...

page:

Table of Contents

Methods

Anchor
postServiceInit
postServiceInit

POST serviceInit

Initializes the service by adding the first administrative user.

This method does not require authentication and can only be run once.

Wiki Markup
*
{toc}





h1. Methods






{anchor:postServiceInit}
h2. POST serviceInit




Initializes the service by adding the first administrative user.

This method does not require authentication and can only be run once.

{table:border=1|cellpadding=5|cellspacing=0|style=background-color: #eee}
{tr}{td:style=background-color: #ccc}*Request URI*{td}
{td}Append {{/api/rest/service}} to the URL of the CloudSync instance{td}{tr}
{tr}{td:style=background-color: #ccc}*Query Parameters*{td}
{td}_None_{td}{tr}
{tr}{td:style=background-color: #ccc}*Request Formats*{td}
{td}{{[application/vnd.fcrepo-cloudsync.serviceinit+json|#serviceInitJSON]}}
{{[application/vnd.fcrepo-cloudsync.serviceinit+xml|#serviceInitXML]}}{td}{tr}
{tr}{td:style=background-color: #ccc}*Response Formats*{td}
{td}{{[application/vnd.fcrepo-cloudsync.serviceinfo+json|#serviceInfoJSON]}}
{{[application/vnd.fcrepo-cloudsync.serviceinfo+xml|#serviceInfoXML]}}{td}{tr}
{tr}{td:style=background-color: #ccc}*Typical Status Codes*{td}
{td}{{200 Ok}}
{{209 Conflict}} if the service is already initialized.{td}{tr}
{table}

*

Example:

Panel
* {panel} *

Request:

* {

No Format
}

POST /cloudsync/api/rest/service HTTP/1.1
Content-Type: application/vnd.fcrepo-cloudsync.serviceinit+json
Accept: application/vnd.fcrepo-cloudsync.serviceinfo+json
{noformat} {code}
Code Block

{
  serviceInit: {
    initialAdminUsername: "fwilson",
    initialAdminPassword: "puppies1"
  }
}
{code} *

Response:

* {

No Format
}

HTTP/1.1 200 OK
Content-Type: application/vnd.fcrepo-cloudsync.serviceinfo+json
{noformat} {code}
Code Block

{
  serviceInfo: {
    buildDate: "2011-10-26 11:50:56 UTC-0400",
    currentUserUri: "https://example.org/path/to/user",
    initialized: false,
    objectSetsUri: "https://example.org/path/to/objectSets",
    objectStoresUri: "https://example.org/path/to/objectStores",
    providerAccountsUri: "https://example.org/path/to/providerAccounts",
    spacesUri: "https://example.org/path/to/spaces",
    taskLogsUri: "https://example.org/path/to/taskLogs",
    tasksUri: "https://example.org/path/to/tasks",
    usersUri: "https://example.org/path/to/users",
    version: "1.0.0"
  }
}

Anchor
getServiceInfo
getServiceInfo

GET serviceInfo

Gets key information about the service, including URIs of other resources that comprise the REST API.

This method does not require authentication.

Wiki Markup
{code}
{panel}




{anchor:getServiceInfo}
h2. GET serviceInfo




Gets key information about the service, including URIs of other resources that comprise the REST API.

This method does not require authentication.

{table:border=1|cellpadding=5|cellspacing=0|style=background-color: #eee}
{tr}{td:style=background-color: #ccc}*Request URI*{td}
{td}Append {{/api/rest/service}} to the URL of the CloudSync instance{td}{tr}
{tr}{td:style=background-color: #ccc}*Query Parameters*{td}
{td}_None_{td}{tr}
{tr}{td:style=background-color: #ccc}*Request Formats*{td}
{td}_None_{td}{tr}
{tr}{td:style=background-color: #ccc}*Response Formats*{td}
{td}{{[application/vnd.fcrepo-cloudsync.serviceinfo+json|#serviceInfoJSON]}}
{{[application/vnd.fcrepo-cloudsync.serviceinfo+xml|#serviceInfoXML]}}{td}{tr}
{tr}{td:style=background-color: #ccc}*Typical Status Codes*{td}
{td}{{200 Ok}}{td}{tr}
{table}

*

Example:

Panel
* {panel} *

Request:

* {

No Format
}

GET /cloudsync/api/rest/service HTTP/1.1
Accept: application/vnd.fcrepo-cloudsync.serviceinfo+json
{noformat} *

Response:

* {

No Format
}

HTTP/1.1 200 OK
Content-Type: application/vnd.fcrepo-cloudsync.serviceinfo+json
{noformat} {code}
Code Block

{
  serviceInfo: {
    buildDate: "2011-10-26 11:50:56 UTC-0400",
    currentUserUri: "https://example.org/path/to/user",
    initialized: false,
    objectSetsUri: "https://example.org/path/to/objectSets",
    objectStoresUri: "https://example.org/path/to/objectStores",
    providerAccountsUri: "https://example.org/path/to/providerAccounts",
    spacesUri: "https://example.org/path/to/spaces",
    taskLogsUri: "https://example.org/path/to/taskLogs",
    tasksUri: "https://example.org/path/to/tasks",
    usersUri: "https://example.org/path/to/users",
    version: "1.0.0"
  }
}
{code} {panel} h1. Media Types {anchor:serviceInfoJSON} h2.

Media Types

Anchor
serviceInfoJSON
serviceInfoJSON

application/vnd.fcrepo-cloudsync.serviceinfo+json

...

A

...

JSON

...

object

...

with

...

a

...

serviceInfo

...

field

...

whose

...

value

...

is

...

an

...

associative

...

array

...

of

...

the

...

following

...

fields:

Wiki Markup


{table:border=1|cellpadding=5|cellspacing=0|style=background-color: #eee}
{tr:style=background-color: #ccc}{td}*Field*{td}{td}*Description*{td}{td}*Required?*{td}{tr}
{tr}{td}{{buildDate}}{td}{td}The date the CloudSync software was built{td}{td}Yes{td}{tr}
{tr}{td}{{currentUserUri}}{td}{td}A URI that can be used to get the current user via [GET user|User Resources#getUser]{td}{td}Yes{td}{tr}
{tr}{td}{{initialized}}{td}{td}{{true}} if [POST serviceInit|#postServiceInit] has been successfully called on this instance, {{false}} otherwise{td}{td}Yes{td}{tr}
{tr}{td}{{objectSetsUri}}{td}{td}The URI to be used for [GET objectSets|Object Set Resources#getObjectSets] and [POST objectSet|Object Set Resources#postObjectSet] requests{td}{td}Yes{td}{tr}
{tr}{td}{{objectStoresUri}}{td}{td}The URI to be used for [GET objectStores|Object Store Resources#getObjectStores] and [POST objectStore|Object Store Resources#postObjectStore] requests{td}{td}Yes{td}{tr}
{tr}{td}{{providerAccountsUri}}{td}{td}The URI to be used for [GET providerAccounts|DuraCloud Resources#getProviderAccounts] requests{td}{td}Yes{td}{tr}
{tr}{td}{{spacesUri}}{td}{td}The URI to be used for [GET spaces|DuraCloud Resources#getSpaces] requests{td}{td}Yes{td}{tr}
{tr}{td}{{taskLogsUri}}{td}{td}The URI to be used for [GET taskLogs|Task Log Resources#getTaskLogs] requests{td}{td}Yes{td}{tr}
{tr}{td}{{tasksUri}}{td}{td}The URI to be used for [GET tasks|Task Resources#getTasks] and [POST task|Task Resources#postTask] requests{td}{td}Yes{td}{tr}
{tr}{td}{{usersUri}}{td}{td}The URI to be used for [GET users|User Resources#getUsers] and [POST user|User Resources#postUser] requests{td}{td}Yes{td}{tr}
{tr}{td}{{version}}{td}{td}The version of the CloudSync software{td}{td}Yes{td}{tr}
{table}

*

Example:

* {
Code Block
}
{
  serviceInfo: {
    buildDate: "2011-10-26 11:50:56 UTC-0400",
    currentUserUri: "https://example.org/path/to/user",
    initialized: false,
    objectSetsUri: "https://example.org/path/to/objectSets",
    objectStoresUri: "https://example.org/path/to/objectStores",
    providerAccountsUri: "https://example.org/path/to/providerAccounts",
    spacesUri: "https://example.org/path/to/spaces",
    taskLogsUri: "https://example.org/path/to/taskLogs",
    tasksUri: "https://example.org/path/to/tasks",
    usersUri: "https://example.org/path/to/users",
    version: "1.0.0"
  }
}
{code}



{anchor:serviceInfoXML}
h2. 

Anchor
serviceInfoXML
serviceInfoXML

application/vnd.fcrepo-cloudsync.serviceinfo+xml

...

An

...

XML

...

encoding

...

of

...

the

...

above.

...

Example:

* {:=
No Format
borderStyle
dashed
}
<serviceInfo>
  <buildDate>2011-10-26 11:50:56 UTC-0400</buildDate>
  <currentUserUri>https://example.org/path/to/user</currentUserUri>
  <initialized>false</initialized>
  <objectSetsUri>https://example.org/path/to/objectSets</objectSetsUri>
  <objectStoresUri>https://example.org/path/to/objectStores</objectStoresUri>
  <providerAccountsUri>https://example.org/path/to/providerAccounts</providerAccountsUri>
  <spacesUri>https://example.org/path/to/spaces</spacesUri>
  <taskLogsUri>https://example.org/path/to/taskLogs</taskLogsUri>
  <tasksUri>https://example.org/path/to/tasks</tasksUri>
  <usersUri>https://example.org/path/to/users</usersUri>
  <version>1.0.0</version>
</serviceInfo>
{noformat}



{anchor:serviceInitJSON}
h2. 

Anchor
serviceInitJSON
serviceInitJSON

application/vnd.fcrepo-cloudsync.serviceinit+json

...

A

...

JSON

...

object

...

with

...

a

...

serviceInit

...

field

...

whose

...

value

...

is

...

an

...

associative

...

array

...

of

...

the

...

following

...

fields:

Wiki Markup


{table:border=1|cellpadding=5|cellspacing=0|style=background-color: #eee}
{tr:style=background-color: #ccc}{td}*Field*{td}{td}*Description*{td}{td}*Required?*{td}{tr}
{tr}{td}{{initialAdminUsername}}{td}{td}The username of the initial admin user.{td}{td}Yes{td}{tr}
{tr}{td}{{initialAdminPassword}}{td}{td}The password of the initial admin user.{td}{td}Yes{td}{tr}
{table}

*

Example:

* {
Code Block
}
{
  serviceInit: {
    initialAdminUsername: "fwilson",
    initialAdminPassword: "PuppiesRgr8!"
  }
}
{code}




{anchor:serviceInitXML}
h2. 

Anchor
serviceInitXML
serviceInitXML

application/vnd.fcrepo-cloudsync.serviceinit+xml

...

An

...

XML

...

encoding

...

of

...

the

...

above.

...

Example:

* {:=
No Format
borderStyle
dashed
}
<serviceInit>
  <initialAdminUsername>fwilson</initialAdminUsername>
  <initialAdminPassword>PuppiesRgr8!</initialAdminPassword>
</serviceInit>
{noformat}