Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
curl -X POST -d "@export.xml" "http://localhost:8080/rest/path/to/some/resource/fcr:import?format=jcr/xml"
 
Body:
<?xml version="1.0" encoding="UTF-8"?><sv:node xmlns:dc="http://purl.org/dc/terms/" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ns001="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:test="info:fedora/test/" xmlns:image="http://www.modeshape.org/images/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fedorarelsext="http://fedora.info/definitions/v4/rels-ext#" xmlns:mix="http://www....

...

Status
subtletrue
colourGreen
title200201
  Created

Status
subtletrue
colourRed
title404
  Path not found

Versioning

Request URI: /path/to/some/resource/fcr:versions

...

Response:

Code Block
Status: 200 OK

 
Body:
/tmp/fcrepo4-data/path/to/backup/directory

...

Status
subtletrue
colourGreen
title200
  OK

 

...

   

Status
colourBlue
titlePOST
 fcr:restore Restore a backup file into the  repository

...

Status
subtletrue
colourGreen
title200
  OK

Transactions

Request URI: /fcr:tx; /path/to/transaction/fcr:tx

...

Info

After retrieving a transaction resource, the client can execute any REST API method prefixed by the transaction location.

Warning

Transactions are automatically closed and rolled back after (3 minutes?) of inactivity. Transactions can be refreshed by POSTing to /rest/tx:83e34464-144e-43d9-af13-b3464a1fb9b5/fcr:tx

 

Example:

Code Block
curl -X POST "http://localhost:8080/rest/fcr:tx" 

...

Code Block
Status: 201 Created
 
Headers:
Location: http://localhost:8080/rest/tx:123456789:83e34464-144e-43d9-af13-b3464a1fb9b5
Expires: Sat, 16 Nov 2013 00:32:57 GMT

Usage:

Code Block
curl -X POST "http://localhost:8080/rest/tx:12345678983e34464-144e-43d9-af13-b3464a1fb9b5/path/to/object/to/create"
curl -X DELETE "http://localhost:8080/rest/tx:123456789/83e34464-144e-43d9-af13-b3464a1fb9b5/path/to/resource/to/delete"
curl -X POST "http://localhost:8080/rest/tx:!2345678983e34464-144e-43d9-af13-b3464a1fb9b5/fcr:tx/fcr:commit

Status:

Status
subtletrue
colourGreen
title201
  Created

 

...

 

Status
colourBlue
titlePOST
 Save and commit an open transaction.

...

Status
subtletrue
colourGreen
title204
  No Content

 

...

 

 

Status
colourBlue
titlePOST
 Rollback and close an open transaction

...

Status
subtletrue
colourGreen
title204
  No Content

Fixity

Request URI: /path/to/some/resource/fcr:fixity

...

Status
titleGET
 Get the fixity report for an object

Note

Checking fixity requires retrieving the content from the binary store and may take some time. In the event of fixity corruption, in some cases, this will be automatically repaired. See Self-healing storage (link me!)

 

Request Headers:

Status
subtletrue
titleAccept
  text/turtle, text/rdf+n3, application/n3, text/n3, application/rdf+xml, application/json+rdf, application/n-triples, text/html

...

Response:

Code Block
Status: 200 OK
 
Headers:
Content-Type: text/turtle
 
Body:
<x> <y> <z>
<http://localhost:8080/rest/path/to/some/binary/resource>
        a       <http://fedora.info/definitions/v4/rest-api#resource> , <http://fedora.info/definitions/v4/rest-api#datastream> ;
        <http://fedora.info/definitions/v4/repository#hasFixityResult>
                [ <http://fedora.info/definitions/v4/repository#computedChecksum>
                          <urn:sha1:5441456941dd8b3ee0832b991ee93ba0c0a558f7> ;
                  <http://fedora.info/definitions/v4/repository#computedSize>
                          "471019"^^<http://www.w3.org/2001/XMLSchema#long> ;
                  <http://fedora.info/definitions/v4/repository#hasLocation>                       </org.infinispan.loaders.file.FileCacheStore:FedoraRepositoryBinaryData:org.infinispan.loaders.file.FileCacheStore:/var/folders/v3/wl82s37145b6jydsh9y5n8l40000gp/T//fcrepo4-data/fcrepo.ispn.binary.CacheDirPath> ;
                  <http://fedora.info/definitions/v4/repository#isFixityResultOf>
                          <http://localhost:8080/rest/path/to/some/binary/resource> ;
                  <http://fedora.info/definitions/v4/repository#status>
                          "SUCCESS"
                ] .

Status:

Status
subtletrue
colourGreen
title200
  OK

Status
subtletrue
colourRed
title404
 Resource not found

Workspaces

Request URI: /fcr:workspaces/(workspace name)

...