/api/db/.../backup/control
实现了异步备份和恢复控制。
启动 REST 服务器(监听 8083 端口)后,以下 HTTP 请求将根据传递的 JSON 对象执行备份或还原的启动或停止操作:
http://localhost:8083/api/db/diskdb/backup/control
请求体是一个 JSON 对象。所需的操作及其参数在该对象中指定。
支持的操作及其参数如下所述。这些操作会调用相应的 C API 函数。因此,相同的限制和注意事项同样适用。有关操作和参数的详细说明,请参阅相应异步备份 C API 函数(mco_async_backup_start()、mco_async_backup_stop()、mco_async_restore_start() 和 mco_async_restore_stop())的文档页面。
参数
除非下文另有说明,否则这些参数都是可选的:
backup_start
启动异步备份进程。
file_name:string,必需。
backup_cycle_delay_msec:integer (默认为 0)
label:string (默认为空)
type:
AUTO | SNAPSHOT | INCREMENTAL
(默认为 AUTO)compression_level:integer (默认为 0)
cipher:string (默认为空)
backup_stop
停止异步备份进程。
- force:boolean (默认为 false)
restore_start
启动异步恢复进程。
file_name:string,必需。
label:string (默认为空)
cipher:string (默认为空)
restore_stop
停止异步还原过程。
- force:boolean (默认为 false)
示例
启动异步备份过程(请注意,部分可选参数缺失,因此将采用默认值):
{
"action": "backup_start",
"file_name": "database.bkp",
"label": "my_label",
"backup_cycle_delay_msec": 1000
}
正常停止异步备份进程(force默认为false):
{
"action": "backup_stop"
}
虽然并非强制要求,但可以显式地将 force 参数设置为 false:
{
"action": "backup_stop"
"force": false
}