docuteam:bridge
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende ÜberarbeitungNächste ÜberarbeitungBeide Seiten der Revision | ||
docuteam:bridge [2019/09/04 08:32] – jan | docuteam:bridge [2020/03/13 09:13] – [Overview] Andreas Nef | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
====== docuteam bridge ====== | ====== docuteam bridge ====== | ||
- | ===== documentation for client applications ===== | ||
- | Documentation for docuteam bridge | + | Documentation for docuteam bridge |
- | ===== goal ===== | + | ===== Goal ===== |
- | Client applications should be able to submit a deposition (data and metadata) to our ingest platform. Depositions are picked up by docuteam feeder workflows, usually processing and storing the information | + | Client applications should be able to submit a deposition (a package with data and metadata) to our ingest platform. Depositions are then picked up by docuteam feeder workflows, usually processing and storing the deposition |
- | deposited objects. | + | |
In the [[https:// | In the [[https:// | ||
- | * the bridge | + | * docuteam |
- | * after preservation actions, the SIP are ingested into the repository | + | * The SIPs are processed |
- | * the bridge access API enables client application to retrieve Dissemination Information | + | * Client applications |
- | {{ :teamoais: | + | {{ :docuteam: |
- | ===== key points | + | ===== Overview |
- | * Bridge | + | * bridge |
- | * Bridge | + | * bridge |
- | * Use the simple, | + | * Use the simple, |
- | * Use Matterhorn METS (see [[https:// | + | * Use Matterhorn METS (see its [[media=oais: |
- | * Use other formats like e. g. eCH-0160 or SEDA. | + | * Use other formats like [[https:// |
- | * Bridge is composed | + | * bridge consists |
- | * **depositions**: | + | * **[[docuteam: |
- | * **access**: read data successfully deposited | + | * New depositions are temporarily stored by bridge. They are made available to feeder, which in turn processes and stores them into the repository. |
- | * **changes**: | + | |
- | ===== bridge | + | |
+ | | ||
+ | | ||
+ | * and the SIP is deleted from the depositions as it is now preserved | ||
+ | * **[[docuteam: | ||
+ | * metadata only (data remains unchanged) | ||
+ | * data only (metadata remains unchanged) | ||
+ | * object (metadata and data are modified) | ||
+ | * **[[docuteam: | ||
+ | * Gives access to the full DIP corresponding to a deposited SIP. | ||
+ | * Gives access to metadata, data or previews of specific repository objects. | ||
- | For security reasons, bridge enforces HTTPS. Access is restricted via tokens that must be transmitted with each request via using the “token” parameter (regardless the HTTP method: GET, POST, PUT, PATCH, DELETE). Roles are associated to tokens and limit their scope of operation. | + | ===== Authentication ===== |
- | * **depositions** | + | Access is restricted via tokens |
- | * new depositions are temporarily stored by bridge. They are made available to feeder, which in turn processes and stores them into the repository, | + | |
- | * depositions are identified by bridge IDs, that are returned | + | |
- | * upon successful archiving in the repository, | + | |
- | * the status of the deposition is set to "archived" | + | |
- | * PIDs, which are the repository’s Persistent IDs are made available by bridge. PIDs are required | + | |
- | * Each digital object in the repository (folder, file) gets its own PID and relations between the customer' | + | |
- | * the SIP is deleted from bridge as the information is preserved by the repository | + | |
- | * **changes** target (for update or purge) one single object in the repository identified by its PID. They can be limited to: | + | |
- | * metadata only (data is unchanged, only for updates) | + | |
- | * data only (metadata is unchanged) | + | |
- | * object (metadata+data | + | |
- | * **access** | + | |
- | * gives access | + | |
- | * or gives access to metadata, data or on-the-fly converted formats of specific repository objects, | + | |
- | * this API is a proxy to docuteam rservices (a component offering high level access to Fedora objects, such as DIP and preview generation) | + | |
- | ==== 0 - authentication | + | * An authentication |
+ | * Tokens are passed using a " | ||
- | Bridge relies solely on tokens for authentication an authorization. Tokens are bound to institutions and roles and restrict the API usage on that basis. | + | ===== Roles ===== |
- | * An authentication token must be at least 15 characters long. | + | Roles are associated to tokens and limit their scope of operation. |
- | * Tokens | + | |
+ | There are five roles: | ||
+ | * The following three roles are limited to a single organization: | ||
+ | * **read**: is restricted to the [[docuteam: | ||
+ | * **create**: has the same authorizations as read, but can in addition list, create and delete depositions | ||
+ | * **manage**: has the same authorizations as create, and can in addition update or purge repository objects via the [[docuteam: | ||
+ | * The following two roles have a global scope: | ||
+ | * **admin**: authentication and authorization management, i.e. token administration using the API or the GUI | ||
+ | * **feeder**: super user, can do anything except | ||
+ | |||
+ | ===== Depositions API ===== | ||
+ | |||
+ | ==== Status Model ==== | ||
+ | |||
+ | Depositions have one of the following status: | ||
+ | * **submitted**: | ||
+ | * **queued**: the deposition has been queued for processing by feeder | ||
+ | * **processing**: | ||
+ | * **archived**: | ||
+ | * Persistent identifiers (PIDs) allocated to the deposition' | ||
+ | * The originally deposited package has been deleted from bridge. | ||
+ | * **error**: something went wrong during the deposition' | ||
+ | * **deleted**: | ||
+ | |||
+ | The deposition status can only be managed directly by the role " | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | ==== Routes ==== | ||
+ | |||
+ | < | ||
+ | POST / | ||
+ | GET / | ||
+ | GET / | ||
+ | PUT / | ||
+ | </ | ||
+ | |||
+ | ==== Create ==== | ||
+ | Creates a new deposition. | ||
+ | |||
+ | === Allowed calls === | ||
+ | POST / | ||
+ | |||
+ | === Requirements === | ||
+ | Token with role '' | ||
+ | |||
+ | === Parameters === | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | === Examples === | ||
+ | < | ||
+ | |||
+ | ==== Index ==== | ||
+ | Lists/shows the existing depositions with details. | ||
+ | |||
+ | === Allowed calls === | ||
+ | GET / | ||
+ | |||
+ | === Requirements === | ||
+ | Token with role '' | ||
+ | |||
+ | === Parameters === | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | === Examples === | ||
+ | < | ||
+ | curl " | ||
+ | curl " | ||
+ | curl " | ||
+ | curl " | ||
+ | curl " | ||
+ | |||
+ | ==== Show ==== | ||
+ | Retrieve the binary content of a deposition. | ||
+ | |||
+ | === Allowed calls === | ||
+ | GET / | ||
+ | |||
+ | === Requirements === | ||
+ | Token with role '' | ||
- | < | + | === Parameters === |
+ | * '' | ||
+ | * '' | ||
- | === roles == | + | === Examples === |
- | There are 5 roles: | + | < |
- | * The 3 first roles are limited to the organization they are bound to: | + | |
- | * **read**: is restricted to the access API | + | |
- | * **create**: has the same authorizations as read, and can in addition list and create depositions via the deposition API | + | |
- | * **manage**: has the same authorizations as read, and can in addition update or purge repository objects via the nodes API | + | |
- | * The 2 last roles are not limited to any organization | + | |
- | * **admin**: authentication and authorization management, i.e. token administration via the API or the GUI | + | |
- | * **feeder**: super user, can do anything except token administration, | + | |
- | === recommendation | + | ==== Update ==== |
- | * use only one token with read roles in applications that do not require | + | Set status and processing details. By setting the status |
- | * use only one token with create role in application that make use of the deposition API but not the changes API, | + | |
- | * use only one token with manage role in applications that make use the changes API. | + | |
- | ==== 1 - depositions API ==== | + | === Allowed calls === |
+ | PUT / | ||
- | === deposition statuses | + | === Requirements |
- | * // | + | Token with role '' |
- | * //queued//: the deposition has been attributed | + | |
- | * // | + | |
- | * // | + | |
- | * //error//: something went wrong during the deposition' | + | |
- | * // | + | |
- | The deposition status | + | === Parameters === |
+ | * '': | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
- | {{ :teamoais:bridge-sitatus.svg.png?nolink&200 |}} | + | === Examples === |
+ | < | ||
+ | curl -X PUT " | ||
- | === deposition responses | + | ==== Responses ==== |
- | Responses are given in JSON or a binary | + | Responses are given in JSON or (for the show method) as a binary. Each JSON response is a list of deposition with their details. The generic |
< | < | ||
{ " | { " | ||
{ " | { " | ||
- | " | + | " |
" | " | ||
[ | [ | ||
Zeile 121: | Zeile 196: | ||
Key elements include: | Key elements include: | ||
- | * “id” is the deposition | + | * '' |
- | * “status” is the deposition status, as described above, | + | * '' |
- | * “feeder_response” is also formatted in JSON. It is a black box from bridge' | + | * '' |
< | < | ||
Zeile 137: | Zeile 212: | ||
It must be noted that: | It must be noted that: | ||
- | * the "clientId" | + | * the '' |
- | * the "pid" | + | * the '' |
- | === deposition routes === | ||
- | == deposition routes overview | + | ===== Access API ===== |
+ | |||
+ | This API is a proxy to docuteam rservices. rservices offers high-level access functionality to repository objects. For example, it is able to generate DIPs starting from any level of an archival package and assemble it recursively. Another notable feature is the on-the-fly generation of preview/ | ||
+ | |||
+ | This access methods retrieve data from the repository, hence expects PIDs (and not bridge internal IDs, as it is the case for the depositions API). | ||
+ | |||
+ | In version 1.0, bridge is limited to synchronous requests, meaning that the required object is prepared and returned at once. Async/ | ||
+ | |||
+ | ==== Routes ==== | ||
< | < | ||
- | GET / | + | GET /access/ |
- | POST /depositions | + | GET |
- | GET /depositions/:id | + | GET /access/ |
- | PATCH | + | GET /access/ |
- | PUT | + | |
</ | </ | ||
- | == deposition routes detailed | + | ==== Metadata |
- | ^ Action | + | Get the EAD metadata of a repository object. |
- | | **create** | + | |
- | | **list** / **show** | **HTTP GET** on / | + | |
- | | **retrieve binary data** | **HTTP GET** on / | + | |
- | | **update** | + | |
- | ==== 2 - access API ==== | + | === Allowed calls === |
+ | GET / | ||
- | This API is a of proxy to docuteam rservices. Rservices is offers high level access to Fedora objects. For example, it is able to generate DIP starting from the top level object of an archival package and assembling it recursively. Another notable feature is the the on-the-fly generation of thumbnails and, more generally, format migrations. | + | === Requirements === |
+ | Token with role '' | ||
- | Bridge adds an authentication and authorization layer on top of rservices. | + | === Parameters === |
+ | * '': | ||
+ | * '' | ||
- | This API retrieves data from the archive, hence expects PIDs (and not bridge | + | === Examples === |
+ | < | ||
- | In version 1.0.x, bridge is limited to synchronous requests, meaning that the required object is prepared and returned at once. In other words, it is not yet possible to ask for the generation | + | ==== Preview ==== |
+ | Get a preview representation | ||
- | == access | + | === Allowed calls === |
+ | GET /access/ | ||
+ | |||
+ | === Requirements === | ||
+ | Token with role '' | ||
+ | |||
+ | === Parameters === | ||
+ | * '': | ||
+ | * '' | ||
+ | |||
+ | === Examples === | ||
+ | < | ||
+ | |||
+ | ==== Original ==== | ||
+ | Get the original format of a repository object. | ||
+ | |||
+ | === Allowed calls === | ||
+ | GET / | ||
+ | |||
+ | === Requirements === | ||
+ | Token with role '' | ||
+ | |||
+ | === Parameters === | ||
+ | * '': | ||
+ | * '' | ||
+ | |||
+ | === Examples === | ||
+ | < | ||
+ | |||
+ | ==== DIP ==== | ||
+ | Get the dissemination package of a repository object, structured according to the Matterhorn METS format. For nested objects, it is possible to receive a package with both binaries and (technical and descriptive) metadata recursively. | ||
+ | |||
+ | === Allowed calls === | ||
+ | GET / | ||
+ | |||
+ | === Requirements === | ||
+ | Token with role '' | ||
+ | |||
+ | === Parameters === | ||
+ | * '': | ||
+ | * '' | ||
+ | |||
+ | === Examples === | ||
+ | < | ||
+ | curl " | ||
+ | |||
+ | |||
+ | ===== Changes API ===== | ||
+ | |||
+ | Changes target specific objects in the repository, using their persistent identifier (PID), in order to replace or purge them. Similar to depositions, | ||
+ | |||
+ | ==== Status Model ==== | ||
+ | |||
+ | * **submitted**: | ||
+ | * **queued**: the change has been queued for processing in feeder | ||
+ | * **processing**: | ||
+ | * **archived**: | ||
+ | * **purged**: the change was successfully processed, i.e. the object was purged from the repository | ||
+ | * **error**: something went wrong, see the message in the " | ||
+ | * **deleted**: | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | |||
+ | ==== Routes ==== | ||
< | < | ||
- | GET /access/ | + | POST |
- | GET /access/ | + | GET /changes |
- | GET /access/ | + | GET /changes/:id |
- | GET /access/ | + | PUT /changes/:id |
</ | </ | ||
- | == access routes detailed | + | ==== Create |
- | ^ Action | + | Creates |
- | | **dip** | + | |
- | | **original** | + | |
- | | **preview / file migration** | + | |
- | | **metadata** | + | |
+ | === Allowed calls === | ||
+ | POST /changes | ||
+ | === Requirements === | ||
+ | Token with role '' | ||
- | ==== 3 - changes API ==== | + | === Parameters |
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
- | Changes are similar to depositions, | + | === Examples === |
+ | < | ||
+ | curl -X POST " | ||
- | === changes statuses | + | ==== Index ==== |
- | * // | + | Lists the existing changes with details. |
- | * // | + | |
- | * // | + | |
- | * //archived: the change was successfully processed, meaning the object in the repository was updated (depending on the repository setting this may create a new version of the object or replace it) | + | |
- | * //purged//: the object was successfully purged from the repository | + | |
- | * //error//: something went wrong, see the “message” field itself located in " | + | |
- | * // | + | |
- | {{ : | + | === Allowed calls === |
+ | GET / | ||
- | === changes responses | + | === Requirements |
+ | Token with role '' | ||
- | The changes JSON responses are similar to the deposition responses, but have two additional fields: | + | === Parameters === |
- | * “pid” that relates to the repository targeted | + | * '' |
- | * “task” that describes the action performed | + | * '' |
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
- | Practically, changes responses look like this: | + | === Examples === |
+ | < | ||
+ | curl " | ||
+ | curl " | ||
+ | curl " | ||
+ | curl " | ||
+ | curl " | ||
+ | |||
+ | ==== Show ==== | ||
+ | |||
+ | Retrieve the binary content of a change. | ||
+ | |||
+ | === Allowed calls === | ||
+ | GET / | ||
+ | |||
+ | === Requirements === | ||
+ | Token with role '' | ||
+ | |||
+ | === Parameters === | ||
+ | * '': | ||
+ | * '' | ||
+ | |||
+ | === Examples === | ||
+ | < | ||
+ | |||
+ | |||
+ | ==== Update ==== | ||
+ | |||
+ | Retrieve the binary content of a change. | ||
+ | |||
+ | === Allowed calls === | ||
+ | PUT / | ||
+ | |||
+ | === Requirements === | ||
+ | Token with role '' | ||
+ | |||
+ | === Parameters === | ||
+ | * '': | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | === Examples === | ||
+ | < | ||
+ | curl -X PUT " | ||
+ | |||
+ | ==== Responses ==== | ||
+ | |||
+ | The responses on this API are similar to the [[docuteam: | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | Practically, | ||
< | < | ||
{ " | { " | ||
{ " | { " | ||
- | " | + | " |
" | " | ||
[ | [ | ||
Zeile 240: | Zeile 447: | ||
} | } | ||
</ | </ | ||
- | |||
- | === changes routes === | ||
- | |||
- | == changes routes overview == | ||
- | |||
- | < | ||
- | POST / | ||
- | GET / | ||
- | GET / | ||
- | PUT / | ||
- | </ | ||
- | |||
- | == changes routes detailed == | ||
- | ^ Action | ||
- | | **create** | ||
- | ? | ||
- | | **list** / **show** | **HTTP GET** on /changes,\\ **parameters: | ||
- | ? | ||
- | ? | ||
- | | **retrieve binary data** | **HTTP GET** on / | ||
- | ? | ||
- | | **update** | ||
- | ? | ||
- | ? | ||
- | |||