{
  "schemes": [
    "http"
  ],
  "swagger": "2.0",
  "info": {
    "description": "This is a dbactuator command collection.",
    "title": "dbactuator API",
    "termsOfService": "http://swagger.io/terms/",
    "contact": {
      "name": "API Support",
      "url": "http://www.swagger.io/support",
      "email": "support@swagger.io"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "0.0.1"
  },
  "host": "./dbactuator",
  "basePath": "/",
  "paths": {
    "/common/file-server": {
      "post": {
        "description": "通过 http 暴露指定目录可用于下载，可用于在重建备库时，从其它机器下载备份\n在 OS 不允许 ssh 登录（scp/sftp）时，可以临时启动该服务来获取备份文件",
        "consumes": [
          "application/json"
        ],
        "tags": [
          "common"
        ],
        "summary": "简单文件服务",
        "parameters": [
          {
            "description": "short description",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/dbm-services_bigdata_db-tools_dbactuator_pkg_components_fileserver.FileServerComp"
            }
          }
        ],
        "responses": {}
      }
    },
    "/common/rm-file": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "tags": [
          "common"
        ],
        "summary": "限速删除大文件",
        "parameters": [
          {
            "description": "short description",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/internal_subcmd_commoncmd.RMLargeFileParam"
            }
          }
        ],
        "responses": {}
      }
    },
    "/download/http": {
      "post": {
        "description": "支持限速、basicAuth 认证. 一般配合 common fileserver 使用\n# server1\n./dbactuator common file-server \\\n--payload-format raw \\\n--payload '{\"extend\":{\"bind_address\":\":8082\",\"mount_path\":\"/data/dbbak\",\"user\":\"xiaog\",\"password\":\"xxxx\",\"proc_maxidle_duration\":\"60s\"}}'\n\n# server2\ncurl -u 'xiaog:xxxx' 'http://server1:8082/datadbbak8082/dbactuator' -o dbactuator.bin --limit-rate 10k",
        "consumes": [
          "application/json"
        ],
        "tags": [
          "common"
        ],
        "summary": "http下载文件",
        "parameters": [
          {
            "description": "short description",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/dbm-services_bigdata_db-tools_dbactuator_pkg_components_backup_download.DFHttpParam"
            }
          }
        ],
        "responses": {}
      }
    },
    "/download/scp": {
      "post": {
        "description": "支持限速",
        "consumes": [
          "application/json"
        ],
        "tags": [
          "common"
        ],
        "summary": "scp下载文件",
        "parameters": [
          {
            "description": "short description",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/dbm-services_bigdata_db-tools_dbactuator_pkg_components_backup_download.DFScpParam"
            }
          }
        ],
        "responses": {}
      }
    }
  },
  "definitions": {
    "dbm-services_bigdata_db-tools_dbactuator_pkg_components_backup_download.DFHttpParam": {
      "type": "object",
      "required": [
        "file_list",
        "path_tgt",
        "server"
      ],
      "properties": {
        "auth_pass": {
          "description": "http url basic auth pass",
          "type": "string"
        },
        "auth_user": {
          "description": "http url basic auth user",
          "type": "string"
        },
        "bk_biz_id": {
          "type": "integer"
        },
        "bwlimit_mb": {
          "description": "单文件下载限速,单位 MB/s",
          "type": "integer"
        },
        "curl_options": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "curl_path": {
          "description": "curl 命令路径，默认留空. 目前只用于测试 url",
          "type": "string"
        },
        "file_list": {
          "description": "下载哪些文件",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "max_concurrency": {
          "description": "并发下载数",
          "type": "integer"
        },
        "path_tgt": {
          "description": "文件存放到本机哪个目录",
          "type": "string"
        },
        "server": {
          "description": "下载 url",
          "type": "string"
        }
      }
    },
    "dbm-services_bigdata_db-tools_dbactuator_pkg_components_backup_download.DFScpParam": {
      "type": "object",
      "required": [
        "file_src",
        "file_tgt"
      ],
      "properties": {
        "bk_biz_id": {
          "type": "integer"
        },
        "bwlimit_mb": {
          "description": "单文件下载限速,单位 MB/s",
          "type": "integer"
        },
        "file_src": {
          "description": "下载源",
          "allOf": [
            {
              "$ref": "#/definitions/dbm-services_bigdata_db-tools_dbactuator_pkg_components_backup_download.FileSrc"
            }
          ]
        },
        "file_tgt": {
          "description": "下载目标",
          "allOf": [
            {
              "$ref": "#/definitions/dbm-services_bigdata_db-tools_dbactuator_pkg_components_backup_download.FileTgt"
            }
          ]
        },
        "max_concurrency": {
          "description": "并发下载数",
          "type": "integer"
        }
      }
    },
    "dbm-services_bigdata_db-tools_dbactuator_pkg_components_backup_download.FileSrc": {
      "type": "object",
      "required": [
        "file_list",
        "path",
        "ssh_host",
        "ssh_port",
        "ssh_user"
      ],
      "properties": {
        "file_list": {
          "description": "源文件名列表，相对上面的 path",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "match": {
          "type": "string"
        },
        "path": {
          "description": "源文件所在目录",
          "type": "string"
        },
        "ssh_host": {
          "type": "string"
        },
        "ssh_pass": {
          "type": "string"
        },
        "ssh_port": {
          "type": "string"
        },
        "ssh_user": {
          "type": "string"
        }
      }
    },
    "dbm-services_bigdata_db-tools_dbactuator_pkg_components_backup_download.FileTgt": {
      "type": "object",
      "required": [
        "path"
      ],
      "properties": {
        "path": {
          "description": "文件下载目标目录",
          "type": "string"
        }
      }
    },
    "dbm-services_bigdata_db-tools_dbactuator_pkg_components_fileserver.FileServer": {
      "type": "object",
      "required": [
        "auth_user",
        "bind_address",
        "mount_path"
      ],
      "properties": {
        "acls": {
          "description": "访问来源限制，从前往后匹配。格式 `[\"allow 127.0.0.1/32\", \"deny all\"]`",
          "type": "array",
          "items": {
            "type": "string"
          },
          "example": [
            "allow all"
          ]
        },
        "auth_pass": {
          "description": "http basic auth pass，为空时会随机生成密码",
          "type": "string"
        },
        "auth_user": {
          "description": "http basic auth user",
          "type": "string"
        },
        "bind_address": {
          "description": "http file-server 监听地址. 不提供端口，会在 12000-19999 之间随机选择一个端口，不提供 ip 时默认 localhost",
          "type": "string"
        },
        "enable_tls": {
          "description": "暂不支持",
          "type": "boolean"
        },
        "max_connections": {
          "description": "限制最大连接数，超过需要等待. 为 0 时表示不限制",
          "type": "integer"
        },
        "mount_path": {
          "description": "将本地哪个目录通过 http 分享",
          "type": "string"
        },
        "path_prefix": {
          "description": "path_prefix 用在生成 url 时的路径前缀. 可留空",
          "type": "string"
        },
        "print_download": {
          "description": "输出 download http 的信息，方便使用",
          "type": "boolean"
        },
        "proc_maxidle_duration": {
          "description": "超过最大空闲时间，自动退出. 示例 3600s, 60m, 1h",
          "type": "string",
          "example": "1h"
        }
      }
    },
    "dbm-services_bigdata_db-tools_dbactuator_pkg_components_fileserver.FileServerComp": {
      "type": "object",
      "properties": {
        "extend": {
          "$ref": "#/definitions/dbm-services_bigdata_db-tools_dbactuator_pkg_components_fileserver.FileServer"
        }
      }
    },
    "internal_subcmd_commoncmd.RMLargeFileParam": {
      "type": "object",
      "required": [
        "bw_limit_mb",
        "filename"
      ],
      "properties": {
        "bw_limit_mb": {
          "description": "删除速度，MB/s，默认 30",
          "type": "integer",
          "default": 30,
          "maximum": 1000,
          "minimum": 1
        },
        "filename": {
          "type": "string"
        }
      }
    }
  }
}