【TcaplusDB知识库】如何申请数据(按进程)屏蔽备份
请求地址
POST
http://OmsAddress/app/newoms.php/webservice/business/backup-svr-data/apply-block-timer?cmd=10016&ip-type=webservicerest&access-token=AccessTokenVal
POST请求参数说明
| 参数名称 | 数据类型 | 说明 | 是否必填字段 | 备注 |
|---|---|---|---|---|
| set_id | 整型 | 备份的进程的所属的集群id | 是 | |
| app_id | 整型 | 备份的进程的所属的app_id | 是 | |
| svr_ids | 数组 | 备份的进程的id列表,如[‘126.2.2.3’,’126.2.2.5’],当svr_ids = 0时,表示屏蔽app_id下所有svr的备份 | 是 |
Data参数
使用json格式表示记录相关信息,示例如下:
{
"set_id": 126,
"app_id": 2,
"svr_ids": [
"126.2.2.3"
]
}
返回语法
返回参数说明
-
返回状态码不为200时,表示失败,返回数据为构造表数据失败的信息
-
返回状态码为200,表示表数据构造创建成功,返回的数据结构如下:
| 字段名称 | 数据类型 | 说明 | 备注 |
|---|---|---|---|
| ret | 整型 | 0,固定值 | |
| msg | 字符串 | 返回接口说明 | |
| id | 整型 | 生成的申请备份的单据id,在审核屏蔽定时备份中会使用到 |
请求示例
通过 curl 方法发起请求
命令中的红色部分是需要用户自行填写的参数,请参阅
curl -H "Content-type: application/json" -X "POST" -d '{ "set_id": 126, "app_id": 2, "svr_ids": [ "126.2.2.3" ] }' http://omsaddress/app/newoms.php/webservice/business/backup-svr-data/apply-block-timer?cmd=10016&ip-type=webservicerest&access-token=
返回示例
成功返回示例
http请求的Status=200
{
"ret": 0,
"msg": "success to apply backup svr table",
"id": 7
}
错误返回
http请求的Status!=200
{
"name": "Unauthorized",
"message": "You are requesting with an invalid credential.",
"code": 0,
"status": 401,
"type": "yii\\web UnauthorizedHttpException"
}
{
"conflict_apply": [
"those svr_id conflict with other data-back-up apply. apply_id is [\"2\"]. please check them first."
]
}
