Warning |
---|
Transactions work as noted below as long as the requests take place with a single HTTP connection. The cURL examples do not work until the following ticket has been resolved: https://www.pivotaltracker.com/story/show/63029852 |
...
title | Click here to expand Transactions API... |
---|
Request URI: /fcr:tx; /path/to/transaction/fcr:tx
Methods: POST
Get the current status of the repository in a transaction Status title GET
Example:
Code Block |
---|
curl "http://localhost:8080/rest/tx:86dd0891-d975-42d8-8837-a24ad6041b59" |
Response:
Code Block |
---|
Status: 200 OK
Headers:
Link: http://localhost:8080/rest/tx:86dd0891-d975-42d8-8837-a24ad6041b59?limit=-1&offset=0;rel="first"
Body:
Same as non-transaction response. |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
...
Create a new transaction (or keep an existing transaction alive) Status colour Blue title POST
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:id}/fcr:tx |
Example:
Code Block |
---|
curl -X POST "http://localhost:8080/rest/fcr:tx" |
Response:
Code Block |
---|
Status: 201 Created
Headers:
Location: http://localhost:8080/rest/tx: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:83e34464-144e-43d9-af13-b3464a1fb9b5/path/to/object/to/create"
curl -X DELETE "http://localhost:8080/rest/tx:83e34464-144e-43d9-af13-b3464a1fb9b5/path/to/resource/to/delete"
curl -X POST "http://localhost:8080/rest/tx:83e34464-144e-43d9-af13-b3464a1fb9b5/fcr:tx/fcr:commit" |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
...
Save and commit an open transaction. Status colour Blue title POST
Any operations you made within the scope of the transaction will be applied together, meaning if any of them fail, the whole transaction will fail.
Example:
Code Block |
---|
curl -X POST "http://localhost:8080/rest/tx:123456789/fcr:tx/fcr:commit" |
Response:
Code Block |
---|
Status: 204 No Content |
Status:
Status | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Rollback and close an open transaction Status colour Blue title POST
Example:
Code Block |
---|
curl -X POST "http://localhost:8080/rest/tx:123456789/fcr:tx/fcr:rollback" |
Response:
Code Block |
---|
Status: 204 No Content |
Status:
Status | ||||||||
---|---|---|---|---|---|---|---|---|
|