Skip to content

Commit

Permalink
added API docs in version 0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
martinhecher committed Aug 5, 2015
1 parent ee734bb commit 05829dc
Show file tree
Hide file tree
Showing 67 changed files with 3,711 additions and 97 deletions.
46 changes: 45 additions & 1 deletion api/controllers/SipController.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,50 @@ function createRosetta(rosettaOpts, cb) {
}

module.exports = {

/**
* @api {post} /sip Create BagIt SIP
* @apiVersion 0.7.0
* @apiName PostBagItSIP
* @apiGroup DigitalPreservation
* @apiPermission none
*
* @apiDescription Creates a new Submission Information Package (SIP) in the [BagIt](https://en.wikipedia.org/wiki/BagIt) format.
*
* @apiParam {Object} session Object containing arrays for the 'physicalAssets' and 'digitalObjects' that should go into the SIP.
* @apiParam {Object} output Object containing a 'type' key with the value **'bag'**.
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "url": "physical_asset_8a0e49ed-30da-42b5-984e-2cadd25e1cc0/bag.zip",
* }
*
* @apiSuccess {String} url Download URL for the BagIt SIP.
*
*/

/**
* @api {post} /sip Create Rosetta SIP
* @apiVersion 0.7.0
* @apiName PostRosettaSIP
* @apiGroup DigitalPreservation
* @apiPermission none
*
* @apiDescription Creates a new Submission Information Package (SIP) in the [Rosetta](https://developers.exlibrisgroup.com/rosetta/apis/SipWebServices) format.
*
* @apiParam {Object} session Object containing arrays for the 'physicalAssets' and 'digitalObjects' that should go into the SIP.
* @apiParam {Object} output Object containing a 'type' key with the value **'rosetta'**.
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "sip_id": "33505",
* }
*
* @apiSuccess {String} sip_id SIP ID from the Rosetta DPS. This can be used to get the download information for the uploaded files from the SIP (see Rosetta's [web services documentation](https://developers.exlibrisgroup.com/rosetta/apis/SipWebServices) on how to do that).
*
*/
create: function(req, res, next) {

console.log('body: ' + JSON.stringify(req.body.session, null, 4));
Expand Down Expand Up @@ -171,7 +215,7 @@ module.exports = {
console.log('Created output at: ' + outputPath);

var url = outputPath.replace('/tmp/', '/public/');

return res.send({
url: url
}).status(200);
Expand Down
124 changes: 124 additions & 0 deletions assets/api_data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
define({ "api": [
{
"type": "post",
"url": "/sip",
"title": "Create BagIt SIP",
"version": "0.7.0",
"name": "PostBagItSIP",
"group": "DigitalPreservation",
"permission": [
{
"name": "none"
}
],
"description": "<p>Creates a new Submission Information Package (SIP) in the <a href=\"https://en.wikipedia.org/wiki/BagIt\">BagIt</a> format.</p> ",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "<p>Object</p> ",
"optional": false,
"field": "session",
"description": "<p>Object containing arrays for the 'physicalAssets' and 'digitalObjects' that should go into the SIP.</p> "
},
{
"group": "Parameter",
"type": "<p>Object</p> ",
"optional": false,
"field": "output",
"description": "<p>Object containing a 'type' key with the value <strong>'bag'</strong>.</p> "
}
]
}
},
"success": {
"examples": [
{
"title": "Success-Response:",
"content": "HTTP/1.1 200 OK\n{\n \"url\": \"physical_asset_8a0e49ed-30da-42b5-984e-2cadd25e1cc0/bag.zip\",\n}",
"type": "json"
}
],
"fields": {
"Success 200": [
{
"group": "Success 200",
"type": "<p>String</p> ",
"optional": false,
"field": "url",
"description": "<p>Download URL for the BagIt SIP.</p> "
}
]
}
},
"filename": "api/controllers/SipController.js",
"groupTitle": "DigitalPreservation",
"sampleRequest": [
{
"url": "http://data.duraark.eu/services/api/digitalpreservation/sip"
}
]
},
{
"type": "post",
"url": "/sip",
"title": "Create Rosetta SIP",
"version": "0.7.0",
"name": "PostRosettaSIP",
"group": "DigitalPreservation",
"permission": [
{
"name": "none"
}
],
"description": "<p>Creates a new Submission Information Package (SIP) in the <a href=\"https://developers.exlibrisgroup.com/rosetta/apis/SipWebServices\">Rosetta</a> format.</p> ",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "<p>Object</p> ",
"optional": false,
"field": "session",
"description": "<p>Object containing arrays for the 'physicalAssets' and 'digitalObjects' that should go into the SIP.</p> "
},
{
"group": "Parameter",
"type": "<p>Object</p> ",
"optional": false,
"field": "output",
"description": "<p>Object containing a 'type' key with the value <strong>'rosetta'</strong>.</p> "
}
]
}
},
"success": {
"examples": [
{
"title": "Success-Response:",
"content": "HTTP/1.1 200 OK\n{\n \"sip_id\": \"33505\",\n}",
"type": "json"
}
],
"fields": {
"Success 200": [
{
"group": "Success 200",
"type": "<p>String</p> ",
"optional": false,
"field": "sip_id",
"description": "<p>SIP ID from the Rosetta DPS. This can be used to get the download information for the uploaded files from the SIP (see Rosetta's <a href=\"https://developers.exlibrisgroup.com/rosetta/apis/SipWebServices\">web services documentation</a> on how to do that).</p> "
}
]
}
},
"filename": "api/controllers/SipController.js",
"groupTitle": "DigitalPreservation",
"sampleRequest": [
{
"url": "http://data.duraark.eu/services/api/digitalpreservation/sip"
}
]
}
] });
124 changes: 124 additions & 0 deletions assets/api_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
[
{
"type": "post",
"url": "/sip",
"title": "Create BagIt SIP",
"version": "0.7.0",
"name": "PostBagItSIP",
"group": "DigitalPreservation",
"permission": [
{
"name": "none"
}
],
"description": "<p>Creates a new Submission Information Package (SIP) in the <a href=\"https://en.wikipedia.org/wiki/BagIt\">BagIt</a> format.</p> ",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "<p>Object</p> ",
"optional": false,
"field": "session",
"description": "<p>Object containing arrays for the 'physicalAssets' and 'digitalObjects' that should go into the SIP.</p> "
},
{
"group": "Parameter",
"type": "<p>Object</p> ",
"optional": false,
"field": "output",
"description": "<p>Object containing a 'type' key with the value <strong>'bag'</strong>.</p> "
}
]
}
},
"success": {
"examples": [
{
"title": "Success-Response:",
"content": "HTTP/1.1 200 OK\n{\n \"url\": \"physical_asset_8a0e49ed-30da-42b5-984e-2cadd25e1cc0/bag.zip\",\n}",
"type": "json"
}
],
"fields": {
"Success 200": [
{
"group": "Success 200",
"type": "<p>String</p> ",
"optional": false,
"field": "url",
"description": "<p>Download URL for the BagIt SIP.</p> "
}
]
}
},
"filename": "api/controllers/SipController.js",
"groupTitle": "DigitalPreservation",
"sampleRequest": [
{
"url": "http://data.duraark.eu/services/api/digitalpreservation/sip"
}
]
},
{
"type": "post",
"url": "/sip",
"title": "Create Rosetta SIP",
"version": "0.7.0",
"name": "PostRosettaSIP",
"group": "DigitalPreservation",
"permission": [
{
"name": "none"
}
],
"description": "<p>Creates a new Submission Information Package (SIP) in the <a href=\"https://developers.exlibrisgroup.com/rosetta/apis/SipWebServices\">Rosetta</a> format.</p> ",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "<p>Object</p> ",
"optional": false,
"field": "session",
"description": "<p>Object containing arrays for the 'physicalAssets' and 'digitalObjects' that should go into the SIP.</p> "
},
{
"group": "Parameter",
"type": "<p>Object</p> ",
"optional": false,
"field": "output",
"description": "<p>Object containing a 'type' key with the value <strong>'rosetta'</strong>.</p> "
}
]
}
},
"success": {
"examples": [
{
"title": "Success-Response:",
"content": "HTTP/1.1 200 OK\n{\n \"sip_id\": \"33505\",\n}",
"type": "json"
}
],
"fields": {
"Success 200": [
{
"group": "Success 200",
"type": "<p>String</p> ",
"optional": false,
"field": "sip_id",
"description": "<p>SIP ID from the Rosetta DPS. This can be used to get the download information for the uploaded files from the SIP (see Rosetta's <a href=\"https://developers.exlibrisgroup.com/rosetta/apis/SipWebServices\">web services documentation</a> on how to do that).</p> "
}
]
}
},
"filename": "api/controllers/SipController.js",
"groupTitle": "DigitalPreservation",
"sampleRequest": [
{
"url": "http://data.duraark.eu/services/api/digitalpreservation/sip"
}
]
}
]
15 changes: 15 additions & 0 deletions assets/api_project.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
define({
"name": "duraark-digitalpreservation",
"version": "0.7.0",
"title": "DURAARK DigitalPreservation Service",
"url": "http://data.duraark.eu/services/api/digitalpreservation",
"sampleUrl": "http://data.duraark.eu/services/api/digitalpreservation",
"description": "Microservice providing an API for generating Submission Information Packages (SIPs) and for depositing SIPs to the Rosetta DPS.",
"apidoc": "0.2.0",
"generator": {
"name": "apidoc",
"time": "2015-08-05T17:17:20.136Z",
"url": "http://apidocjs.com",
"version": "0.13.1"
}
});
15 changes: 15 additions & 0 deletions assets/api_project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "duraark-digitalpreservation",
"version": "0.7.0",
"title": "DURAARK DigitalPreservation Service",
"url": "http://data.duraark.eu/services/api/digitalpreservation",
"sampleUrl": "http://data.duraark.eu/services/api/digitalpreservation",
"description": "Microservice providing an API for generating Submission Information Packages (SIPs) and for depositing SIPs to the Rosetta DPS.",
"apidoc": "0.2.0",
"generator": {
"name": "apidoc",
"time": "2015-08-05T17:17:20.136Z",
"url": "http://apidocjs.com",
"version": "0.13.1"
}
}
Loading

0 comments on commit 05829dc

Please sign in to comment.