Page History
...
- key: The unique identifier of the content record. Keys will be saved with a zone prefix. If the prefix is not specified, the local zone prefix will be added automatically. Because of the prefix, a key cannot contain colon (:) characters as it is used as the prefix separator.
- version: A version to chronologically identify the transaction. If a record with key already exists with a higher version, the request will be discarded.
- content: When the action is add/update, it is JSON content to store. Content will be saved encrypted and compressed if specified on the storage unit configuration.
- action: The transaction type to execute on the record's scope: add, update, delete. Custom transaction types can be specified in this field to trigger custom document and general events as described in here.
- policy: The policy to use when executing the action on the content record:
- add/update actions
- new: only adds the content if the key doesn't exist in the storage unit.
- overwrite: if a record with key already exists, it overwrites all of it's previous content (discards other existing scopes for that key), otherwise, it adds the record.
- merge: if a record with key already exists, it adds the scope information without affecting any other scopes for this record.
- delete actions:
- silent: If the record/scope for key doesn't exist, the request completes without an error.
- mustexist: If the record/scope for key doesn't exist, an error is reported back in the response.
- custom actions: policy is not required in these cases.
- add/update actions
Code Block | |||||
---|---|---|---|---|---|
| |||||
PUT POST transaction/execute/<storage-unit-name>/<scope> |
...
language | js |
---|---|
theme | RDark |
...
{ "content": {"doc": {"test":"value"}}, "action": "add", "policy": "merge", "key": "LOCAL_ZONE:B166F75594BF1B23A26A6F0074BEB88F", "version": 1445618448043 } |
Response
If the execute operation is successful, a 200 response code and an OK message are returned.
...
An optional report parameter can be specified to get processing statistics and error reports.
Code Block | ||||
---|---|---|---|---|
| ||||
POST transaction/batch/<storage-unit-name>/<scope>?report |
...
language | js |
---|---|
theme | RDark |
{"content": {"doc": {"test":"value"}},"action": "add", "policy": "merge", "key": "LOCAL_ZONE:B166F75594BF1B23A26A6F0074BEB88F", "version": 1445618448043} {"content": {"doc": {"test":"value2"}}, "action": "delete", "policy": "silent", "key": "EXTERNAL_ZONE:B6F5H6J8HGBF1B23A26A6F0074BEB8E5", "version": 1445618448133} |
Response
If the batch operation is successful, a 200 response code and an OK message are returned if no transactions failed. A COMPLETED_WITH_ERRORS message if one or more transactions failed.
...
Code Block | ||||
---|---|---|---|---|
| ||||
DELETE transaction/delete/<storage-unit-name>/<optional:scope> { "policy": "silent", //delete: silent, mustexist "key": "B6F5H6J8HGBF1B23A26A6F0074BEB8E5", "version": 1445618448133 } |
...
Response
If the delete operation is successful, a 200 response code and an OK message are returned.
...
Overview
Content Tools