Modify Datastore Admin Backup Built-in Task Queue

房东的猫 提交于 2021-01-29 15:14:02

问题


I'm new to Datastore. Currently, I'm using datastore admin to backup my data but I'm wondering if we can modify or override the built-in task queue on datastore admin /_ah/datastore_admin/backup.create?

What I want to do when exporting the data from datastore is that I would only need to export the data that has specific date range that I specify. I saw on the documentation that you can pass a parameter to the URL. Is its possible to pass the parameter on the date range like this one? /_ah/datastore_admin/backup.create?name=MyBackup&StartDate=12-01-20&EndDate=01-12-21.

Please let me know if I miss something.


回答1:


The datastore admin is deprecated. You should upgrade to the datastore export service.

But to answer your question, the datastore admin app hosted at /_ah/datastore_admin is an internal app which you cannot modify. However, you could write a custom handler to kick off the backup process, thereby passing in the params you need.

GAE example using taskqueue API:

params = {
    'StartDate': start_date,
    'EndDate': end_date
}

taskqueue.add(
    url='/_ah/datastore_admin/backup.create',
    params=params, 
    target='ah-builtin-python-bundle'
)

Again, I do not recommend this approach, as the service has been long deprecated and is due to disappear at any moment.



来源:https://stackoverflow.com/questions/65698872/modify-datastore-admin-backup-built-in-task-queue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!