...
Info |
---|
Each of the methods below has specific security requirements. See DuraCloud Security for more information |
Warning |
---|
Due to an issue which does not properly handle requests redirected from http to https, it is recommended that all REST API requests use https directly. |
Tip |
---|
Examples calling the API defined below with the Unix utility "curl" can be found here |
...
DuraStore
Purpose: DuraStore is the application through which DuraCloud manages storage. The DuraStore REST API provides access to storage by mediating the underlying storage provider APIs to allow access to multiple cloud storage options through a single API.
Panel |
---|
title | Security Initialization Store REST Methods |
---|
|
Initialize Security UsersGet Stores |
DuraStore
Purpose: DuraStore is the application through which DuraCloud manages storage. The DuraStore REST API provides access to storage by mediating the underlying storage provider APIs to allow access to multiple cloud storage options through a single API.
</storageAcct>
</storageProviderAccounts> |
|
Panel |
---|
|
Get SpacesGet Space- Purpose: Provides a listing of the contents of a space along with space properties
|
Panel |
---|
|
Get Stores |
Panel |
---|
|
Get SpacesGet SpaceGet Space Properties- Purpose: Provides all Purpose: Provides a listing of the contents of a space along with space properties
- Request:
GET HEAD https://host:port/durastore/spaceID ? (storeID) (prefix) (maxResults) (marker)
storeID (optional) - ID of the content storage provider to query (default is primary store)prefix (optional) - Only retrieve content ids with this prefix (default is all content ids)maxResults (optional) - The maximum number of content IDs to return in the list (default is 1000) note: the maximum allowable value for maxResults is 1000. Any larger value will be reduced to 1000.marker (optional) - The content ID marking the last item in the previous set (default is the first set of ids)
- Response Code:
- 200 (on success)
- 404 (if the the given space does not exist)
- Response Headers: Same as for Get space (above)
Create SpaceDelete Space- Purpose: Deletes a space
- Request:
DELETE https://host:port/durastore/spaceID ? (storeID) - Response Code:Response Code:
- 200 (on success)
- 404 (if the the given space does not exist)
- Response Body: XML similar to:
Code Block |
---|
| <space id="space1">
<item>Image 1</item>
<item>Image 2</item>
</space>
| "Space $spaceID deleted successfully" (on success)
Get Space ACLs- Purpose: Provides all space ACLs, with values of 'r' (read) and 'w' (read/write)
- Request:
HEAD https://host:port/durastore/acl/spaceID ? (storeID) - Response Code:
- 200 (on success)
- 404 (if the the given space does not exist)
Response Headers: All available space ACLs, example: Response Headers: All available space properties, example: Code Block |
---|
| x-dura-meta-spaceacl-countuser0: 65WRITE
x-dura-meta-spaceacl-createduser1: 2016-04-14T01:40:47
|
Get Space PropertiesWRITE
x-dura-meta-acl-group-curators: READ |
Set Space ACLs- Purpose: Updates the ACLs associated with a space
- Request:
POST - Purpose: Provides all space properties
- Request:
HEAD https://host:port/durastore/acl/spaceID ? (storeID) - Response Code:
- 200 (on success)
- 404 (if the the given space does not exist)
- Response Headers: Same as for Get space (above)
Get Space ACLsCreate Space
- Response Code:
- 200 (on success)
- 404 (if the the given space does not exist)
- Response Body: "Space $spaceID ACLs updated successfully" (on success)
|
Panel |
---|
title | Content REST Methods |
---|
|
Get ContentSet Space ACLs- Purpose: Updates the ACLs associated with a space
- Request:
POST https://host:port/durastore/acl/spaceID ? (storeID) - Request Headers: For 'user' ACLs the header prefix must be '
text/plain
Content-Length: 5732
Content-MD5: 3456709234785097473839202
ETag: 3456709234785097473839202
x-dura-meta- | acl-' and for 'groups' the header prefix must be 'content-name: Testing Content
x-dura-meta- | acl-group-'. Allowable values for ACL headers are: 'READ' and 'WRITE'. Example: Code Block |
---|
| x-dura-meta-acl-user0: WRITE
x-dura-meta-acl-user1: WRITE
x-dura-meta-acl-group-curators: READ
|
Get Content Properties- Purpose: Retrieves the properties of a piece of content without the content itself
- Request:
HEAD https://host:port/durastore/spaceID/contentID ? (storeID) - Response Code: Response Code: 200 (on success)
- 404 (if the the given space does not exist)
- Response Body: "Space $spaceID ACLs updated successfully" (on success)
Delete Space- Response Headers: Same as Get content (above)
Store Content- Purpose: Adds a piece of content to the store
- Request:
PUT - Purpose: Deletes a space
- Request:
DELETE https://host:port/durastore/spaceID/contentID ? (storeID) - Response Code:
- 200 (on success)
- 404 (if the the given space does not exist)
- Response Body: "Space $spaceID deleted successfully" (on success)
|
Panel |
---|
title | Content REST Methods |
---|
|
Get Content- Purpose: Retrieves a piece of content along with its properties
- Request:
GET https://host:port/durastore/spaceID/contentIDÂ ? (storeID) (attachment)
- if attachment param value is true, a Content-Disposition header is included with the response
- Response Code: 200 (on success)
- Response Body: The content stream
- Response Headers: All available content properties, noneType: text/plain
Content-Length: 5732
Content-3456709234785097473839202
4cd56e137a93a1accb43c5d32f4afffb
ETag: |
3456709234785097473839202
x-dura-meta-content-name: Testing Content
x-dura-meta-content-owner: JSmith
Get Content Properties- Purpose: Retrieves the properties of a piece of content without the content itself
- Request:
HEAD https://host:port/durastore/spaceID/contentID ? (storeID) - Response Code: 200 (on success)
- Response Headers: Same as Get content (above)
Store ContentCopy Content- Purpose: Copies a piece of content from a source space to a destination space within a given store
- Request:
PUT https://host:port/durastore/spaceID/contentID ? (storeID) - Request Body: must not exist
Request Headers: Copy source, example: creator
x-dura-meta-content-file-created
copy-source: space-id/content-id
|
Optional Request Headers: Copy source store, example: contentfile-modified
x-dura-meta-content-file-last-accessed
x-dura-meta-content-file-pathUse only US-ASCII characters for property names and values There is a 2 KB total size limit on all content properties (this includes both auto-generated and user contributed properties.) - The "x-dura-meta-" prefix is case-sensitive (make sure your clients do not automatically change case.)
Copy Content- Purpose: Copies a piece of content from a source space to a destination space within a given store
- Request:
PUT https://host:port/durastore/spaceID/contentID ? (storeID) - Request Body: must not exist
Request Headers: Copy source, example: Code Block |
---|
| x-dura-meta-copy-source: space-id/content-id
|
Optional Request Headers: Copy source store, example: Code Block |
---|
| x-dura-meta-copy-source-store: storeId
|
- Response Code: 201 (on success)
- Response Headers:
- Usage Notes
- The properties associated with the source content item are copied to the destination content item.
- The source and destination spaces may be the same.
- Including the optional header indicates that the copy action should retrieve the source file from a space in the specified storage provider. This allows for copying a file from one storage provider to another.
Set Content Properties
- Response Code: 201 (on success)
- Response Headers:
- Usage Notes
- The properties associated with the source content item are copied to the destination content item.
- The source and destination spaces may be the same.
- Including the optional header indicates that the copy action should retrieve the source file from a space in the specified storage provider. This allows for copying a file from one storage provider to another.
Set Content Properties- Purpose: Updates the properties associated with a piece of content. Note: You must include ALL properties you would like associated with the given content item in this call. Any properties that exist before this call but are not included in the call itself will be removed. This is to allow for both adding and removing properties.
- Request:
POST https://host:port/durastore/spaceID/contentID ? (storeID) - Request Headers: Same as Store content (above)
- Response Code: 200 (on success)
- Response Body: "Content $contentID updated successfully"
Delete Content- Purpose: Removes a piece of content from the store
- Request:
DELETE https: - Purpose: Updates the properties associated with a piece of content. Note: You must include ALL properties you would like associated with the given content item in this call. Any properties that exist before this call but are not included in the call itself will be removed. This is to allow for both adding and removing properties.
- Request:
POST https://host:port/durastore/spaceID/contentID ? (storeID) - Request Headers: Same as Store content (above)
- Response Code: 200 (on success)
- Response Body: "Content $contentID updated deleted successfully"
Delete Content |
Panel |
---|
title | Audit Log REST Methods |
---|
|
Get Audit LogGet Audit Log- Purpose: Removes a piece of content from the store
- Request:
DELETE https://host:port/durastore/spaceID/contentID ? (storeID) - Response Code: 200 (on success)
- Response Body: "Content $contentID deleted successfully"
|
Panel |
---|
title | Audit Log REST Methods |
---|
|
|
Panel |
---|
title | Manifest REST Methods |
---|
|
51 myspace image-01.jpg b1978f9fc4fe9448e05b83bbe6b98109 81214 image/jpeg {"content-mimetype" : "image/jpeg"} {} 2014-09-10T15:54:42.042 ADD_CONTENT root |
|
Panel |
---|
title | Manifest REST Methods |
---|
|
Get Manifest- Purpose: Returns the manifest for a given space and storeId
- Request:
GET https://host:port/durastore/manifest/{spaceId} ? (storeID) (format) spaceID - ID of the space for which the manifest will be retrieved storeID (optional) - ID of the content storage provider to query (default is primary store) format (optional) - TSV or BAGIT (default is TSV)
Response Code: 200 (on success), 404 if manifest was not found. Response Body: TSV in chronological order with the following fields. Code Block |
---|
| space-id content-id MD5
auditlogs localhost/51/auditlogs/localhost_51_auditlogs-2014-09-10-15-56-07.tsv 6992f8e57dafb17335f766aa2acf5942
auditlogs localhost/51/photos/localhost_51_photos-2014-09-10-15-55-01.tsv 820e786633fb495db447dc5d5cf0b2bd |
Generate Manifest- Purpose: Asynchronously generates a gzipped manifest for a given space and storeId. This approach may be preferable if you wish to obtain a manifest for a larger space. We recommend considering this option for spaces that are larger than 100K items.
- Request:
POST https://host:port/durastore/manifest/{spaceId} ? (storeID) (format) spaceID - ID of the space for which the manifest will be generated storeID (optional) - ID of the content storage provider to query (default is primary store) format (optional) - TSV or BAGIT (default is TSV)
Response Code: 202 (on success), 404 if manifest was not found. Response Body: We are processing your manifest generation request. To retrieve your file, please poll the URI in the Location header of this response Response Headers: Code Block |
---|
| Location: <URI-of-generated-manifest> |
|
Panel |
---|
title | Storage Report REST Methods |
---|
|
Get Storage Reports by SpaceGet Storage Reports by Store- Purpose: Returns storage report summaries for all content in a storage provider. Report values are averaged based on the grouping internal (if groupBy=month, all data points within each month are averaged to provide an aggregate result).
- Request:
GET https://host:port/durastore/report/store ? (storeID) (start) (end) (groupBy) storeID (optional) - ID of the content storage provider to query (default is primary store) start (optional) - Timestamp in epoch milliseconds which defines the starting point for results. Any data points which are prior to this value are not included. end (optional) - Timestamp in epoch milliseconds which defines the end point for results. Any data points which are after this value are not included. usage note: To ensure that all expected data points are included, set the end timestamp to the very end of the final interval (e.g. 23:59:59 on the last day of the week/month)
groupBy (optional) - Grouping interval which allows for averaged results for days, weeks, and months. Valid values are: "day", "week", and "month" (default is day
Get Manifest- Purpose: Returns the manifest for a given space and storeId
- Request:
GET https://host:port/durastore/manifest/{spaceId} ? (storeID) (format) spaceID - ID of the space for which the manifest will be retrieved storeID (optional) - ID of the content storage provider to query (default is primary store) format (optional) - TSV or BAGIT (default is TSV)
Response Code: 200 (on success), 404 if manifest was not found. Response Body: TSV in chronological order with the following fields.JSON array of storage report details Code Block |
---|
| space-id content-id MD5
auditlogs localhost/51/auditlogs/localhost_51_auditlogs-2014-09-10-15-56-07.tsv 6992f8e57dafb17335f766aa2acf5942
auditlogs localhost/51/photos/localhost_51_photos-2014-09-10-15-55-01.tsv 820e786633fb495db447dc5d5cf0b2bd
|
|
Panel |
---|
title | Storage Report REST Methods |
---|
|
[
{"timestamp":1312588800000,"accountId":"<account-id>","storeId":"<store-id>","byteCount":1000,"objectCount":10},
{"timestamp":1315008000000,"accountId":"<account-id>","storeId":"<store-id>","byteCount":1000,"objectCount":10},
{"timestamp":1315526400000,"accountId":"<account-id>","storeId":"<store-id>","byteCount":1000,"objectCount":10}
] |
Get Storage Reports for all Spaces in a Store (in a single day)Get Storage Report by Space |
...