In reading up on backing up GAE’s Datastore, where:
We strongly recommend that you set your application to read-only mode during a backup or restore…
After a cursory inspection, it appears that the only way to do this is via the GAE web admin UI, where you either Disable or Re-Enable Writes inside a page somewhere.
I would like to write some Ant buildfiles and/or shell and/or Python scripts that would allow me to backup/restore my GAE app’s Datastore automatically. This would mean I would need a way to automate the enabling/disabling of writes (putting my app into and out from a “read-only” mode) to my Datastore, all from inside some script (like I said, either Ant, bash or Python).
So I ask: is this even possible? Or is this something that must be done “manually” (via the web admin UI)? Thanks in advance!
The Capabilities Python API is the one that you can use yo read the state of some capabilities of your app like DataStore writes. Unfortunately this Api only have methods to read the state, but not for set the state.
edited:
Since the code must consult the Capabilities API to get the state of each functionality in the App-engine, and avoid failures by over-quota, system maintenance etc… One possible solution is to put a kind of interface in front of the Capabilities API within flags to disable each functionality.
pseudo code i.e: