Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guillotinaweb/guillotina_batch
https://github.com/guillotinaweb/guillotina_batch
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/guillotinaweb/guillotina_batch
- Owner: guillotinaweb
- Created: 2018-06-11T20:12:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-14T12:10:46.000Z (over 4 years ago)
- Last Synced: 2024-09-29T09:26:11.469Z (about 1 month ago)
- Language: Python
- Size: 103 KB
- Stars: 0
- Watchers: 10
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Guillotina Batch Docs
This package simple provides a `@batch` endpoint to Guillotina which
allows you to group multiple requests into one.By default all the requests use a single transaction that is commited when all
the requests finish successfully. If `?eager-commit=true` is provided, each request
will be committed independently.## Configuration
Just add a few lines to your config.yml::
{"applications": ["guillotina_batch"]}
## Usage
The `@batch` endpoint takes a array of batch definitions taking the following parameters:
- method:str
- endpoint:str
- headers:object[str, str]
- payload:objectFor example::
```
POST /db/container/@batch [{
"method": "POST",
"endpoint": "path/to/object/@sharing",
"payload": {
"prinperm": [{
"principal": "user1",
"permission": "guillotina.AccessContent",
"setting": "AllowSingle"
}]
}
},{
"method": "POST",
"endpoint": "path/to/object2/@sharing",
"payload": {
"prinperm": [{
"principal": "user1",
"permission": "guillotina.AccessContent",
"setting": "AllowSingle"
}]
}
}]```
## Limitations
It won't work with streamed responses.