basePath: /v1 host: monitor.test.com info: contact: {} description: 监控门户后台服务. license: {} termsOfService: http://swagger.io/terms/ title: Monitor Server API version: "1.0" paths: /api/v1/dashboard/chart: get: description: 获取chart数据 parameters: - description: panel里的chart id in: query name: id required: true type: integer - description: endpoint数组, ['88B525B4-43E8-4A7A-8E11-0E664B5CB8D0'] in: query items: type: string name: endpoint required: true type: array - description: metric数组, ['cpmid.busy'] in: query items: type: string name: metric required: true type: array - description: 开始时间 in: query name: start required: true type: string - description: 结束时间 in: query name: end type: string - description: 聚合类型 枚举 min max avg p95 none in: query name: aggregate type: string produces: - application/json responses: "200": description: '{''title'':''chart1'',''legend'':[''a'',''b''],''xaxis'':{},''yaxis'':{''unit'':''%''},''series'':[{''type'':''line'',''name'':''a'',''data'':[[1550221207000,100],[1550221217000,200],[1550221227000,150],[1550221237000,100],[1550221247000,120],[1550221257000,210],[1550221267000,130],[1550221277000,180]]},{''type'':''line'',''name'':''b'',''data'':[[1550221207000,110],[1550221217000,210],[1550221227000,130],[1550221237000,120],[1550221247000,100],[1550221257000,200],[1550221267000,170],[1550221277000,120]]}]}' schema: type: string summary: '页面通用接口 : 获取chart数据' /api/v1/dashboard/main: get: description: 获取主视图,有主机、网络等 parameters: - description: 页面类型,主机页面type=host in: query name: type required: true type: string produces: - application/json responses: "200": description: '{''search'':{''id'': 0,''enable'': false,''name'': '''',''search_url'': '''',''search_col'': '''',''refresh_panels'': false,''refresh_message'': false},''buttons'':[{''id'': 1,''group_id'': 1,''name'': ''time'',''b_type'': ''select'',''b_text'': ''时间段'',''refresh_panels'': false,''refresh_charts'': true,''option_group'': 1,''option'':[{''option_value'': ''-3600'', ''option_text'': ''1小时''},{''option_value'': ''-10800'', ''option_text'': ''3小时''},{''option_value'': ''-21600'', ''option_text'': ''6小时''},{''option_value'': ''-43200'', ''option_text'': ''12小时''}]}],''message'':{''enable'': true,''url'': ''/dashboard/message?group=1&endpoint={endpoint}''},''panels'':{''enable'': true,''type'': ''tabs'',''url'': ''/dashboard/panels?group=1''}}' schema: type: string summary: '页面通用接口 : 视图' /api/v1/dashboard/panels: get: description: 获取panels parameters: - description: panels url 上自带该id in: query name: group required: true type: integer - description: 需要在panels url上把{endpoint}替换 in: query name: endpoint required: true type: string produces: - application/json responses: "200": description: '[{''title'': ''panel_title'',''tags'':{''enable'': false,''url'': '''',''option'':[]},''charts'':[{''id'': 1,''col'': 6,''endpoint'':[''88B525B4-43E8-4A7A-8E11-0E664B5CB8D0''],''metric'':[''cpmid.busy''],''url'': ''/dashboard/chart''}]},{''title'': ''disk'',''tags'':{''enable'': true,''url'': ''/dashboard/tags?panel_id=1&endpoint=88B525B4-43E8-4A7A-8E11-0E664B5CB8D0&tag='',''option'':[{''option_value'': ''device=vda'',''option_text'': ''vda''},{''option_value'': ''device=vdb'',''option_text'': ''vdb''}]},''charts'':[{''id'': 2,''col'': 6,''endpoint'':[''88B525B4-43E8-4A7A-8E11-0E664B5CB8D0''],''metric'':[''disk.io.util/device=vda''],''url'': ''/dashboard/chart''},{''id'': 3,''col'': 6,''endpoint'':[''88B525B4-43E8-4A7A-8E11-0E664B5CB8D0''],''metric'':[''disk.io.await/device=vda''],''url'': ''/dashboard/chart''}]}]' schema: type: string summary: '页面通用接口 : 获取panels' /api/v1/dashboard/search: get: description: 模糊搜索 parameters: - description: 放弃search_col,直接把用户输入拼到url后面请求 in: query name: search required: true type: string - description: 数量限制 in: query name: limit type: string produces: - application/json responses: "200": description: '[{''option_value'': ''E7196678-F696-4AE3-8D5A-83CFC80B0801'',''option_text'': ''cnsz92vl00311:100.69.12.10''},{''option_value'': ''5DE6A2DE-B506-4385-82EB-B2533D751E7F'',''option_text'': ''cnsz92vl00312.cmftdc.cn:100.69.12.11''}]" 说明: 放弃search_col,统一以option的格式来返回' schema: type: string summary: '主页面接口 : 模糊搜索' /api/v1/dashboard/tags: get: description: 根据tag获取charts组 parameters: - description: url上自带该id in: query name: panel_id required: true type: integer - description: url上自带该endpoint in: query name: endpoint required: true type: string - description: tag button里面的option_value in: query name: tag required: true type: string produces: - application/json responses: "200": description: '[{''id'': 2,''col'': 6,''endpoint'':[''88B525B4-43E8-4A7A-8E11-0E664B5CB8D0''],''metric'':[''disk.io.util/device=vdb''],''url'': ''/dashboard/chart''},{''id'': 3,''col'': 6,''endpoint'':[''88B525B4-43E8-4A7A-8E11-0E664B5CB8D0''],''metric'':[''disk.io.await/device=vdb''],''url'': ''/dashboard/chart''}]' schema: type: string summary: '页面通用接口 : 根据tag获取charts组' /login: get: produces: - application/json responses: "200": description: '{"message": "successfully logout"}' schema: type: string summary: 登出 post: parameters: - description: username in: query name: username required: true type: string - description: password in: query name: password required: true type: string produces: - application/json responses: "200": description: '{"message": "login success"}' schema: type: string summary: 登录 swagger: "2.0"