Docker 运行swagger-editor实现在线接口文档维护与调试

文章目录

  • 一、序
  • 二, Docker部署准备
    • 1. 编辑docker-compose.yml
    • 2. 新增启动、停止脚本
    • 3. 样例 swagger.yaml
  • 三, 启动swagger-editor
    • 1. 使用说明
    • 2. 完整代码备份

一、序

因工作需要,需要搭建python运行环境,项目中python基于flask实现了swagger在线文档以及接口测试,前后端对接开发时需要使用。项目比较庞大,完全部署的话,只使用swagger在线文档功能的话,太浪费资源了。

Swagger Editor是一个开源的编辑器,并且它也是一个基于Angular的成功案例。在Swagger Editor中,我们可以基于YAML等语法定义我们的RESTful API,然后它会自动生成一篇排版优美的API文档,并且提供实时预览。简单说就是可以边编写API 边预览边测试。

这么看来swagger-editor可以基于swagger yaml文件实现在线接口文档生成,完全符合我们的需求。

二, Docker部署准备

docker、docker-compose环境安装就不介绍了。

1. 编辑docker-compose.yml

docker-compose实现了如下功能:

  1. 指定镜像、文件映射、端口映射、日志配置、重启策略
  2. 指定资源占有限制
  3. 通过环境变量指定默认加载的swagger配置文件

docker-compose.yml

version: '3'
services:
  swagger-editor:
    image: swaggerapi/swagger-editor
    container_name: swagger-editor
    deploy:
      resources:
        limits:
          cpus: '1.0'
          memory: 20M
        reservations:
          memory: 10M
    volumes:
      - ./swagger.yaml:/swagger.yaml
    ports:
      - 80:8080
    environment:
      SWAGGER_FILE: /swagger.yaml
    restart: on-failure
    logging:
      driver: 'json-file'
      options:
        max-size: '30m'
        max-file: '1'

2. 新增启动、停止脚本

start.sh

#!/bin/bash
docker-compose up -d

stop.sh

#!/bin/bash
docker-compose down

3. 样例 swagger.yaml

https://gitee.com/WeBankOS/FATE-Flow/blob/feature-1.10.0-update-doc/doc/swagger/swagger.yaml

三, 启动swagger-editor

将上一步准备的4个文件,放在同一目录,执行 sh start.sh
启动成功后输入http://127.0.0.1:80,出现如下界面:
在这里插入图片描述

1. 使用说明

界面左边是api 文件的 yaml 描述文件, 左边部分可以直接编辑API文档,编辑会立即更新到右边视图。右边是swagger-UI,可以查看文档,并直接进行API的测试。

上面有一排辅助菜单,包括yaml导入,文件格式转换,生成服务端/客户端代码等。

大家可以自行探索!

2. 完整代码备份

如何使用下面的备份文件恢复成原始的项目代码,请移步查阅:神奇代码恢复工具

//goto docker-compose.yml
version: '3'
services:
  swagger-editor:
    image: swaggerapi/swagger-editor
    container_name: swagger-editor
    deploy:
      resources:
        limits:
          cpus: '1.0'
          memory: 20M
        reservations:
          cpus: '0.05'
          memory: 10M
    volumes:
      - ./swagger.yaml:/swagger.yaml
    ports:
      - 80:8080
    environment:
      SWAGGER_FILE: /swagger.yaml
    restart: on-failure
    logging:
      driver: 'json-file'
      options:
        max-size: '30m'
        max-file: '1'
//goto restart.sh
#!/bin/bash
docker-compose down && docker-compose --compatibility up -d
//goto stop.sh
#!/bin/bash
docker-compose down
//goto swagger.yaml
openapi: 3.0.3
info:
  version: '1.10.0'
  title: Fate Flow 接口文档

paths:
  '/data/upload':
    post:
      summary: upload
      tags:
        - data-access
      parameters:
        - in: query
          name: id_delimiter
          description: data delimiter
          required: false
          schema:
            type: string
            example: ","
        - in: query
          name: head
          description: data head
          required: true
          schema:
            type: integer
            example: 0, 1
        - in: query
          name: partition
          description: compoting table partitions
          required: true
          schema:
            type: integer
            example: 16, ...
        - in: query
          name: table_name
          description: fate table name
          required: true
          schema:
            type: string
            example: breast_hetero_guest
        - in: query
          name: namespace
          description: fate table namespace
          required: true
          schema:
            type: string
            example: experiment
        - in: query
          name: storage_engine
          description: data storage engin
          required: false
          schema:
            type: string
            example: eggroll, localfs, hdfs, ...
        - in: query
          name: destory
          description: destory old table and upload new table
          required: false
          schema:
            type: integer
            example: 0, 1
        - in: query
          name: extend_sid
          description: extend sid to first column
          required: false
          schema:
            type: integer
            example: 0, 1
      requestBody:
        required: true
        content:
          application/octet-stream:
            schema:
              type: string
      responses:
        '200':
          description: upload success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    example:
                      {
                        "board_url": "http://xxx:8080/index.html#/dashboard?job_id=xxx&role=local&party_id=0",
                        "code": 0,
                        "dsl_path": "/data/projects/fate/fateflow/jobs/xxx/job_dsl.json",
                        "job_id": xxx,
                        "logs_directory": "/data/projects/fate/fateflow/logs/xxx",
                        "message": "success",
                        "model_info": {
                          "model_id": "local-0#model",
                          "model_version": xxx
                        },
                        "namespace": "experiment",
                        "pipeline_dsl_path": "/data/projects/fate/fateflow/jobs/xxx/pipeline_dsl.json",
                        "runtime_conf_on_party_path": "/data/projects/fate/fateflow/jobs/xxx/local/0/job_runtime_on_party_conf.json",
                        "runtime_conf_path": "/data/projects/fate/fateflow/jobs/xxx/job_runtime_conf.json",
                        "table_name": "breast_hetero_guest",
                        "train_runtime_conf_path": "/data/projects/fate/fateflow/jobs/xxx/train_runtime_conf.json"
                      }
        '404':
          description: upload failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: required parameters are missing

  '/data/download':
    post:
      summary: download data
      tags:
        - data-access
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - table_name
                - namespace
                - output_path
              properties:
                table_name:
                  type: string
                  example: breast_hetero_guest
                namespace:
                  type: string
                  example: experiment
                output_path:
                  type: string
                  example: /data/projects/fate/fateflow/experiment_download_breast_guest.csv
                delimiter:
                  type: string
                  example: ","
      responses:
        '200':
          description: download success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    example:
                      {
                        "board_url": "http://xxx:8080/index.html#/dashboard?job_id=xxx&role=local&party_id=0",
                        "code": 0,
                        "dsl_path": "/data/projects/fate/fateflow/jobs/xxx/job_dsl.json",
                        "job_id": xxx,
                        "logs_directory": "/data/projects/fate/fateflow/logs/xxx",
                        "message": "success",
                        "model_info": {
                          "model_id": "local-0#model",
                          "model_version": xxx
                        },
                        "namespace": "experiment",
                        "pipeline_dsl_path": "/data/projects/fate/fateflow/jobs/xxx/pipeline_dsl.json",
                        "runtime_conf_on_party_path": "/data/projects/fate/fateflow/jobs/xxx/local/0/job_runtime_on_party_conf.json",
                        "runtime_conf_path": "/data/projects/fate/fateflow/jobs/xxx/job_runtime_conf.json",
                        "table_name": "breast_hetero_guest",
                        "train_runtime_conf_path": "/data/projects/fate/fateflow/jobs/xxx/train_runtime_conf.json"
                      }
        '404':
          description: download failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: required parameters are missing

  '/data/upload/history':
    post:
      summary: history of upload job info
      tags:
        - data-access
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                job_id:
                  type: string
                  example: 202103241706521313480
                limit:
                  type: integer
                  description: limit output
                  example: 1
      responses:
        '200':
          description: get success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: array
                    items:
                      type: object
                      example:
                        {
                          "202103241706521313480": {
                            "notes": "",
                            "schema": {
                                "header": "y,x0,x1,x2,x3,x4,x5,x6,x7,x8,x9",
                                "sid": "id"
                            },
                            "upload_info": {
                              "namespace": "experiment",
                              "partition": 4,
                              "table_name": "breast_hetero_guest",
                              "upload_count": 569
                            }
                          }
                        }
        '404':
          description: get failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 100
                  retmsg:
                    type: string
                    example: server error

  '/table/bind':
    post:
      summary: bind a storage address to fate table
      tags:
        - table
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - engine
                - address
                - namespace
                - name
                - head
                - id_delimiter
                - partitions
              properties:
                engine:
                  type: string
                  example: mysql
                name:
                  type: string
                  example: breast_hetero_guest
                namespace:
                  type: string
                  example: experiment
                address:
                  type: object
                  description: storage address
                  example:
                    user: fate
                    passwd: fate
                    host: 127.0.0.1
                    port: 3306
                    db: xxx
                    name: xxx
                partitions:
                  type: integer
                  description: fate computing table partitions
                  example: 16
                head:
                  type: integer
                  description: 1 means data have head
                  example: 0,1
                id_delimiter:
                  type: string
                  description: data table or intermediate storage table delimiter
                  example: ","
                in_serialized:
                  type: integer
                  description: data serialized, standlone/eggroll/mysql/path storage default 1, others default 0
                  example: 0, 1
                drop:
                  type: integer
                  description: if table is exist, will delete it
                  example: 0,1
                id_column:
                  type: string
                  example: "id"
                feature_column:
                  type: string
                  description: delimited by ","
                  example: x1,x2,x3
      responses:
        '200':
          description: bind table success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      table_name:
                        type: string
                        example: breast_hetero_guest
                      namespace:
                        type: string
                        example: experiment
        '404':
          description: bind table failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 100
                  retmsg:
                    type: string
                    example: engine xxx address xxx check failed

  '/table/delete':
    post:
      summary: delete fate table
      tags:
        - table
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - table_name
                - namespace
              properties:
                table_name:
                  type: string
                  example: breast_hetero_guest
                namespace:
                  type: string
                  example: experiment
      responses:
        '200':
          description: delete table success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      table_name:
                        type: string
                        example: breast_hetero_guest
                      namespace:
                        type: string
                        example: experiment
        '404':
          description: delete table failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: no find table

  '/table/list':
    post:
      summary: get job all tables
      tags:
        - table
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - job_id
                - role
                - party_id
              properties:
                job_id:
                  type: string
                  example: 202101251515021092240
                role:
                  type: string
                  example: guest
                party_id:
                  type: string
                  example: 10000
      responses:
        '200':
          description: get tables success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    example:
                      {
                        "DataIO_0":
                        {
                          "input":
                          {
                            "Reader_0.data_0":
                            {
                              "name": xxx,
                              "namespace": xxx
                            }
                          },
                          "output":
                          {
                            "data_0":
                            {
                              "name": xxx,
                              "namespace": xxx
                            }
                          }
                        },
                        "Intersection_0":
                        {
                          "input":
                          {
                            "DataIO_0.data_0":
                            {
                              "name": xxx,
                              "namespace": xxx
                            }
                          },
                          "output":
                          {
                            "data_0":
                            {
                              "name": xxx,
                              "namespace": xxx
                            }
                          }
                        },
                        "Reader_0":
                        {
                          "input":
                          {
                            "table":
                            {
                              "name": xxx,
                              "namespace": "xxxx"
                            }
                          },
                          "output":
                          {
                            "data_0":
                            {
                              "name": xxx,
                              "namespace": xxx
                            }
                          }
                        }
                      }
        '404':
          description: delete table failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: no find table

  '/table/table_info':
    post:
      summary: query table info
      tags:
        - table
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - table_name
                - namespace
              properties:
                table_name:
                  type: string
                  example: breast_hetero_guest
                namespace:
                  type: string
                  example: experiment
      responses:
        '200':
          description: get tables success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    example:
                      {
                        "address":
                        {},
                        "count": 569,
                        "exist": 1,
                        "namespace": "experiment",
                        "partition": 16,
                        "schema":
                        {
                          "header": "id,y,x0,x1,x2,x3,x4,x5,x6,x7,x8,x9",
                          "sid": "id"
                        },
                        "table_name": "breast_hetero_guest"
                      }
        '404':
          description: query table failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: no find table

  '/table/tracking/source':
    post:
      summary: tracking table source
      tags:
        - table
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - table_name
                - namespace
              properties:
                table_name:
                  type: string
                  example: breast_hetero_guest
                namespace:
                  type: string
                  example: experiment
      responses:
        '200':
          description: tracking success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: array
                    items:
                      type: object
                      example:
                        {
                          "parent_table_name": xxx,
                          "parent_table_namespace": xxx,
                          "source_table_name": xxx,
                          "source_table_namespace": xxx
                        }
        '404':
          description: tracking failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: no find table

  '/table/tracking/job':
    post:
      summary: tracking using table job
      tags:
        - table
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - table_name
                - namespace
              properties:
                table_name:
                  type: string
                  example: breast_hetero_guest
                namespace:
                  type: string
                  example: experiment
      responses:
        '200':
          description: tracking success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: array
                    items:
                      type: object
                      example:
                        {
                          "count": 5,
                          "job":
                          [
                            "202104212104472450460",
                            "202104212127150470680",
                            "202104220937051579910",
                            "202104212038599210200",
                            "202104212131462630720"
                          ]
                        }
        '404':
          description: tracking failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: no find table

  '/job/submit':
    post:
      summary: submit job
      tags:
        - job
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - dsl
                - runtime_conf
              properties:
                dsl:
                  type: object
                  example:
                    {
                      "components":
                      {
                        "dataio_0":
                        {
                          "input":
                          {
                            "data":
                            {
                              "data":
                              [
                                "reader_0.table"
                              ]
                            }
                          },
                          "module": "DataIO",
                          "need_deploy": true,
                          "output":
                          {
                            "data":
                            [
                              "train"
                            ],
                            "model":
                            [
                              "dataio"
                            ]
                          }
                        },
                        "evaluation_0":
                        {
                          "input":
                          {
                            "data":
                            {
                              "data":
                              [
                                "hetero_lr_0.train"
                              ]
                            }
                          },
                          "module": "Evaluation",
                          "output":
                          {
                            "data":
                            [
                              "evaluate"
                            ]
                          }
                        },
                        "hetero_feature_binning_0":
                        {
                          "input":
                          {
                            "data":
                            {
                              "data":
                              [
                                "intersection_0.train"
                              ]
                            }
                          },
                          "module": "HeteroFeatureBinning",
                          "output":
                          {
                            "data":
                            [
                              "train"
                            ],
                            "model":
                            [
                              "hetero_feature_binning"
                            ]
                          }
                        },
                        "hetero_feature_selection_0":
                        {
                          "input":
                          {
                            "data":
                            {
                              "data":
                              [
                                "hetero_feature_binning_0.train"
                              ]
                            },
                            "isometric_model":
                            [
                              "hetero_feature_binning_0.hetero_feature_binning"
                            ]
                          },
                          "module": "HeteroFeatureSelection",
                          "output":
                          {
                            "data":
                            [
                              "train"
                            ],
                            "model":
                            [
                              "selected"
                            ]
                          }
                        },
                        "hetero_lr_0":
                        {
                          "input":
                          {
                            "data":
                            {
                              "train_data":
                              [
                                "hetero_feature_selection_0.train"
                              ]
                            }
                          },
                          "module": "HeteroLR",
                          "output":
                          {
                            "data":
                            [
                              "train"
                            ],
                            "model":
                            [
                              "hetero_lr"
                            ]
                          }
                        },
                        "intersection_0":
                        {
                          "input":
                          {
                            "data":
                            {
                              "data":
                              [
                                "dataio_0.train"
                              ]
                            }
                          },
                          "module": "Intersection",
                          "output":
                          {
                            "data":
                            [
                              "train"
                            ]
                          }
                        },
                        "reader_0":
                        {
                          "module": "Reader",
                          "output":
                          {
                            "data":
                            [
                              "table"
                            ]
                          }
                        }
                      }
                    }
                runtime_conf:
                  type: object
                  example:
                    {
                      "component_parameters":
                      {
                        "common":
                        {
                          "hetero_lr_0":
                          {
                            "alpha": 0.01,
                            "batch_size": 320,
                            "init_param":
                            {
                              "init_method": "random_uniform"
                            },
                            "learning_rate": 0.15,
                            "max_iter": 3,
                            "optimizer": "rmsprop",
                            "penalty": "L2"
                          },
                          "intersection_0":
                          {
                            "intersect_method": "raw",
                            "only_output_key": false,
                            "sync_intersect_ids": true
                          }
                        },
                        "role":
                        {
                          "guest":
                          {
                            "0":
                            {
                              "dataio_0":
                              {
                                "label_name": "y",
                                "label_type": "int",
                                "output_format": "dense",
                                "with_label": true
                              },
                              "reader_0":
                              {
                                "table":
                                {
                                  "name": "breast_hetero_guest",
                                  "namespace": "experiment"
                                }
                              }
                            }
                          },
                          "host":
                          {
                            "0":
                            {
                              "dataio_0":
                              {
                                "output_format": "dense",
                                "with_label": false
                              },
                              "evaluation_0":
                              {
                                "need_run": false
                              },
                              "reader_0":
                              {
                                "table":
                                {
                                  "name": "breast_hetero_host",
                                  "namespace": "experiment"
                                }
                              }
                            }
                          }
                        }
                      },
                      "dsl_version": "2",
                      "initiator":
                      {
                        "party_id": 9999,
                        "role": "guest"
                      },
                      "job_parameters":
                      {
                        "common":
                        {
                          "auto_retries": 1,
                          "computing_partitions": 8,
                          "task_cores": 4,
                          "task_parallelism": 2
                        }
                      },
                      "role":
                      {
                        "arbiter":
                        [
                          10000
                        ],
                        "guest":
                        [
                          9999
                        ],
                        "host":
                        [
                          10000
                        ]
                      }
                    }
      responses:
        '200':
          description: submit job success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    example:
                      {
                        "board_url": xxx,
                        "code": 0,
                        "dsl_path": xxx,
                        "job_id": xxx,
                        "logs_directory": xxx,
                        "message": "success",
                        "model_info":
                        {
                          "model_id": xxx,
                          "model_version": xxx
                        },
                        "pipeline_dsl_path": xxx,
                        "runtime_conf_on_party_path": xxx,
                        "runtime_conf_path": xxx,
                        "train_runtime_conf_path": xxx
                      }
        '404':
          description: submit job failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: "config error"

  '/job/stop':
    post:
      summary: stop job
      tags:
        - job
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - job_id
              properties:
                job_id:
                  type: string
                  example: 202103231958539401540
                stop_status:
                  type: string
                  default: cancel
                  example: "failed"
                  description: "failed or cancel"
      responses:
        '200':
          description: stop job success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
        '404':
          description: stop job failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: no find job

  '/job/rerun':
    post:
      summary: rerun job
      tags:
        - job
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - job_id
              properties:
                job_id:
                  type: string
                  example: 202103231958539401540
      responses:
        '200':
          description: rerun job success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
        '404':
          description: rerun job failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: no find job

  '/job/query':
    post:
      summary: query job
      tags:
        - job
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - job_id
              properties:
                job_id:
                  type: string
      responses:
        '200':
          description: query job success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: array
                    items:
                      type: object
                      example:
                        {
                          "f_apply_resource_time": xxx,
                          "f_cancel_signal": false,
                          "f_cancel_time": xxx,
                          "f_cores": 8,
                          "f_create_date": xxx,
                          "f_create_time": xxx,
                          "f_description": "",
                          "f_dsl": {},
                          "f_elapsed": 14380,
                          "f_end_date": xxx,
                          "f_end_scheduling_updates": 1,
                          "f_end_time": xxx,
                          "f_engine_name": "EGGROLL",
                          "f_engine_type": "computing",
                          "f_initiator_party_id": "20001",
                          "f_initiator_role": "guest",
                          "f_is_initiator": true,
                          "f_job_id": xxx,
                          "f_memory": 0,
                          "f_name": "",
                          "f_party_id": "20001",
                          "f_progress": 14,
                          "f_ready_signal": false,
                          "f_ready_time": null,
                          "f_remaining_cores": 8,
                          "f_remaining_memory": 0,
                          "f_rerun_signal": false,
                          "f_resource_in_use": false,
                          "f_return_resource_time": xxx,
                          "f_role": "guest",
                          "f_roles": {},
                          "f_runtime_conf": {},
                          "f_runtime_conf_on_party": {},
                          "f_start_date": xxx,
                          "f_start_time": xxx,
                          "f_status": "failed",
                          "f_status_code": null,
                          "f_tag": "job_end",
                          "f_train_runtime_conf": {},
                          "f_update_date": xxx,
                          "f_update_time": xxx,
                          "f_user": {},
                          "f_user_id": ""
                        }
        '404':
          description: query job failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: no find job

  '/job/list/job':
    post:
      summary: list jobs
      tags:
        - job
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: '`0` means no limit'
                  example: 20
                page:
                  type: integer
                  example: 1
                job_id:
                  type: string
                  example: '202112020129140220090'
                party_id:
                  type: integer
                  example: 9999
                role:
                  type: array
                  items:
                    type: string
                    enum:
                      - guest
                      - host
                      - arbiter
                      - local
                status:
                  type: array
                  items:
                    type: string
                    enum:
                      - success
                      - running
                      - waiting
                      - failed
                      - canceled
                description:
                  type: string
                  description: '`notes` on front-end'
                order_by:
                  type: string
                  description: 'defaults `create_time`'
                  enum:
                      - create_time
                      - start_time
                      - end_time
                      - elapsed
                order:
                  type: string
                  description: 'defaults `desc`'
                  enum:
                      - asc
                      - desc
      responses:
        '200':
          description: jobs list
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      count:
                        type: integer
                        example: 1
                      jobs:
                        type: array
                        items:
                          type: object
                          example:
                            apply_resource_time: 1638379762883
                            cancel_signal: false
                            cancel_time:
                            cores: 4
                            create_date: '2021-12-02 01:29:18'
                            create_time: 1638379758581
                            description: ''
                            dsl:
                              components:
                                dataio_0:
                                  input:
                                    data:
                                      data:
                                        - reader_0.data
                                  module: DataIO
                                  output:
                                    data:
                                      - data
                                    model:
                                      - model
                                hetero_feature_binning_0:
                                  input:
                                    data:
                                      data:
                                        - intersection_0.data
                                  module: HeteroFeatureBinning
                                  output:
                                    data:
                                      - data
                                    model:
                                      - model
                                intersection_0:
                                  input:
                                    data:
                                      data:
                                        - dataio_0.data
                                  module: Intersection
                                  output:
                                    cache:
                                      - cache
                                    data:
                                      - data
                                reader_0:
                                  module: Reader
                                  output:
                                    data:
                                      - data
                                  provider: fate_flow@1.7.0
                            elapsed: 116548
                            end_date: '2021-12-02 01:31:19'
                            end_scheduling_updates: 1
                            end_time: 1638379879547
                            engine_name: STANDALONE
                            engine_type: computing
                            initiator_party_id: '10000'
                            initiator_role: guest
                            is_initiator: true
                            job_id: '202112020129140220090'
                            memory: 0
                            name: ''
                            partners:
                              - 9999
                            party_id: 10000
                            progress: 100
                            ready_signal: false
                            ready_time:
                            remaining_cores: 4
                            remaining_memory: 0
                            rerun_signal: false
                            resource_in_use: false
                            return_resource_time: 1638379879568
                            role: guest
                            roles:
                              guest:
                                - 10000
                              host:
                                - 9999
                            runtime_conf:
                              component_parameters:
                                common:
                                  hetero_feature_binning_0:
                                    adjustment_factor: 0.5
                                    bin_indexes: -1
                                    bin_names:
                                    bin_num: 10
                                    category_indexes:
                                    category_names:
                                    compress_thres: 10000
                                    error: 0.001
                                    head_size: 10000
                                    local_only: false
                                    method: quantile
                                    transform_param:
                                      transform_cols:
                                        - 0
                                        - 1
                                        - 2
                                      transform_names:
                                      transform_type: woe
                                role:
                                  guest:
                                    '0':
                                      dataio_0:
                                        with_label: true
                                      reader_0:
                                        table:
                                          name: breast_hetero_guest
                                          namespace: experiment
                                  host:
                                    '0':
                                      dataio_0:
                                        with_label: false
                                      hetero_feature_binning_0:
                                        transform_param:
                                          transform_type:
                                      reader_0:
                                        table:
                                          name: breast_hetero_host
                                          namespace: experiment
                              conf_path: "/tmp/tmp2zc5tf8b/job_runtime_conf.json"
                              dsl_path: "/tmp/tmp2zc5tf8b/job_dsl.json"
                              dsl_version: 2
                              initiator:
                                party_id: 10000
                                role: guest
                              job_parameters:
                                common:
                                  adaptation_parameters:
                                    if_initiator_baseline: true
                                    request_task_cores: 4
                                    task_cores_per_node: 4
                                    task_memory_per_node: 0
                                    task_nodes: 1
                                  auto_retries: 0
                                  auto_retry_delay: 1
                                  computing_engine: STANDALONE
                                  computing_partitions: 4
                                  eggroll_run: { }
                                  engines_address: { }
                                  federated_mode: SINGLE
                                  federated_status_collect_type: PUSH
                                  federation_engine: STANDALONE
                                  job_type: train
                                  model_id: guest-10000#host-9999#model
                                  model_version: '202112020129140220090'
                                  pulsar_run: { }
                                  rabbitmq_run: { }
                                  spark_run: { }
                                  storage_engine: STANDALONE
                                  task_parallelism: 1
                              role:
                                guest:
                                  - 10000
                                host:
                                  - 9999
                            runtime_conf_on_party:
                              component_parameters:
                                common:
                                  hetero_feature_binning_0:
                                    adjustment_factor: 0.5
                                    bin_indexes: -1
                                    bin_names:
                                    bin_num: 10
                                    category_indexes:
                                    category_names:
                                    compress_thres: 10000
                                    error: 0.001
                                    head_size: 10000
                                    local_only: false
                                    method: quantile
                                    transform_param:
                                      transform_cols:
                                        - 0
                                        - 1
                                        - 2
                                      transform_names:
                                      transform_type: woe
                                role:
                                  guest:
                                    '0':
                                      dataio_0:
                                        with_label: true
                                      reader_0:
                                        table:
                                          name: breast_hetero_guest
                                          namespace: experiment
                                  host:
                                    '0':
                                      dataio_0:
                                        with_label: false
                                      hetero_feature_binning_0:
                                        transform_param:
                                          transform_type:
                                      reader_0:
                                        table:
                                          name: breast_hetero_host
                                          namespace: experiment
                              conf_path: "/tmp/tmp2zc5tf8b/job_runtime_conf.json"
                              dsl_path: "/tmp/tmp2zc5tf8b/job_dsl.json"
                              dsl_version: 2
                              initiator:
                                party_id: 10000
                                role: guest
                              job_parameters:
                                adaptation_parameters:
                                  if_initiator_baseline: false
                                  request_task_cores: 4
                                  task_cores_per_node: 4
                                  task_memory_per_node: 0
                                  task_nodes: 1
                                auto_retries: 0
                                auto_retry_delay: 1
                                computing_engine: STANDALONE
                                computing_partitions: 4
                                eggroll_run:
                                  eggroll.session.processors.per.node: 4
                                engines_address:
                                  computing:
                                    cores_per_node: 20
                                    nodes: 1
                                  federation:
                                    cores_per_node: 20
                                    nodes: 1
                                  storage:
                                    cores_per_node: 20
                                    nodes: 1
                                federated_mode: SINGLE
                                federated_status_collect_type: PUSH
                                federation_engine: STANDALONE
                                job_type: train
                                model_id: guest-10000#host-9999#model
                                model_version: '202112020129140220090'
                                pulsar_run: { }
                                rabbitmq_run: { }
                                spark_run: { }
                                storage_engine: STANDALONE
                                task_parallelism: 1
                              role:
                                guest:
                                  - 10000
                                host:
                                  - 9999
                            start_date: '2021-12-02 01:29:22'
                            start_time: 1638379762999
                            status: success
                            status_code:
                            tag: job_end
                            train_runtime_conf: { }
                            update_date: '2021-12-02 01:32:04'
                            update_time: 1638379924749
                            user:
                              guest:
                                '10000': ''
                              host:
                                '9999': ''
                            user_id: ''

  '/job/list/task':
    post:
      summary: list tasks
      tags:
        - job
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: '`0` means no limit'
                  example: 20
                page:
                  type: integer
                  example: 1
                job_id:
                  type: string
                  example: '202112020129140220090'
                party_id:
                  type: integer
                  example: 9999
                role:
                  type: string
                  enum:
                    - guest
                    - host
                    - arbiter
                    - local
                component_name:
                  type: string
                  example: upload_0
                order_by:
                  type: string
                  description: 'defaults `create_time`'
                  enum:
                      - create_time
                      - start_time
                      - end_time
                      - elapsed
                order:
                  type: string
                  description: 'defaults `asc`'
                  enum:
                      - asc
                      - desc
      responses:
        '200':
          description: jobs list
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      count:
                        type: integer
                        example: 1
                      tasks:
                        type: array
                        items:
                          type: object
                          example:
                            auto_retries: 0
                            auto_retry_delay: 1
                            cmd:
                              - "/root/Codes/FATE/venv/bin/python3.6"
                              - "/root/Codes/FATE/fateflow/python/fate_flow/worker/task_executor.py"
                              - "--job_id"
                              - '202112020129140220090'
                              - "--component_name"
                              - hetero_feature_binning_0
                              - "--task_id"
                              - 202112020129140220090_hetero_feature_binning_0
                              - "--task_version"
                              - 0
                              - "--role"
                              - guest
                              - "--party_id"
                              - '10000'
                              - "--config"
                              - "/root/Codes/FATE/fateflow/jobs/202112020129140220090/guest/10000/hetero_feature_binning_0/202112020129140220090_hetero_feature_binning_0/0/task_executor/6b6f4b1852cc11ec8a8700155d13c16c/config.json"
                              - "--result"
                              - "/root/Codes/FATE/fateflow/jobs/202112020129140220090/guest/10000/hetero_feature_binning_0/202112020129140220090_hetero_feature_binning_0/0/task_executor/6b6f4b1852cc11ec8a8700155d13c16c/result.json"
                              - "--log_dir"
                              - "/root/Codes/FATE/fateflow/logs/202112020129140220090/guest/10000/hetero_feature_binning_0"
                              - "--parent_log_dir"
                              - "/root/Codes/FATE/fateflow/logs/202112020129140220090/guest/10000"
                              - "--worker_id"
                              - 6b6f4b1852cc11ec8a8700155d13c16c
                              - "--run_ip"
                              - 127.0.0.1
                              - "--job_server"
                              - 127.0.0.1:9380
                              - "--session_id"
                              - 202112020129140220090_hetero_feature_binning_0_0_guest_10000
                              - "--federation_session_id"
                              - 202112020129140220090_hetero_feature_binning_0_0
                            component_module: HeteroFeatureBinning
                            component_name: hetero_feature_binning_0
                            component_parameters:
                              CodePath: HeteroFeatureBinningGuest
                              ComponentParam:
                                _feeded_deprecated_params: [ ]
                                _is_raw_conf: false
                                _name: HeteroFeatureBinning#hetero_feature_binning_0
                                _user_feeded_params:
                                  - head_size
                                  - category_names
                                  - bin_num
                                  - transform_param.transform_names
                                  - transform_param
                                  - compress_thres
                                  - error
                                  - method
                                  - bin_indexes
                                  - transform_param.transform_type
                                  - bin_names
                                  - category_indexes
                                  - local_only
                                  - transform_param.transform_cols
                                  - adjustment_factor
                                adjustment_factor: 0.5
                                bin_indexes: -1
                                bin_names:
                                bin_num: 10
                                category_indexes:
                                category_names:
                                compress_thres: 10000
                                encrypt_param:
                                  key_length: 1024
                                  method: Paillier
                                error: 0.001
                                head_size: 10000
                                local_only: false
                                method: quantile
                                need_run: true
                                optimal_binning_param:
                                  adjustment_factor:
                                  init_bin_nums: 1000
                                  init_bucket_method: quantile
                                  max_bin:
                                  max_bin_pct: 1
                                  metric_method: iv
                                  min_bin_pct: 0.05
                                  mixture: true
                                skip_static: false
                                transform_param:
                                  transform_cols:
                                    - 0
                                    - 1
                                    - 2
                                  transform_names:
                                  transform_type: woe
                              conf_path: "/tmp/tmp2zc5tf8b/job_runtime_conf.json"
                              dsl_path: "/tmp/tmp2zc5tf8b/job_dsl.json"
                              dsl_version: 2
                              initiator:
                                party_id: 10000
                                role: guest
                              job_parameters:
                                common:
                                  adaptation_parameters:
                                    if_initiator_baseline: true
                                    request_task_cores: 4
                                    task_cores_per_node: 4
                                    task_memory_per_node: 0
                                    task_nodes: 1
                                  auto_retries: 0
                                  auto_retry_delay: 1
                                  computing_engine: STANDALONE
                                  computing_partitions: 4
                                  eggroll_run: { }
                                  engines_address: { }
                                  federated_mode: SINGLE
                                  federated_status_collect_type: PUSH
                                  federation_engine: STANDALONE
                                  job_type: train
                                  model_id: guest-10000#host-9999#model
                                  model_version: '202112020129140220090'
                                  pulsar_run: { }
                                  rabbitmq_run: { }
                                  spark_run: { }
                                  storage_engine: STANDALONE
                                  task_parallelism: 1
                              local:
                                party_id: 10000
                                role: guest
                              module: HeteroFeatureBinning
                              role:
                                guest:
                                  - 10000
                                host:
                                  - 9999
                            create_date: '2021-12-02 01:29:21'
                            create_time: 1638379761918
                            elapsed: 9095
                            end_date: '2021-12-02 01:31:04'
                            end_time: 1638379864051
                            engine_conf:
                              computing_engine: STANDALONE
                            federated_mode: SINGLE
                            federated_status_collect_type: PUSH
                            initiator_party_id: '10000'
                            initiator_role: guest
                            job_id: '202112020129140220090'
                            party_id: '10000'
                            party_status: success
                            provider_info:
                              class_path:
                                feature_instance: feature.instance.Instance
                                feature_vector: feature.sparse_vector.SparseVector
                                homo_model_convert: protobuf.homo_model_convert.homo_model_convert
                                interface: components.components.Components
                                model: protobuf.generated
                                model_migrate: protobuf.model_migrate.model_migrate
                              env:
                                PYTHONPATH: "/root/Codes/FATE/python"
                              name: fate
                              path: "/root/Codes/FATE/python/federatedml"
                              version: 1.7.0
                            role: guest
                            run_ip: 127.0.0.1
                            run_on_this_party: true
                            run_pid: 29934
                            start_date: '2021-12-02 01:30:47'
                            start_time: 1638379847118
                            status: success
                            status_code:
                            task_id: 202112020129140220090_hetero_feature_binning_0
                            task_version: 0
                            update_date: '2021-12-02 01:31:06'
                            update_time: 1638379866439
                            worker_id: 6b6f4b1852cc11ec8a8700155d13c16c

  '/job/update':
    post:
      summary: job notes
      tags:
        - job
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - job_id
                - role
                - party_id
                - notes
              properties:
                job_id:
                  type: string
                  example: "2022xxx"
                role:
                  type: string
                  example: guest
                party_id:
                  type: integer
                  example: 10000
                notes:
                  type: string
                  example: this is a test
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: no find job

  '/job/parameter/update':
    post:
      summary: update job parameter
      tags:
        - job
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - job_id
              properties:
                job_id:
                  type: string
                  example: "2022xxx"
                component_parameters:
                  type: object
                  example:
                    {
                      "common":
                      {
                        "hetero_lr_0":
                        {
                          "max_iter": 10
                        }
                      }
                    }
                job_parameters:
                  type: object
                  example:
                    {
                      "common":
                      {
                        "auto_retries": 2
                      }
                    }
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    example:
                      {
                        "component_parameters":
                        {
                          "common":
                          {
                            "hetero_lr_0":
                            {
                              "alpha": 0.01,
                              "batch_size": 320,
                              "init_param":
                              {
                                "init_method": "random_uniform"
                              },
                              "learning_rate": 0.15,
                              "max_iter": 10,
                              "optimizer": "rmsprop",
                              "penalty": "L2"
                            },
                            "intersection_0":
                            {
                              "intersect_method": "raw",
                              "only_output_key": false,
                              "sync_intersect_ids": true
                            }
                          },
                          "role":
                          {
                            "guest":
                            {
                              "0":
                              {
                                "dataio_0":
                                {
                                  "label_name": "y",
                                  "label_type": "int",
                                  "output_format": "dense",
                                  "with_label": true
                                },
                                "reader_0":
                                {
                                  "table":
                                  {
                                    "name": "breast_hetero_guest",
                                    "namespace": "experiment"
                                  }
                                }
                              }
                            },
                            "host":
                            {
                              "0":
                              {
                                "dataio_0":
                                {
                                  "output_format": "dense",
                                  "with_label": false
                                },
                                "evaluation_0":
                                {
                                  "need_run": false
                                },
                                "reader_0":
                                {
                                  "table":
                                  {
                                    "name": "breast_hetero_host",
                                    "namespace": "experiment"
                                  }
                                }
                              }
                            }
                          }
                        },
                        "components":
                        [],
                        "job_parameters":
                        {
                          "common":
                          {
                            "adaptation_parameters":
                            {
                              "if_initiator_baseline": true,
                              "request_task_cores": 4,
                              "task_cores_per_node": 4,
                              "task_memory_per_node": 0,
                              "task_nodes": 1
                            },
                            "auto_retries": 2,
                            "auto_retry_delay": 1,
                            "computing_engine": "EGGROLL",
                            "computing_partitions": 4,
                            "eggroll_run":
                            {},
                            "engines_address":
                            {},
                            "federated_mode": "MULTIPLE",
                            "federated_status_collect_type": "PUSH",
                            "inheritance_info":
                            {},
                            "job_type": "train",
                            "model_id": "arbiter-10001#guest-20001#host-10001#model",
                            "model_version": "202204251958539401540",
                            "pulsar_run":
                            {},
                            "rabbitmq_run":
                            {},
                            "spark_run":
                            {},
                            "task_parallelism": 1
                          }
                        },
                        "src_party_id": "20001",
                        "src_role": "guest"
                      }
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: no find job

  '/job/config':
    post:
      summary: job config
      tags:
        - job
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - job_id
              properties:
                job_id:
                  type: string
                  example: "2022xxx"
                role:
                  type: string
                  example: guest
                party_id:
                  type: integer
                  example: 10000
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    example:
                      {
                        "dsl":
                        {},
                        "job_id": "2022xxx",
                        "model_info":
                        {},
                        "runtime_conf":
                        {},
                        "train_runtime_conf":
                        {}
                      }
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: no find job

  '/job/log/download':
    post:
      summary: download job log (tar.gz)
      tags:
        - job
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - job_id
              properties:
                job_id:
                  type: string
      responses:
        '200':
          description: get job log success
          content:
            application/octet-stream:
              schema:
                type: string
                description: file xxx_log.tar.gz
        '404':
          description: get job list failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 404
                  retmsg:
                    type: string
                    example: Log file path xxx not found. Please check if the job id is valid.

  '/job/log/path':
    post:
      summary: job log path
      tags:
        - job
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - job_id
              properties:
                job_id:
                  type: string
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    example:
                      {
                        "logs_directory": "/data/projects/fate/fateflow/logs/xxx"
                      }
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: no find job

  '/job/task/query':
    post:
      summary: query task
      tags:
        - job
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - job_id
              properties:
                job_id:
                  type: string
                role:
                  type: string
                  example: guest
                party_id:
                  type: integer
                  example: 10000
                component_name:
                  type: string
                  example: reader_0
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: array
                    description: tasks list
                    items:
                      type: object
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: no find task

  '/job/clean':
    post:
      summary: clean job
      tags:
        - job
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - job_id
              type: object
              properties:
                job_id:
                  type: string
                role:
                  type: string
                  example: guest
                party_id:
                  type: integer
                  example: 10000
                component_name:
                  type: string
                  example: reader_0
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: no find task

  '/job/clean/queue':
    post:
      summary: cancel waiting job
      tags:
        - job
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    example:
                      {
                        "202204261616186991350": 0,
                        "202204261616198643190": 0,
                        "202204261616210073410": 0
                      }
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: server error

  '/tracking/job/data_view':
    post:
      summary: data view
      tags:
        - tracking
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - job_id
                - role
                - party_id
              type: object
              properties:
                job_id:
                  type: string
                role:
                  type: string
                  example: guest
                party_id:
                  type: integer
                  example: 10000
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    example:
                      {
                        "dataset":
                        {
                          "guest":
                          {
                            "9999":
                            {
                              "Reader_0": "xxx.xxx"
                            }
                          },
                          "host":
                          {
                            "10000":
                            {
                              "Reader_0": "xxx.xxx"
                            }
                          }
                        },
                        "model_summary":
                        {},
                        "partner":
                        {
                          "host":
                          [
                            10000
                          ]
                        },
                        "roles":
                        {
                          "guest":
                          [
                            9999
                          ],
                          "host":
                          [
                            10000
                          ]
                        }
                      }
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: error

  '/tracking/component/metric/all':
    post:
      summary: get component all metric
      tags:
        - tracking
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - job_id
                - role
                - party_id
                - component_name
              type: object
              properties:
                job_id:
                  type: string
                role:
                  type: string
                  example: guest
                party_id:
                  type: integer
                  example: 10000
                component_name:
                  type: string
                  example: HeteroSecureBoost_0
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    example:
                      {
                        "train":
                        {
                          "loss":
                          {
                            "data":
                            [
                              [
                                0,
                                0.6076415445876732
                              ],
                              [
                                1,
                                0.5374539452565573
                              ],
                              [
                                2,
                                0.4778598986135903
                              ],
                              [
                                3,
                                0.42733599866560723
                              ],
                              [
                                4,
                                0.38433409799127843
                              ]
                            ],
                            "meta":
                            {
                              "Best": 0.38433409799127843,
                              "curve_name": "loss",
                              "metric_type": "LOSS",
                              "name": "train",
                              "unit_name": "iters"
                            }
                          }
                        }
                      }
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: error

  '/tracking/component/metrics':
    post:
      summary: get component metric name and namespace
      tags:
        - tracking
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - job_id
                - role
                - party_id
                - component_name
              type: object
              properties:
                job_id:
                  type: string
                role:
                  type: string
                  example: guest
                party_id:
                  type: integer
                  example: 10000
                component_name:
                  type: string
                  example: Intersection_0
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    example:
                      {
                        "train":
                        [
                          "intersection"
                        ]
                      }
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: error

  '/tracking/component/metric_data':
    post:
      summary: get component metric data
      tags:
        - tracking
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - job_id
                - role
                - party_id
                - component_name
                - metric_name
                - metric_namespace
              type: object
              properties:
                job_id:
                  type: string
                role:
                  type: string
                  example: guest
                party_id:
                  type: integer
                  example: 10000
                component_name:
                  type: string
                  example: Intersection_0
                metric_name:
                  type: string
                  example: intersection
                metric_namespace:
                  type: string
                  example: train
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    example:
                      {
                        "data":
                        [
                          [
                            "intersect_count",
                            569
                          ],
                          [
                            "intersect_rate",
                            1.0
                          ],
                          [
                            "unmatched_count",
                            0
                          ],
                          [
                            "unmatched_rate",
                            0.0
                          ]
                        ],
                        "meta":
                        {
                          "intersect_method": "raw",
                          "join_method": "inner_join",
                          "metric_type": "INTERSECTION",
                          "name": "intersection"
                        }
                      }
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: error

  '/tracking/component/parameters':
    post:
      summary: get component parameters
      tags:
        - tracking
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - job_id
                - role
                - party_id
                - component_name
              type: object
              properties:
                job_id:
                  type: string
                role:
                  type: string
                  example: guest
                party_id:
                  type: integer
                  example: 10000
                component_name:
                  type: string
                  example: Intersection_0
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    example:
                      {
                        "ComponentParam":
                        {
                          "_feeded_deprecated_params":
                          [
                            "repeated_id_owner",
                            "intersect_cache_param",
                            "join_role",
                            "encode_params",
                            "allow_info_share",
                            "repeated_id_process",
                            "random_bit",
                            "with_encode",
                            "info_owner"
                          ],
                          "_is_raw_conf": false,
                          "_name": "Intersection#Intersection_0",
                          "_user_feeded_params":
                          [
                            "repeated_id_owner",
                            "encode_params.salt",
                            "intersect_method",
                            "intersect_cache_param.encrypt_type",
                            "encode_params.encode_method",
                            "encode_params",
                            "intersect_cache_param",
                            "intersect_cache_param.id_type",
                            "intersect_cache_param.use_cache",
                            "join_role",
                            "allow_info_share",
                            "repeated_id_process",
                            "sync_intersect_ids",
                            "random_bit",
                            "only_output_key",
                            "with_encode",
                            "encode_params.base64",
                            "info_owner"
                          ],
                          "allow_info_share": false,
                          "cardinality_only": false,
                          "dh_params":
                          {
                            "hash_method": "sha256",
                            "key_length": 1024,
                            "salt": ""
                          },
                          "encode_params":
                          {
                            "base64": false,
                            "encode_method": "none",
                            "salt": ""
                          },
                          "info_owner": "guest",
                          "intersect_cache_param":
                          {
                            "encrypt_type": "sha256",
                            "id_type": "phone",
                            "use_cache": false
                          },
                          "intersect_method": "raw",
                          "intersect_preprocess_params":
                          {
                            "encrypt_method": "rsa",
                            "false_positive_rate": 0.001,
                            "filter_owner": "guest",
                            "hash_method": "sha256",
                            "preprocess_method": "sha256",
                            "preprocess_salt": "",
                            "random_state": null
                          },
                          "join_method": "inner_join",
                          "join_role": "guest",
                          "new_sample_id": false,
                          "only_output_key": false,
                          "random_bit": 128,
                          "raw_params":
                          {
                            "base64": false,
                            "hash_method": "none",
                            "join_role": "guest",
                            "salt": "",
                            "use_hash": false
                          },
                          "repeated_id_owner": "guest",
                          "repeated_id_process": false,
                          "rsa_params":
                          {
                            "final_hash_method": "sha256",
                            "hash_method": "sha256",
                            "key_length": 1024,
                            "random_base_fraction": null,
                            "random_bit": 128,
                            "salt": "",
                            "split_calculation": false
                          },
                          "run_cache": false,
                          "run_preprocess": false,
                          "sample_id_generator": "guest",
                          "sync_cardinality": false,
                          "sync_intersect_ids": true,
                          "with_encode": false,
                          "with_sample_id": false
                        },
                        "module": "Intersection"
                      }
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: error

  '/tracking/component/summary/download':
    post:
      summary: get component summary
      tags:
        - tracking
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - job_id
                - role
                - party_id
                - component_name
              type: object
              properties:
                job_id:
                  type: string
                role:
                  type: string
                  example: guest
                party_id:
                  type: integer
                  example: 10000
                component_name:
                  type: string
                  example: Intersection_0
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    example:
                      {
                        "cardinality_only": false,
                        "intersect_num": 569,
                        "intersect_rate": 1.0
                      }
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: error

  '/tracking/component/output/model':
    post:
      summary: get component output model
      tags:
        - tracking
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - job_id
                - role
                - party_id
                - component_name
              type: object
              properties:
                job_id:
                  type: string
                role:
                  type: string
                  example: guest
                party_id:
                  type: integer
                  example: 10000
                component_name:
                  type: string
                  example: Intersection_0
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: error

  '/tracking/component/output/data':
    post:
      summary: get component output data
      tags:
        - tracking
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - job_id
                - role
                - party_id
                - component_name
              type: object
              properties:
                job_id:
                  type: string
                role:
                  type: string
                  example: guest
                party_id:
                  type: integer
                  example: 10000
                component_name:
                  type: string
                  example: Intersection_0
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    example:
                      [
                        [
                          [
                            "58",
                            1,
                            -0.422281,
                            -0.558102,
                            -0.506991,
                            -0.450875,
                            -1.326851,
                            -1.223647,
                            -1.296979,
                            -1.575895,
                            -0.747019,
                            -1.166825
                          ],
                          [
                            "66",
                            1,
                            -1.213336,
                            0.957974,
                            -1.19832,
                            -0.966647,
                            0.983301,
                            -0.558944,
                            -0.854288,
                            -0.752745,
                            -0.036814,
                            0.452425
                          ]
                        ]
                      ]
                  meta:
                    type: object
                    example:
                      {
                        "header":
                        [
                          [
                            "id",
                            "y",
                            "x0",
                            "x1",
                            "x2",
                            "x3",
                            "x4",
                            "x5",
                            "x6",
                            "x7",
                            "x8",
                            "x9"
                          ]
                        ],
                        "names":
                        [
                          "data_0"
                        ],
                        "total":
                        [
                          569
                        ]
                      }
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: error

  '/tracking/component/output/data/download':
    post:
      summary: download component output data (tar.gz)
      tags:
        - tracking
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - job_id
                - role
                - party_id
                - component_name
              type: object
              properties:
                job_id:
                  type: string
                role:
                  type: string
                  example: guest
                party_id:
                  type: integer
                  example: 10000
                component_name:
                  type: string
                  example: Intersection_0
      responses:
        '200':
          description: success
          content:
            application/octet-stream:
              schema:
                type: string
                example: ""
                description: file data.tar.gz
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: error

  '/tracking/component/output/data/table':
    post:
      summary: get component output data table info
      tags:
        - tracking
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - job_id
                - role
                - party_id
                - component_name
              type: object
              properties:
                job_id:
                  type: string
                role:
                  type: string
                  example: guest
                party_id:
                  type: integer
                  example: 10000
                component_name:
                  type: string
                  example: Intersection_0
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: array
                    items:
                      type: object
                      example:
                        [
                          {
                            "data_name": "data_0",
                            "table_name": "ab035e12b09711ec943e525400c367ed",
                            "table_namespace": "output_data_202203311009181495690_Intersection_0_0"
                          }
                        ]
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: No found table, please check if the parameters are correct

  '/tracking/component/list':
    post:
      summary: get component list
      tags:
        - tracking
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - job_id
              type: object
              properties:
                job_id:
                  type: string
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    example:
                      {
                        "components":
                        [
                          "HeteroFeatureSelection_0",
                          "DataIO_0",
                          "Reader_0",
                          "HeteroSecureBoost_0",
                          "HeteroFeatureBinning_0",
                          "Intersection_0",
                          "Evaluation_0"
                        ]
                      }
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: error

  '/resource/query':
    post:
      summary: query conputing engine resource
      tags:
        - resource
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - engine_name
              type: object
              properties:
                engine_name:
                  type: string
                  example: EGGROLL, SPARK
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    example: {"computing_engine_resource":{"f_cores":16,"f_create_date":"2022-02-10 16:14:03","f_create_time":1644480843818,"f_engine_config":{"cores_per_node":16,"nodes":1},"f_engine_entrance":"fate_on_eggroll","f_engine_name":"EGGROLL","f_engine_type":"computing","f_memory":0,"f_nodes":1,"f_remaining_cores":16,"f_remaining_memory":0,"f_update_date":"2022-04-27 15:48:33","f_update_time":1651045713996},"use_resource_job":[]}
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: error

  '/resource/return':
    post:
      summary: return job resource
      tags:
        - resource
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - job_id
              type: object
              properties:
                engine_name:
                  type: string
                  example: 202204261616175720130
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    example: [{"job_id":"202204261616175720130","party_id":"20001","resource_in_use":true,"resource_return_status":ture,"role":"guest"}]
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: no found job

  '/permission/grant/privilege':
    post:
      summary: grant privilege
      tags:
        - permission
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - src_role
                - src_party_id
              type: object
              properties:
                src_role:
                  type: string
                  example: "guest"
                src_party_id:
                  type: string
                  example: 9999
                privilege_role:
                  type: string
                  description: multiple separated by ",". like "guest, host, arbiter" or "all"
                  example: all
                privilege_component:
                  type: string
                  description: multiple separated by ",". like "create, run, stop" or "all"
                  example: all
                privilege_command:
                  type: string
                  description: multiple separated bu ",". like "reader, dataio, ..." or "all"
                  example: all

      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: error

  '/permission/delete/privilege':
    post:
      summary: delete privilege
      tags:
        - permission
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - src_role
                - src_party_id
              type: object
              properties:
                src_role:
                  type: string
                  example: "guest"
                src_party_id:
                  type: string
                  example: 9999
                privilege_role:
                  type: string
                  description: multiple separated by ",". like "guest, host, arbiter" or "all"
                  example: all
                privilege_component:
                  type: string
                  description: multiple separated by ",". like "create, run, stop" or "all"
                  example: all
                privilege_command:
                  type: string
                  description: multiple separated bu ",". like "reader, dataio, ..." or "all"
                  example: all

      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: error

  '/permission/query/privilege':
    post:
      summary: query privilege
      tags:
        - permission
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - src_role
                - src_party_id
              type: object
              properties:
                src_role:
                  type: string
                  example: "guest"
                src_party_id:
                  type: string
                  example: 9999
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    example: {"privilege_command":["stop","run","create"],"privilege_component":["reader", "dataio","heterolinr", "heterolr", "localbaseline","columnexpand","heteropearson","featurescale","datastatistics","feldmanverifiablesum"],"privilege_role":["host","guest","arbiter"],"role":"guest","src_party_id":"9999"}
        '404':
          description: failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 101
                  retmsg:
                    type: string
                    example: error


  '/info/fateboard':
    post:
      summary: get fateboard host and port
      tags:
        - information
      responses:
        '200':
          description: fateboard host and port
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      host:
                        type: string
                        example: 127.0.0.1
                      port:
                        type: integer
                        example: 8080
        '404':
          description: fateboard is not configured
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 404
                  retmsg:
                    type: string
                    example: fateboard is not configured

  '/info/mysql':
    post:
      summary: test mysql connection
      tags:
        - information
      responses:
        '200':
          description: connect to mysql successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
        '404':
          description: mysql only available on cluster mode
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 404
                  retmsg:
                    type: string
                    example: mysql only available on cluster mode
        '503':
          description: connect to mysql failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 503
                  retmsg:
                    type: string
                    description: error message

  '/info/eggroll':
    post:
      summary: test eggroll connection
      tags:
        - information
      responses:
        '200':
          description: connect to eggroll successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
        '404':
          description: eggroll only available on cluster mode
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 404
                  retmsg:
                    type: string
                    example: eggroll only available on cluster mode
        '503':
          description: connect to eggroll failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 503
                  retmsg:
                    type: string
                    description: error message

  '/model/deploy':
    post:
      summary: deploy a model for predict
      tags:
        - model
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model_id
                - model_version
              properties:
                model_id:
                  type: string
                  example: 'arbiter-10000#guest-9999#host-10000#model'
                model_version:
                  type: string
                  example: '202111032155391167400'
                components_checkpoint:
                  type: object
                  description: specify a checkpoint model to replace the pipeline model
                  example:
                    hetero_lr_0:
                      step_index: 5
                  additionalProperties:
                    type: object
                    description: use step_index or step_name to specity a checkpoint
                    properties:
                      step_index:
                        type: integer
                        example: 5
                      step_name:
                        type: string
                        example: round_5
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      model_id:
                        type: string
                        example: 'arbiter-9999#guest-10000#host-9999#model'
                      model_version:
                        type: string
                        example: '202111032227378766180'
                      arbiter:
                        type: object
                        properties:
                          party_id:
                            type: integer
                            example: 9999
                      guest:
                        type: object
                        properties:
                          party_id:
                            type: integer
                            example: 10000
                      host:
                        type: object
                        properties:
                          party_id:
                            type: integer
                            example: 9999
                      detail:
                        type: object
                        properties:
                          arbiter:
                            type: object
                            properties:
                              party_id:
                                type: object
                                properties:
                                  retcode:
                                    type: integer
                                    example: 0
                                  retmsg:
                                    type: string
                                    example: deploy model of role arbiter 9999 success
                          guest:
                            type: object
                            properties:
                              party_id:
                                type: object
                                properties:
                                  retcode:
                                    type: integer
                                    example: 0
                                  retmsg:
                                    type: string
                                    example: deploy model of role guest 10000 success
                          host:
                            type: object
                            properties:
                              party_id:
                                type: object
                                properties:
                                  retcode:
                                    type: integer
                                    example: 0
                                  retmsg:
                                    type: string
                                    example: deploy model of role host 9999 success

  '/model/transfer/{model_id}/{model_version}':
    post:
      summary: download a model by model_id and model_version
      tags:
        - model
      parameters:
        - name: model_id
          in: path
          required: true
          description: 'model id (replace # with ~)'
          schema:
            type : string
            example: 'host~10000~arbiter-10000~guest-9999~host-10000~model'
        - name: model_version
          in: path
          required: true
          description: model version
          schema:
            type : string
            example: '202105060929263278441'
      responses:
        '200':
          description: model data
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    description: base64 encoded model data
        '404':
          description: model not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 404
                  retmsg:
                    type: string
                    example: model not found

  '/model/load':
    post:
      summary: load a deployed model on Fate-Serving
      tags:
        - model
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - initiator
                - role
                - job_parameters
              properties:
                initiator:
                  type: object
                  properties:
                    party_id:
                      type: string
                      example: '10000'
                    role:
                      type: string
                      example: guest
                role:
                  type: object
                  example:
                    guest:
                      - '10000'
                    host:
                      - '10000'
                    arbiter:
                      - '10000'
                job_parameters:
                  type: object
                  properties:
                    model_id:
                      type: string
                      example: arbiter-10000#guest-10000#host-10000#model
                    model_version:
                      type: string
                      example: '2019081217340125761469'
      responses:
        '200':
          description: loading success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  jobId:
                    type: string
                    example: "2019081217340125761469"
                  data:
                    type: object
                    example:
                      detail:
                        guest:
                          '9999':
                            retcode: 0
                            retmsg: success
                        host:
                          '10000':
                            retcode: 0
                            retmsg: success
                      guest:
                        '9999': 0
                      host:
                        '10000': 0

  '/model/bind':
    post:
      summary: bind a deployed model to Fate-Serving
      tags:
        - model
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - service_id
                - initiator
                - role
                - job_parameters
              properties:
                service_id:
                  type: string
                  example: "123"
                initiator:
                  type: object
                  properties:
                    party_id:
                      type: string
                      example: "10000"
                    role:
                      type: string
                      example: guest
                job_parameters:
                  type: object
                  properties:
                    model_id:
                      type: string
                      example: arbiter-10000#guest-10000#host-10000#model
                    model_version:
                      type: string
                      example: "2019081217340125761469"
      responses:
        '200':
          description: binding success
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: service id is 123

  '/checkpoint/list':
    post:
      summary: list checkpoints
      tags:
        - checkpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model_id
                - model_version
                - role
                - party_id
                - component_name
              properties:
                model_id:
                  type: string
                  example: 'arbiter-10000#guest-9999#host-10000#model'
                model_version:
                  type: string
                  example: '202111032155391167400'
                role:
                  type: string
                  example: guest
                party_id:
                  type: integer
                  example: 9999
                component_name:
                  type: string
                  example: hetero_lr_0
      responses:
        '200':
          description: checkpoints list
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        create_time:
                          type: string
                          example: '2021-11-07T02:34:54.683015'
                        step_index:
                          type: integer
                          example: 0
                        step_name:
                          type: string
                          example: step_name
                        models:
                          type: object
                          example:
                            HeteroLogisticRegressionMeta:
                              buffer_name: LRModelMeta
                              sha1: 6871508f6e6228341b18031b3623f99a53a87147
                            HeteroLogisticRegressionParam:
                              buffer_name: LRModelParam
                              sha1: e3cb636fc93675684bff27117943f5bfa87f3029
                          additionalProperties:
                            type: object
                            properties:
                              buffer_name:
                                type: string
                                example: HeteroLogisticRegressionMeta
                              sha1:
                                type: string
                                example: 6871508f6e6228341b18031b3623f99a53a87147

  '/checkpoint/get':
    post:
      summary: get a checkpoint
      tags:
        - checkpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model_id
                - model_version
                - role
                - party_id
                - component_name
              properties:
                model_id:
                  type: string
                  example: 'arbiter-10000#guest-9999#host-10000#model'
                model_version:
                  type: string
                  example: '202111032155391167400'
                role:
                  type: string
                  example: guest
                party_id:
                  type: integer
                  example: 9999
                component_name:
                  type: string
                  example: hetero_lr_0
                step_index:
                  type: integer
                  example: 0
      responses:
        '200':
          description: checkpoint data
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      create_time:
                        type: string
                        example: '2021-11-07T02:34:54.683015'
                      step_index:
                        type: integer
                        example: 0
                      step_name:
                        type: string
                        example: step_name
                      models:
                        type: object
                        example:
                          HeteroLogisticRegressionMeta: 'CgJMMhEtQxzr4jYaPxkAAAAAAADwPyIHcm1zcHJvcDD///8BOTMzMzMzM8M/QApKBGRpZmZYAQ=='
                          HeteroLogisticRegressionParam: 'Ig0KAng3EW1qASu+uuO/Ig0KAng0EcNi7a65ReG/Ig0KAng4EbJbl4gvVea/Ig0KAng2EcZwlVZTkOu/Ig0KAngwEVpG8dCbGvG/Ig0KAng5ESJNTx5MLve/Ig0KAngzEZ88H9P8qfO/Ig0KAng1EVfWP8JJv/K/Ig0KAngxEVS0xVXoTem/Ig0KAngyEaApgW32Q/K/KSiiE8AukPs/MgJ4MDICeDEyAngyMgJ4MzICeDQyAng1MgJ4NjICeDcyAng4MgJ4OUj///8B'
                        additionalProperties:
                          type: string
                          description: base64 encoded model data
        '404':
          description: checkpoint not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 404
                  retmsg:
                    type: string
                    example: The checkpoint was not found.

  '/component/validate':
    post:
      summary: validate component parameters
      tags:
        - component
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                dsl_version:
                  type: integer
                  example: 2
                component_name:
                  type: string
                  example: dataio_0
                component_module_name:
                  type: string
                  example: DataIO
                role:
                  type: object
                  example:
                    guest:
                      - 10000
                    host:
                      - 9999
                    arbiter:
                      - 9999
                component_parameters:
                  type: object
                  description: required if `dsl_version` == 2
                  example:
                    common:
                      dataio_0:
                        output_format: dense
                      role:
                        guest:
                          '0':
                            dataio_0:
                              with_label: true
                        host:
                          '0':
                            dataio_0:
                              with_label: false
                              output_format: dense
                role_parameters:
                  type: object
                  description: required if `dsl_version` == 1
                  example:
                    guest:
                      dataio_0:
                        with_label:
                          - true
                        label_name:
                          - y
                        label_type:
                          - int
                        output_format:
                          - dense
                        missing_fill:
                          - true
                        outlier_replace:
                          - true
                    host:
                      dataio_0:
                        with_label:
                          - false
                        output_format:
                          - dense
                        outlier_replace:
                          - true
                algorithm_parameters:
                  type: object
                  description: required if `dsl_version` == 1
                  example:
                    hetero_feature_binning_0:
                      method: quantile
                      compress_thres: 10000
                      head_size: 10000
                      error: 0.001
                      bin_num: 10
                      adjustment_factor: 0.5
                      local_only: false
                      transform_param:
                        transform_cols: -1
                        transform_type: bin_num
      responses:
        '200':
          description: validation passed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 0
                  retmsg:
                    type: string
                    example: success
        '400':
          description: validation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  retcode:
                    type: integer
                    example: 400
                  retmsg:
                    type: string
                    description: error message
                    example: "Component dataio_0, module DataIO, does not pass component check, error msg is dataio param's dendse not supported, should be one of ['dense', 'sparse']"

tags:
  - name: data-access
  - name: table
  - name: job
  - name: tracking
  - name: information
  - name: model
  - name: checkpoint
  - name: component

servers:
  - description: Default Server URL
    url: http://localhost:9380/v1

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/111525.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

处理SAP资产折旧AFAB 过账报错:“科目 8019010100 要求一个成本会计分配”

会计在进行资产折旧AFAB时 报错如下所示: 原因分析: 折旧时没有把资产设置得成本中心带到过账凭证的成本中心字段中去。而资产中已经维护了成本中心了。 所以要在资产过账的科目分配中设置一下路径如下: 或者TCODE:ACSET科目设置这…

一文带你了解自动化测试是什么?

本章主要讲解自动化测试的含义、分类、项目使用,以及自动化测试工具的优势。 一、自动化测试概述 1、什么是自动化测试? 自动化测试是软件测试活动中的一个重要分支和组成部分。随着软件产业的不断发展,市场对软件周期的要求越来越高&…

R -- 体验 stringdist

文章目录 安装使用stringdist :返回列表example stringdistmatrix :返回矩阵example amatch & ain延伸:距离计算公式Hamming distanceLongest Common Substring distanceLevenshtein distance (weighted)The optimal string alignment distance dosa…

阿里云2核2G3M带宽轻量服务器87元一年,经济型e实例99元一年

2023阿里云双十一优惠活动2核2G3M轻量应用服务器一年优惠价87元,云服务器ECS经济型e实例优惠价格99元一年,也是2核2G配置,自带3M带宽,并且续费不涨价,阿里云百科aliyunbaike.com还是很建议大家选择e实例的,…

什么测试自动化测试?

什么测试自动化测试? 做测试好几年了,真正学习和实践自动化测试一年,自我感觉这一个年中收获许多。一直想动笔写一篇文章分享自动化测试实践中的一些经验。终于决定花点时间来做这件事儿。 首先理清自动化测试的概念,广义上来讲&a…

小说网站源码带管理后台手机端和采集

搭建教程,安装宝塔 php7.2,绑定域名,上传源码到根目录解压 源码获取请自行百度:一生相随博客 一生相随博客致力于分享全网优质资源,包括网站源码、游戏源码、主题模板、插件、电脑软件、手机软件、技术教程等等&#…

AI:47-基于深度学习的人像背景替换研究

🚀 本文选自专栏:AI领域专栏 从基础到实践,深入了解算法、案例和最新趋势。无论你是初学者还是经验丰富的数据科学家,通过案例和项目实践,掌握核心概念和实用技能。每篇案例都包含代码实例,详细讲解供大家学习。 📌📌📌本专栏包含以下学习方向: 机器学习、深度学…

xcode 安装及运行个人app编程应用

1.xcode 介绍 Xcode 是运行在操作系统Mac OS X上的集成开发工具(IDE),由Apple Inc开发。Xcode是开发 macOS 和 iOS 应用程序的最快捷的方式。Xcode 具有统一的用户界面设计,编码、测试、调试都在一个简单的窗口内完成 2.xcode 下…

iOS开发-CoreNFC实现NFC标签Tag读取功能

iOS开发-CoreNFC实现NFC标签Tag读取功能 一、NFC近场通信 近场通信(NFC)是一种无线通信技术,它使设备能够在不使用互联网的情况下相互通信。它首先识别附近配备NFC的设备。NFC常用于智能手机和平板电脑。 二、实现NFC标签Tag读取功能 在…

机器学习2:决策树--基于信息增益的ID3算法

1.决策树的简介 建立决策树的过程可以分为以下几个步骤: 计算每个特征的信息增益或信息增益比,选择最优的特征作为当前节点的划分标准。根据选择的特征将数据集划分为不同的子集。对每个子集递归执行步骤 1 和步骤 2,直到满足终止条件。构建决策树,并输出。基于信息增益的…

PP-MobileSeg: 探索移动设备上又快又准的语义分割模型

论文:https://arxiv.org/abs/2304.05152 代码:https://github.com/open-mmlab/mmsegmentation/tree/main/projects/pp_mobileseg 0、摘要 transformer在CV领域的成功之后,出现了很多在移动设备上使用它们的尝试性工作,但是这些工作…

一道简单的C#面试题

试题: 抽顺序问题:有10位面试者,需要随机抽号面试。 1)总共十个号数,用数组表示; 2)每一位面试者输入1开始抽签,然后得到抽签号,输入2结束抽签; 3&#x…

超融合数据库:解锁全场景数据价值的钥匙

前言 近日,四维纵横对外官宣已完成上亿元 B 轮融资。作为超融合数据库理念的提出者,三年来 YMatrix 持续在超融合数据库领域中保持精进与迭代,对于超融合数据库在行业、场景中的应用和理解也更为深刻。 本篇文章,我们将基于 YMa…

HTML标题、段落、文本格式化

HTML标题&#xff1a; 在HTML文档中&#xff0c;标题是很重要的。标题是通过<h1> - <h6标签进行定义的&#xff0c;<h1> 定义最大的标题&#xff1b;<h6>定义最小的标题。 <hr> 标签在HTML页面中用于创建水平线&#xff0c;hr元素可用于分隔内容。…

springboot整合日志,并在本地查看

目录 1.导入依赖 2.编写配置 3.使用 4.验证 5.打印错误信息 1.导入依赖 <!-- logback&#xff0c;向下兼容log4j,还支持SLF4J--> <dependency><groupId>ch.qos.logback</groupId><artifactId>logback-classic</artifactId> </depen…

【Docker】Linux路由连接两个不同网段namespace,连接namespace与主机

如果两个namespace处于不同的子网中&#xff0c;那么就不能通过bridge进行连接了&#xff0c;而是需要通过路由器进行三层转发。然而Linux并未像提供虚拟网桥一样也提供一个虚拟路由器设备&#xff0c;原因是Linux自身就具备有路由器功能。 路由器的工作原理是这样的&#xff…

MySQL操作命令整理

MySQL操作命令整理 SQL分类 SQL语句按照其功能范围不同可分为3个类别: 数据定义语言(DDL ,Data Defintion Language)语句:数据定义语句,用于定义不同的数据段、数据库、表、列、索引等。常用的语句关键字包括create、drop、alter等。数据操作语言(DML , Data Manipulatio…

历年上午真题笔记(2014年)

解析:A 网络设计的三层模型 : 接入层:Layer 2 Switching,最终用户被许可接入网络的点,用户通过接入层可以访问网络设备。 汇聚层:Layer2/3 Switching,访问层设备的汇聚点,负责汇接配线单元,利用二、三层技术实现工作组分段及网络故障的隔离,以免对核心层网络设备造…

Istio实战(九)-Envoy 流量劫持

前言 Envoy 是一款面向 Service Mesh 的高性能网络代理服务。它与应用程序并行运行,通过以平台无关的方式提供通用功能来抽象网络。当基础架构中的所有服务流量都通过 Envoy 网格时,通过一致的可观测性,很容易地查看问题区域,调整整体性能。 Envoy也是istio的核心组件之一…

java参数中的-、--、-X、-XX、-D

详细描述请参考&#xff1a;https://docs.oracle.com/en/java/javase/19/docs/specs/man/java.html Java标准选项&#xff08;以-、或者–开头&#xff09; Java标准选项被所有的Java虚拟机&#xff08;JVM&#xff09;实现所支持。 这些选项用于普通的动作&#xff0c;例如检…
最新文章