描述

查看任务列表

请求地址

/v2/webservice/table/dumpengine-to-file-task-list

请求方法

Post

请求参数说明

参数名称 类型 是否必填 说明
app_id
zone_id
table_name

示例

{
    "app_id": 5,
    "zone_id": 2,
    "table_name": "pb2_webclient_list"
}

返回data参数说明

参数名称 类型 说明
app_id
zone_id
table_name
task_type 枚举string 配置类型, json base64 so
key_fields string key字段,多个使用逗号, 隔开了, 按顺序展示
value_fields value字段,多个使用逗号, 隔开了, 需按顺序展示
task_state enum 任务状态 // 任务状态``export enum TaskState {`` CheckConfig = 0, // '配置检查中',`` Pending = 1, // '检查成功待审核',`` InvalidConfig = 2, // '配置检查失败',`` Enable = 3, // '已启用',`` Abort = 4, // '审核失败',`` Disable = 5, // '已禁用',``}
run_time 每天任务执行时间
dest_machine_config object upload_type=0时,不为空{`` "dest_machine_ip": "127.0.0.1;localhost",`` "dest_machine_port": 3305,`` "dest_machine_username": "test",`` "dest_machine_password": "test",`` "dest_machine_dir": "dir/666"``}
cos_config object upload_type=1时,不为空{`` "end_point": "11",`` "access_key_id": "22",`` "access_key_secret": "33",`` "access_bucket_name": "44",`` "dest_dir": "55"``}
api_wirte_interface 0 1 0:使用SetData接口写入数据,1:使用SetKeySetValue接口写入数据
filter_begin_time number 最近访问时间过滤条件的开始时间,单位秒,为负值,0表示冷备时间,前端根据天数和时间点,算出和今天0点相差多少秒,传到接口,如:-129600, 算出的结果是:2天前的12:00:00
filter_end_time number 最近访问时间过滤条件的结束时间,单位秒,为负值,0表示冷备时间,前端根据天数和时间点,算出和今天0点相差多少秒,传到接口,如:-41400, 算出的结果是:-1天前的12:30:00

filter_begin_time 和 filter_end_time可以调用下面的函数转成天时分秒的格式

/**
 * 把秒转换为天-小时-分钟-秒展示
 */
export function SecondToDate(msd) {
  var time = msd
  if (time != null && time != '') {
    if (time > 60 && time < 60 * 60) {
      time = parseInt(time / 60.0) + '分钟' + parseInt((parseFloat(time / 60.0) - parseInt(time / 60.0)) * 60) + '秒';
    } else if (time >= 60 * 60 && time < 60 * 60 * 24) {
      time = parseInt(time / 3600.0) + '小时' + parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) + '分钟' + parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) - parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + '秒';
    } else if (time >= 60 * 60 * 24) {
      time = parseInt(time / 3600.0 / 24) + '天' + parseInt((parseFloat(time / 3600.0 / 24) - parseInt(time / 3600.0 / 24)) * 24) + '小时' + parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) + '分钟' + parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) - parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + '秒';
    } else {
      time = parseInt(time) + '秒';
    }
  }
  return time;
}

成功返回

{
    "code": 0,
    "request_id": "5fb2826b-fe21-4a51-baa3-d14d07dfc3e6",
    "data": {
        "list": [
            {
                "set_id": 1,
                "app_id": 2,
                "zone_id": 1,
                "table_name": "AccountBindTable",
                "key_fields": "key",
                "value_fields": "data",
                "run_time": "05:06:05",
                "task_type": "base64",
                "task_state": 2,
                "so_md5sum": "",
                "api_write_interface": 0,
                "upload_type": 1,
                "upload_method": "11:::22:::33:::44:::55",
                "app_name": "aaa2",
                "zone_name": "加表测试",
                "set_name": "autoinstall_Set",
                "cos_config": {
                    "end_point": "11",
                    "access_key_id": "22",
                    "access_key_secret": "33",
                    "access_bucket_name": "44",
                    "dest_dir": "55"
                },
                "filter_begin_time": -172736,
                "filter_end_time": -82738
            },
            {
                "set_id": 1,
                "app_id": 2,
                "zone_id": 1,
                "table_name": "GenericTableDemo",
                "key_fields": "uin",
                "value_fields": "name,score2,score3",
                "run_time": "00:00:00",
                "task_type": "json",
                "task_state": 2,
                "so_md5sum": "",
                "api_write_interface": 0,
                "upload_type": 0,
                "upload_method": "",
                "app_name": "aaa2",
                "zone_name": "加表测试",
                "set_name": "autoinstall_Set",
                "dest_machine_config": {
                    "dest_machine_ip": "127.0.0.1;localhost",
                    "dest_machine_port": 3305,
                    "dest_machine_username": "test",
                    "dest_machine_password": "test",
                    "dest_machine_dir": "dir/666"
                },
                "filter_begin_time": 57225,
                "filter_end_time": 57225
            },
        ],
        "total": 12
    }
}

失败返回

{

}

技术细节

每个表仅可配置一个导出任务

results matching ""

    No results matching ""