Excerpt |
---|
|
Excerpt |
---|
A Note on Versionable Resources
The following documented API calls are based on the assumption that the resource located at /path/to/some/resource was created as a versionable resource. You can make a resource verisonable by simply adding the following link header to your PUT or POST commands when creating or updating your resource.
Code Block |
---|
Link: <http://mementoweb.org/ns#OriginalResource>; rel="type" |
Examples:
Code Block |
---|
#PUT
curl -X PUT -H "Link: <http://mementoweb.org/ns#OriginalResource>; rel=\"type\"" http://localhost:8080/rest/path/to/resource
#POST
curl -X PUT -H "Link: <http://mementoweb.org/ns#OriginalResource>; rel=\"type\"" -H "Slug: resource" http://localhost:8080/rest/path/to |
|
Versioning in Fedora is composed of three specific types of resources - a versionable resource (a LDPRv), a versions container (a LDPCv), and the actual versioned resource (a LDPRm)- and a variety of strategies to interact with these resources. Each type of resource and the HTTP methods that can be used on them are discussed below.
Excerpt |
---|
Working with a versionable resource (a LDPRv)
A versionable resource is a type of (regular) resource - see RESTful HTTP API - Containers - but it is created by invoking a specific Link header and the GET method has an additional interaction model beyond the GET scenarios when interacting with non-versioned resources. All of the headers and methods for regular resources are applicable to a versionable resource. A resource can be declared versionable when it is created originally. This is achieved by including the following link header to your PUT or POST commands when creating the resource. When a versionable resource is created, the versions container will be created at the same time. Code Block |
---|
Link: <http://mementoweb.org/ns#OriginalResource>; rel="type" |
Request URI: /path/to/resource Methods: GET, PUT, POST
Retrieve the versioned resource from a specific point in time.For more details about Fedora's datetime negotiation behaviors, see Memento Datetime Negotiation Algorithm. Request Headers: ACCEPT-datetime An RFC-1123 Date. (E.g. "Wed, 30 May 2018 23:02:44 GMT") |
Excerpt |
---|
Request URI: /path/to/some/resource/fcr:versions Methods: GET, POST, PATCH Get a list of the available versions of an objectRequest Headers: ACCEPT application/ld+json, application/n-triples, application/rdf+xml, application/x-turtle, application/xhtml+xml, application/xml, text/html, text/n3, text/plain, text/rdf+n3, text/turtle Example: Code Block |
---|
curl -H "Accept: text/turtle" -H "Accept-Datetime: Wed, 29 Aug 2018 15:47:50 GMT" http://localhost:8080/rest/path/to/resource/fcr:versions |
Response: Code Block |
---|
Status: 200 OK
Headers:
Content-Type: text/turtle
Body:
<http://localhost:8080/rest/path/to/resource> fedora:hasVersion <http://localhost:8080/rest/path/to/resource/fcr:versions/87a0a8c317f1e749515d33-cb73-4fd7-9d1d-c715eb6947e0> .
<http://localhost:8080/rest/path/to/resource/fcr:versions/87a0a8c317f1e749515d33-cb73-4fd7-9d1d-c715eb6947e0> fedora:hasVersionLabel "v0"^^<httpHTTP/1.1 302 Found
Date: Wed, 29 Aug 2018 22:09:28 GMT
Set-Cookie: JSESSIONID=hrj5jm80kdjdw9attrozpy19;Path=/
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Tue, 28-Aug-2018 22:09:28 GMT
Link: <http://www.w3.org/2001ns/XMLSchema#string> ;
fedora:created "2014-12-03T23:55:38.47Z"^^<http:ldp#Resource>;rel="type"
Link: <http://www.w3.org/2001/XMLSchema#dateTime> .
ns/ldp#Container>;rel="type"
Link: <http://localhost:8080/rest/path/to/resource> fedora:hasVersionwww.w3.org/ns/ldp#BasicContainer>;rel="type"
Link: <http://localhost:8080/rest/path/to/resource/fcr:versions/87a0a8c317f1e7dae533ec-b1b6-4da1-8bb9-f1964e253572> .
/static/constraints/ContainerConstraints.rdf>; rel="http://www.w3.org/ns/ldp#constrainedBy"
Link: <http://localhost:8080/rest/path/to/resource/fcr:versions/87a0a8c317f1e7dae533ec-b1b6-4da1-8bb9-f1964e253572> fedora:hasVersionLabel "v1"^^<http://www.w3.org/2001/XMLSchema#string> ;
fedora:created "2014-12-03T23:56:12.863Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> . |
Status: Status |
---|
subtle | true |
---|
colour | Green |
---|
title | 200 |
---|
| OK Status |
---|
|
subtle | true |
---|
colour | Red |
---|
title | 404 |
Not Found: This resource is not versioned or this resource is not exist.Response: The requested resource is not available.
Get a previous version of an objectRequest Headers:
ACCEPT application/ld+json, application/n-triplesresource6>; rel="timegate"
Link: <http://localhost:8080/rest/path/to/resource>; rel="original"
Link: <http://localhost:8080/rest/path/to/resource/fcr:versions>; rel="timemap"
Link: <http://mementoweb.org/ns#OriginalResource>; rel="type"
Link: <http://mementoweb.org/ns#TimeGate>; rel="type"
Accept-Patch: application/sparql-update
Accept-Post: text/turtle,text/rdf+n3,text/n3,application/rdf+xml,application/ |
xturtlexhtml+xml, application/xml, text/html, text/n3, text/plain, text/rdf+n3, text/turtleExample:
Code Block |
---|
curl httpld+json
Allow: MOVE,COPY,DELETE,POST,HEAD,GET,PUT,PATCH,OPTIONS
Link: <http://localhost:8080/rest/path/to/resource/fcr:versions/<version-label> |
Response:
Code Block |
---|
Status: 200 OK
Response Headers:
ETag: "39f0d8a01a066771e56f70be892a39a7b505843c"
Last-Modified: Tue, 20 May 2014 19:29:10 GMT
Content-Type: text/turtle
Body:
<http://localhost:8080/restacl>; rel="acl"
Preference-Applied: return=representation
Vary: Prefer
Vary: Accept
Vary: Range
Vary: Accept-Encoding
Vary: Accept-Language
Vary: Accept-Datetime
Location: http://localhost:8080/rest/path/to/resource/fcr:versions/87a0a8c317f1e72c658170-624d-40f9-96cb-21ede3392155> <http://fedora.info/definitions/v4/repository#primaryType> "nt:frozenNode"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://fedora.info/definitions/v4/repository#frozenPrimaryType> "nt:folder"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://fedora.info/definitions/v4/repository#created> "2014-05-20T19:29:00.192Z"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://fedora.info/definitions/v4/repository#frozenMixinTypes> "fedora:resource"^^<http://www.w3.org/2001/XMLSchema#string> , "mix:versionable"^^<http://www.w3.org/2001/XMLSchema#string> , "fedora:object"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://fedora.info/definitions/v4/repository#lastModified> "2014-05-20T19:29:10.555Z"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://fedora.info/definitions/v4/repository#frozenUuid> "fed529c6-2121-4b1d-83fc-cc4274563612"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://fedora.info/definitions/v4/repository#lastModifiedBy> "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://fedora.info/definitions/v4/repository#uuid> "87a0a8c317f1e72c658170-624d-40f9-96cb-21ede3392155"^^<http20180829154750
Content-Length: 0
Server: Jetty(9.3.1.v20150714) |
Status:
Status |
---|
subtle | true |
---|
colour | Green |
---|
title | 200 |
---|
|
302 Found Status |
---|
| |
---|
subtle | true |
---|
colour | Red |
---|
title | 400 |
---|
|
Bad Request: Accept-Datetime header not properly formatted per RFC-1123 Status |
---|
| |
---|
subtle | true |
---|
colour | Red |
---|
title | 406 |
---|
|
Unacceptable: No appropriate versioned resource found for the supplied Accept-Datetime value
Examples:
Code Block |
---|
#PUT
curl -X PUT -H "Link: <http://mementoweb.org/ns#OriginalResource>; rel=\"type\"" http://localhost:8080/rest/path/to/resource
#POST
curl -X POST -H "Link: <http://mementoweb.org/ns#OriginalResource>; rel=\"type\"" -H "Slug: resource" http://localhost:8080/rest/path/to |
Excerpt |
---|
Working with a versions container (a LDPCv)
Request URI: /path/to/resource/fcr:versions Methods: GET, POST, DELETE
Get a list of the available versions of an objectRequest Headers: ACCEPT application/ld+json, application/link-format, application/n-triples, application/rdf+xml, application/x-turtle, application/xhtml+xml, application/xml, text/html, text/n3, text/plain, text/rdf+n3, text/turtle Example: Code Block |
---|
curl -H "Accept: text/turtle" http://localhost:8080/rest/path/to/resource/fcr:versions |
Response: Code Block |
---|
Status: HTTP/1.1 200 OK
Headers:
ETag: W/"671df2a47622331ffb6b70b6156526a67e5ab760"
Last-Modified: Wed, 30 May 2018 21:03:54 GMT
Link: <http://www.w3.org/ns/ldp#Resource>;rel="type"
Link: <http://www.w3.org/2001ns/XMLSchema#string> ;
ldp#RDFSource>;rel="type"
Link: <http://fedora.info/definitions/v4/repository#createdBy> "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
a <http://www.jcp.org/jcr/nt/1.0frozenNode> , <http://www.jcp.org/jcr/nt/1.0base> , <http://www.jcp.org/jcr/mix/1.0referenceable> .
|
Status: Status |
---|
|
subtle | true |
---|
colour | Green |
---|
title | 200 |
OK Status |
---|
subtle | true |
---|
colour | Red |
---|
title | 404 |
Not Found: if the version or the resource does not existResponse: The requested resource is not available.
Status |
---|
colour | Blue |
---|
title | POST |
---|
localhost:8080/rest/path/to/resource/fcr:versions/fcr:acl>; rel="acl"
Link: <http://mementoweb.org/ns#TimeMap>; rel="type"
Link: <http://localhost:8080/rest/path/to/resource>; rel="original"
Link: <http://localhost:8080/rest/path/to/resource>; rel="timegate"
Link: <http://localhost:8080/rest/path/to/resource/fcr:versions>; rel="timemap"
Vary-Post: Memento-Datetime
Allow: POST,HEAD,GET,OPTIONS,DELETE
Preference-Applied: return=representation
Vary: Prefer
Vary: Accept
Vary: Range
Vary: Accept-Encoding
Vary: Accept-Language
Content-Type: text/turtle;charset=utf-8
Content-Length: 1944
Body:
@prefix memento: <http://mementoweb.org/ns#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix fedora: <http://fedora.info/definitions/v4/repository#> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
<http://localhost:8080/rest/path/to/resource/fcr:versions>
rdf:type fedora:TimeMap ;
rdf:type fedora:Resource ;
fedora:lastModifiedBy "bypassAdmin" ;
fedora:createdBy "bypassAdmin" ;
fedora:created "2018-05-30T21:00:48.169Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
fedora:lastModified "2018-05-30T21:03:54.88Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
memento:original <http://localhost:8080/rest/path/to/resource> ;
rdf:type ldp:RDFSource ;
fedora:writable true ;
ldp:contains <http://localhost:8080/rest/path/to/resource/fcr:versions/20180530210300> ;
ldp:contains <http://localhost:8080/rest/path/to/resource/fcr:versions/20180530210354> . |
Status:
Status |
---|
subtle | true |
---|
colour | Green |
---|
title | 200 |
---|
|
OK Status |
---|
| |
---|
subtle | true |
---|
colour | Red |
---|
title | 404 |
---|
|
Not Found: Versions container resource does not exist.
Create a new versioned resource (a new LDPRm)
Versions can by created in one of two ways, with a Memento-Datetime header and request body or with neither. If the Memento-Datetime header is omitted, the current time will be used by default and the current state of the versionable resource will be preserved. Any specified body will be ignored. If, however, the Memento-Datetime header is included, the versioned resource will be stored at this time marker and the request body will be stored as the versioned resource.
Request Headers
MEMENTO-DATETIME (Optional) An RFC-1123 Date. (E.g. "Wed, 30 May 2018 23:02:44 GMT")
Example 1 (Create a new version resource 'now.' Its state is that of the current versionable resource.):
Code Block |
---|
# Create version from current state of the object
curl -X POST http://localhost:8080/rest/path/to/resource/fcr:versions
|
Response:
Code Block |
---|
HTTP/1.1 201 Created
Date: Wed, 29 Aug 2018 21:21:34 GMT
Set-Cookie: JSESSIONID=dmqpuv06yty7b0tf9y94z3rx;Path=/
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Tue, 28-Aug-2018 21:21:34 GMT
ETag: W/"f7c04eb7e3f04c17d1fc852bef5f6b030ea271e7"
Last-Modified: Wed, 29 Aug 2018 20:22:11 GMT
Link: <http://localhost:8080/static/constraints/ContainerConstraints.rdf>; rel="http://www.w3.org/ns/ldp#constrainedBy"
Link: <http://localhost:8080/rest/path/to/resource>; rel="timegate"
Link: <http://localhost:8080/rest/path/to/resource>; rel="original"
Link: <http://localhost:8080/rest/path/to/resource/fcr:versions>; rel="timemap"
Memento-Datetime: Wed, 29 Aug 2018 21:21:34 GMT
Link: <http://mementoweb.org/ns#Memento>; rel="type"
Location: http://localhost:8080/rest/path/to/resource/fcr:versions/20180829212134
Content-Type: text/plain
Content-Length: 68
Server: Jetty(9.3.1.v20150714)
http://localhost:8080/rest/versioning/v9/fcr:versions/20180829212134 |
Status:
Status |
---|
| |
---|
subtle | true |
---|
colour | Green |
---|
title | 201 |
---|
|
Created: if a new version is created successfully Status |
---|
| |
---|
subtle | true |
---|
colour | Red |
---|
title | 404 |
---|
|
Not Found: if the version container resource does not exist
Example 2 (Create a new versioned resource at the supplied time marker. Its state is supplied as the request body.):
Code Block |
---|
# Create version by supplying body and Memento-Datetime
curl -X GET http://localhost:8080/rest/path/to/resource > resource.ttl
curl -X POST -H "Memento-Datetime: Wed, 30 May 2018 23:02:44 GMT" -H "Content-Type: text/turtle" --data-binary "@resource.ttl" http://localhost:8080/rest/path/to/resource/fcr:versions |
Response:
Code Block |
---|
HTTP/1.1 201 Created
Date: Wed, 29 Aug 2018 21:38:01 GMT
Set-Cookie: JSESSIONID=7bs7ddtba9l110261g9qyyotq;Path=/
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Tue, 28-Aug-2018 21:38:01 GMT
ETag: W/"a6b6c76b16935d00bcd1b5f259cfd2ecb225e3bd"
Last-Modified: Wed, 29 Aug 2018 20:22:11 GMT
Link: <http://localhost:8080/static/constraints/ContainerConstraints.rdf>; rel="http://www.w3.org/ns/ldp#constrainedBy"
Link: <http://localhost:8080/rest/path/to/resource>; rel="timegate"
Link: <http://localhost:8080/rest/path/to/resource>; rel="original"
Link: <http://localhost:8080/rest/path/to/resource/fcr:versions>; rel="timemap"
Memento-Datetime: Wed, 30 May 2018 23:02:44 GMT
Link: <http://mementoweb.org/ns#Memento>; rel="type"
Location: http://localhost:8080/rest/path/to/resource/fcr:versions/20180530230244
Content-Type: text/plain
Content-Length: 68
Server: Jetty(9.3.1.v20150714)
http://localhost:8080/rest/versioning/v9/fcr:versions/20180530230244 |
Status:
Status |
---|
| |
---|
subtle | true |
---|
colour | Green |
---|
title | 201 |
---|
|
Created: if a new version is created successfully Status |
---|
| |
---|
subtle | true |
---|
colour | Red |
---|
title | 400 |
---|
|
Bad Request: Request body was empty or invalid. Status |
---|
| |
---|
subtle | true |
---|
colour | Red |
---|
title | 404 |
---|
|
Not Found: if the version container resource does not exist Status |
---|
subtle | true |
---|
colour | Red |
---|
title | 409 |
---|
|
Conflict: if a version with the same timestamp already exists for this resource. Status |
---|
subtle | true |
---|
colour | Red |
---|
title | 415 |
---|
|
Unsupported media type: If a Memento-Datetime is supplied without an accompanying Content-Type header to indicate the mime type.
Remove the versions container and all versioned resources
NB: In addition to deleting all versioned resources, the parent - or versionable resource - will no longer be versionable, meaning the parent resource cannot be versioned until made versionable again. |
---|
Example:
Code Block |
---|
curl -X DELETE http://localhost:8080/rest/path/to/resource/fcr:versions |
Response:
Code Block |
---|
HTTP/1.1 204 No Content
Date: Wed, 29 Aug 2018 21:41:54 GMT
Set-Cookie: JSESSIONID=1hfa3law3t4kp3z3wjps3qw84;Path=/
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Tue, 28-Aug-2018 21:41:54 GMT
Server: Jetty(9.3.1.v20150714) |
Status:
Status |
---|
| |
---|
subtle | true |
---|
colour | Green |
---|
title | 204 |
---|
|
No Content: if the version is reverted successfully Status |
---|
| |
---|
subtle | true |
---|
colour | Red |
---|
title | 404 |
---|
|
Not Found: if the version does not exist
Excerpt |
---|
Working with a versioned resource (a LDPRm)
Request URI: /path/to/resource/fcr:versions/<timestamp> Methods: GET, DELETE
Get a specific versioned resourceRequest Headers: ACCEPT application/ld+json, application/link-format, application/n-triples, application/rdf+xml, application/x-turtle, application/xhtml+xml, application/xml, text/html, text/n3, text/plain, text/rdf+n3, text/turtle Example: Code Block |
---|
curl -H "Accept: text/turtle" http://localhost:8080/rest/path/to/resource/fcr:versions/20180829154750 |
Response: Code Block |
---|
HTTP/1.1 200 OK
Date: Thu, 30 Aug 2018 14:31:30 GMT
Set-Cookie: JSESSIONID=yb9ppso27n221q1xdvu4cqzi5;Path=/
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Wed, 29-Aug-2018 14:31:30 GMT
ETag: W/"e766f5e674845e72f7d589e346b6a96a7735336e"
Last-Modified: Wed, 29 Aug 2018 15:47:31 GMT
Link: <http://www.w3.org/ns/ldp#Resource>;rel="type"
Link: <http://www.w3.org/ns/ldp#Container>;rel="type"
Link: <http://www.w3.org/ns/ldp#BasicContainer>;rel="type"
Link: <http://localhost:8080/static/constraints/ContainerConstraints.rdf>; rel="http://www.w3.org/ns/ldp#constrainedBy"
Link: <http://localhost:8080/rest/path/to/resource>; rel="timegate"
Link: <http://localhost:8080/rest/path/to/resource>; rel="original"
Link: <http://localhost:8080/rest/path/to/resource/fcr:versions>; rel="timemap"
Allow: GET,HEAD,OPTIONS,DELETE
Memento-Datetime: Wed, 29 Aug 2018 15:47:50 GMT
Link: <http://mementoweb.org/ns#Memento>; rel="type"
Preference-Applied: return=representation
Vary: Prefer
Vary: Accept
Vary: Range
Vary: Accept-Encoding
Vary: Accept-Language
Content-Type: text/turtle;charset=utf-8
Content-Length: 1754
Server: Jetty(9.3.1.v20150714)
@prefix premis: <http://www.loc.gov/premis/rdf/v1#> .
@prefix test: <info:fedora/test/> .
@prefix memento: <http://mementoweb.org/ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix webac: <http://fedora.info/definitions/v4/webac#> .
@prefix acl: <http://www.w3.org/ns/auth/acl#> .
@prefix ns001: <http://localhost:8080/rest/ktest/> .
@prefix xsi: <http://www.w3.org/2001/XMLSchema-instance> .
@prefix xmlns: <http://www.w3.org/2000/xmlns/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix fedora: <http://fedora.info/definitions/v4/repository#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix ebucore: <http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
@prefix xs: <http://www.w3.org/2001/XMLSchema> .
@prefix fedoraconfig: <http://fedora.info/definitions/v4/config#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
<http://localhost:8080/rest/path/to/resource>
rdf:type ldp:RDFSource ;
rdf:type ldp:Container ;
rdf:type fedora:Resource ;
rdf:type ldp:BasicContainer ;
rdf:type fedora:Container ;
fedora:created "2018-08-29T15:47:31.041Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
fedora:writable true ;
fedora:lastModified "2018-08-29T15:47:31.041Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
fedora:lastModifiedBy "fedoraAdmin" ;
fedora:createdBy "fedoraAdmin" ;
rdf:type ldp:RDFSource ;
rdf:type ldp:Container ;
fedora:writable true .
|
Status: Create a new version of an objectRequest Headers SLUG (Required) A suggested name for the new child resource, which the repository may ignore. Example: Code Block |
---|
curl -X POST -H "Slug: newVersionName" http://localhost:8080/rest/path/to/resource/fcr:versions |
Response: Code Block |
---|
Status: 201 Created |
Status: Status |
---|
|
subtle | true |
---|
colour | Green |
---|
title | 201 |
Created: if a new version is created successfully Status |
---|
subtle | true |
---|
colour | Red |
---|
title | 404 |
Not Found: if the resource does not exist Status |
---|
subtle | true |
---|
colour | Red |
---|
title | 409 |
---|
|
Conflict: if the version label is already in use for another version of this rexourceResponse: The requested resource is not available.
Anchor |
---|
revert | revert | Revert to a previous version of an object OK Status |
---|
| |
---|
subtle | true |
---|
colour | Red |
---|
title | 404 |
---|
|
Not Found: Versions container resource does not exist.
Remove a previous version of an object
Example:
Code Block |
---|
curl -i -X DELETE http://localhost:8080/rest/path/to/resource/fcr:versions/20180829154750 |
Response:
Code Block |
---|
HTTP/1.1 204 No Content
Date: Thu, 30 Aug 2018 14:35:21 GMT
Set-Cookie: JSESSIONID=1w3ta3umg5nai1q4mtfp5qn48p;Path=/
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Wed, 29-Aug-2018 14:35:21 GMT
Server: Jetty(9.3.1.v20150714) |
Example:
Code Block |
---|
curl -X PATCH http://localhost:8080/rest/path/to/resource/fcr:versions/existingVersionName |
Response:
Code Block |
---|
Status: 204 No Content |
Status:
Status |
---|
subtle | true |
---|
colour | Green |
---|
title | 204 |
No Content: if the version is reverted successfully Status |
---|
subtle | true |
---|
colour | Red |
---|
title | 404 |
Not Found: if the version does not exist Response: The requested resource is not available.
Anchor |
---|
delete | delete | Request URI: /path/to/some/resource/fcr:versions/versionNameMethods: DELETE
Status |
---|
colour | Red |
---|
title | DELETE |
Remove a previous version of an objectExample:
Code Block |
---|
curl -X DELETE http://localhost:8080/rest/path/to/resource/fcr:versions/versionName |
Response:
Code Block |
---|
Status: 204 No Content |
Note |
---|
Trying to delete the current version of a resource will result in an error. To revert to an old version of a resource, first revert to the old version using the PATCH method, and then delete the newer version. |
Status:
Status |
---|
| |
---|
subtle | true |
---|
colour | Green |
---|
title | 204 |
---|
|
No Content: if the version is reverted was deleted successfully Status |
---|
| |
---|
subtle | true |
---|
colour | Red |
---|
title | 400 |
---|
|
Bad Request: if trying to delete the most recent versionResponse: Cannot remove current version
Status |
---|
subtle | true |
---|
colour | Red |
---|
title | 404 |
---|
|
Not Found: if the version does not existResponse: The requested resource is not available.