主题
笔记 
笔记说明 
笔记定义 
笔记是多个代码片段的集合,每个片段称为一个段落。这些有关联的段落顺序执行来完成特定的数据处理功能。给笔记设定执行计划,可以实现周期性的数据处理。
笔记结构说明 
| 字段 | 类型 | 描述 | 
|---|---|---|
| id | INTEGER | 笔记的 id | 
| title | STRING | 笔记的标题 | 
| createdAt | DATETIME | 笔记创建的时间 | 
| createdBy | INTEGER | 笔记创建用户的 id | 
| updatedAt | DATETIME | 笔记最后修改的时间 | 
| updatedBy | INTEGER | 笔记最后修改用户的 id | 
| transactionMode | STRING | 笔记的事务模式,见事务模式说明 | 
| entityGroup | STRING | 笔记的执行计划类别,用于管理执行计划,固定为notebook | 
| entityKey | STRING | 笔记的执行计划关键字,用于管理执行计划 | 
| execDetail | OBJECT | 创建执行计划需要用到的任务描述信息,详见执行计划 | 
笔记事务模式说明 
| 状态值 | 意义 | 
|---|---|
| BY_NOTEBOOK | 整个笔记作为一个事务, 默认值 | 
| BY_PARAGRAPH | 每个段落作为一个事务 | 
笔记连接列表结构说明 
| 字段 | 类型 | 描述 | 
|---|---|---|
| notebookId | INTEGER | 所属笔记的 id | 
| connectionId | INTEGER | 连接的 id | 
| createdAt | DATETIME | 添加连接的时间 | 
| createdBy | INTEGER | 添加连接用户的 id | 
| status | STRING | 连接授权状态,见连接授权状态说明 | 
笔记连接授权状态说明 
| 状态值 | 意义 | 
|---|---|
| VALID | 已经授权,有效 | 
| INVALID | 尚未授权,无效 | 
接口说明 
新增笔记 
请求URL 
http
POST /api/notebooks HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...请求参数 
URL 参数 
| 字段 | 类型 | 是否必须 | 说明 | 
|---|
Request Body 参数 
| 字段 | 类型 | 是否必须 | 描述 | 
|---|---|---|---|
| title | STRING | 是 | 笔记的标题 | 
| transactionMode | STRING | 可选 | 笔记的事务模式,见事务模式说明 | 
返回对象的格式说明 
| 字段 | 类型 | 说明 | 
|---|---|---|
| version | STRING | 当前系统版本哈希值 | 
| data | OBJECT | 见笔记结构说明 | 
接口示例: 
http
POST /api/notebooks HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
// Request Body:
{
    "title": "notebook1",
    "transactionMode": "BY_PARAGRAPH"
}http
HTTP/1.1 200 Ok
Content-Type: application/json
{
    "code": 0,
    "data": {
        "id": 1,
        "title": "notebook1",
        "createdBy": 1,
        "createdAt": "2020-02-25 17:19:40",
        "updatedBy": 1,
        "updatedAt": "2020-02-25 17:19:40",
        "transactionMode": "BY_PARAGRAPH",
        "entityGroup": "notebook",
        "entityKey": "1"
    },
    "msg": "success",
    "version": "version@9a5e106#6730f0d",
}删除笔记 
请求URL 
http
DELETE /api/notebooks/{notebookId} HTTP/1.1
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...请求参数 
URL 参数 
| 字段 | 类型 | 是否必须 | 说明 | 
|---|
Request Body 参数 
| 字段 | 类型 | 是否必须 | 描述 | 
|---|
返回对象的格式说明 
| 字段 | 类型 | 说明 | 
|---|---|---|
| version | STRING | 当前系统版本哈希值 | 
| code | 错误码 | 请求成功返回0 | 
| msg | STRING | 请求成功返回success | 
接口示例: 
http
DELETE /api/notebooks/{notebookId} HTTP/1.1http
HTTP/1.1 200 Ok
Content-Type: application/json
{
    "code": 0,
    "msg": "success",
    "version": "version@9a5e106#6730f0d",
}修改笔记 
请求URL 
http
PUT /api/notebooks/{notebookId} HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...请求参数 
URL 参数 
| 字段 | 类型 | 是否必须 | 说明 | 
|---|
Request Body 参数 
只能修改title或者transactionMode,或者同时修改,不能全部为(空或者null)
| 字段 | 类型 | 是否必须 | 描述 | 
|---|---|---|---|
| title | STRING | 可选 | 笔记的标题 | 
| transactionMode | STRING | 可选 | 笔记的事务模式,见事务模式说明 | 
返回对象的格式说明 
| 字段 | 类型 | 说明 | 
|---|---|---|
| version | STRING | 当前系统版本哈希值 | 
| data | OBJECT | 见笔记结构说明 | 
接口示例: 
http
PUT /api/notebooks/{notebookId} HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
// Request Body:
{
    "title": "notebook new title"
}http
HTTP/1.1 200 Ok
Content-Type: application/json
{
    "code": 0,
    "data": {
        "id": 1,
        "title": "notebook new title",
        "createdBy": 1,
        "createdAt": "2020-02-25 17:19:40",
        "updatedBy": 1,
        "updatedAt": "2020-02-25 17:19:40",
        "transactionMode": "BY_PARAGRAPH",
        "entityGroup": "notebook",
        "entityKey": "1"
    },
    "msg": "success",
    "version": "version@9a5e106#6730f0d",
}获取笔记 
请求URL 
http
GET /api/notebooks/{notebookId} HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...请求参数 
URL 参数 
| 字段 | 类型 | 是否必须 | 说明 | 
|---|
Request Body 参数 
| 字段 | 类型 | 是否必须 | 描述 | 
|---|
返回对象的格式说明 
| 字段 | 类型 | 说明 | 
|---|---|---|
| version | STRING | 当前系统版本哈希值 | 
| data | OBJECT | 见笔记结构说明 | 
接口示例: 
http
GET /api/notebooks/{notebookId} HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...http
HTTP/1.1 200 Ok
Content-Type: application/json
{
    "code": 0,
    "data": {
        "id": 1,
        "title": "notebook1",
        "createdBy": 1,
        "createdAt": "2020-02-25 17:19:40",
        "updatedBy": 1,
        "updatedAt": "2020-02-25 17:19:40",
        "transactionMode": "BY_PARAGRAPH",
        "entityGroup": "notebook",
        "entityKey": "1"
    },
    "msg": "success",
    "version": "version@9a5e106#6730f0d",
}获取笔记列表 
请求URL 
http
GET /api/notebooks HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...请求参数 
URL 参数 
| 字段 | 类型 | 是否必须 | 说明 | 
|---|---|---|---|
| offset | INTEGER | 可选 | 分页偏移量,默认是0 | 
| limit | INTEGER | 可选 | 分页获取个数,默认是10 | 
Request Body 参数 
| 字段 | 类型 | 是否必须 | 描述 | 
|---|
返回对象的格式说明 
| 字段 | 类型 | 说明 | 
|---|---|---|
| version | STRING | 当前系统版本哈希值 | 
| totalHits | INTEGER | 笔记的总个数 | 
| offset | INTEGER | 当前分页偏移量 | 
| data | OBJECT 数组 | 数组的元素是一个笔记,见笔记结构说明 | 
接口示例: 
http
GET /api/notebooks HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...http
HTTP/1.1 200 Ok
Content-Type: application/json
{
    "code": 0,
    "data": [
        {
            "id": 1,
            "title": "notebook1",
            "createdBy": 1,
            "createdAt": "2020-02-25 17:19:40",
            "updatedBy": 1,
            "updatedAt": "2020-02-25 17:19:40",
            "transactionMode": "BY_PARAGRAPH",
            "entityGroup": "notebook",
            "entityKey": "1"
        },
        {
            "id": 2,
            "title": "notebook2",
            "createdBy": 1,
            "createdAt": "2020-02-26 17:19:40",
            "updatedBy": 1,
            "updatedAt": "2020-02-26 17:19:40",
            "transactionMode": "BY_NOTEBOOK",
            "entityGroup": "notebook",
            "entityKey": "2"
        }
    ],
    "msg": "success",
    "version": "version@9a5e106#6730f0d",
    "totalHits": 2,
    "offset": 0
}新增笔记的可用连接 
请求URL 
http
POST /api/notebooks/{notebookId}/connections HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...请求参数 
URL 参数 
| 字段 | 类型 | 是否必须 | 说明 | 
|---|
Request Body 参数 
| 字段 | 类型 | 是否必须 | 描述 | 
|---|---|---|---|
| connectionId | INTEGER | 是 | 连接的 id | 
| status | STRING | 可选 | 连接授权状态,见连接授权状态说明 ,默认是INVALID | 
返回对象的格式说明 
| 字段 | 类型 | 说明 | 
|---|---|---|
| version | STRING | 当前系统版本哈希值 | 
| data | OBJECT | 见笔记连接列表结构说明 | 
接口示例: 
http
POST /api/notebooks/{notebookId}/connections HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
// Request Body:
{
    "connectionId": 1
}http
HTTP/1.1 200 Ok
Content-Type: application/json
{
    "code": 0,
    "data": {
        "notebookId": 1,
        "connectionId": 1,
        "createdBy": 1,
        "createdAt": "2020-02-25 17:19:40",
        "status": "INVALID"
    },
    "msg": "success",
    "version": "version@9a5e106#6730f0d",
}删除笔记的可用连接 
请求URL 
http
DELETE /api/notebooks/{notebookId}/connections/{connectionId} HTTP/1.1
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...请求参数 
URL 参数 
| 字段 | 类型 | 是否必须 | 说明 | 
|---|
Request Body 参数 
| 字段 | 类型 | 是否必须 | 描述 | 
|---|
返回对象的格式说明 
| 字段 | 类型 | 说明 | 
|---|---|---|
| version | STRING | 当前系统版本哈希值 | 
| code | 错误码 | 请求成功返回0 | 
| msg | STRING | 请求成功返回success | 
接口示例: 
http
DELETE /api/notebooks/{notebookId}/connections/{connectionId} HTTP/1.1http
HTTP/1.1 200 Ok
Content-Type: application/json
{
    "code": 0,
    "msg": "success",
    "version": "version@9a5e106#6730f0d",
}修改笔记的可用连接 
请求URL 
http
PUT /api/notebooks/{notebookId}/connections/{connectionId} HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...请求参数 
URL 参数 
| 字段 | 类型 | 是否必须 | 说明 | 
|---|
Request Body 参数 
只能修改status
| 字段 | 类型 | 是否必须 | 描述 | 
|---|---|---|---|
| status | STRING | 是 | 连接授权状态,见连接授权状态说明 | 
返回对象的格式说明 
| 字段 | 类型 | 说明 | 
|---|---|---|
| version | STRING | 当前系统版本哈希值 | 
| data | OBJECT | 见笔记连接列表结构说明 | 
接口示例: 
http
PUT /api/notebooks/{notebookId}/connections/{connectionId} HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
// Request Body:
{
    "status": "VALID"
}http
HTTP/1.1 200 Ok
Content-Type: application/json
{
    "code": 0,
    "data": {
        "notebookId": 1,
        "connectionId": 1,
        "createdBy": 1,
        "createdAt": "2020-02-26 17:19:40",
        "status": "VALID"
    },
    "msg": "success",
    "version": "version@9a5e106#6730f0d",
}获取笔记的可用连接列表 
请求URL 
http
GET /api/notebooks/{notebookId}/connections HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...请求参数 
URL 参数 
| 字段 | 类型 | 是否必须 | 说明 | 
|---|---|---|---|
| offset | INTEGER | 可选 | 分页偏移量,默认是0 | 
| limit | INTEGER | 可选 | 分页获取个数,默认是10 | 
Request Body 参数 
| 字段 | 类型 | 是否必须 | 描述 | 
|---|
返回对象的格式说明 
| 字段 | 类型 | 说明 | 
|---|---|---|
| version | STRING | 当前系统版本哈希值 | 
| totalHits | INTEGER | 笔记的总个数 | 
| offset | INTEGER | 当前分页偏移量 | 
| data | OBJECT 数组 | 数组的元素是一个笔记,见笔记连接列表结构说明 | 
接口示例: 
http
GET /api/notebooks/{notebookId}/connections HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...http
HTTP/1.1 200 Ok
Content-Type: application/json
{
    "code": 0,
    "data": [
        {
            "notebookId": 1,
            "connectionId": 1,
            "createdBy": 1,
            "createdAt": "2020-02-26 17:19:40",
            "status": "VALID"
        },
        {
            "notebookId": 1,
            "connectionId": 2,
            "createdBy": 1,
            "createdAt": "2020-02-27 17:19:40",
            "status": "INVALID"
        }
    ],
    "msg": "success",
    "version": "version@9a5e106#6730f0d",
    "totalHits": 2,
    "offset": 0
}获取笔记的连接的表格目录 
请求URL 
http
GET /api/notebooks/{notebookId}/connections/{connectionId}/path-tables HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...请求参数 
URL 参数 
| 字段 | 类型 | 是否必须 | 说明 | 
|---|
Request Body 参数 
| 字段 | 类型 | 是否必须 | 描述 | 
|---|
返回对象的格式说明 
| 字段 | 类型 | 说明 | 
|---|---|---|
| version | STRING | 当前系统版本哈希值 | 
| data | OBJECT 数组 | |
| data[].pathType | STRING | path表示目录,table表示表格 | 
| data[].name | STRING | 节点名字 | 
| data[].children | OBJECT 数组 | 只有pathType=path才有,递归结构,同data | 
| data[].tableType | STRING | 只有pathType=table有,TABLE表示表格,VIEW表示视图 | 
接口示例: 
http
GET /api/notebooks/{notebookId}/connections/{connectionId}/path-tables HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...http
HTTP/1.1 200 Ok
Content-Type: application/json
{
  "version": "version@9a5e106#6730f0d",
  "code": 0,
  "msg": "success",
  "data": [
    {
      "pathType": "path",
      "name": "public",
      "children": [
        {
          "pathType": "table",
          "name": "auth",
          "tableType": "TABLE"
        },
        {
          "pathType": "table",
          "name": "barchart",
          "tableType": "TABLE"
        }
      ]
    }
  ]
}获取笔记的连接的表格数据 
请求URL 
http
POST /api/notebooks/{notebookId}/connections/{connectionId}/path-table-data HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...请求参数 
URL 参数 
| 字段 | 类型 | 是否必须 | 说明 | 
|---|
Request Body 参数 
| 字段 | 类型 | 是否必须 | 描述 | 
|---|---|---|---|
| table | STRING | 是 | 表名 | 
| path | STRING | 是 | 路径名 | 
返回对象的格式说明 
| 字段 | 类型 | 说明 | 
|---|---|---|
| version | STRING | 当前系统版本哈希值 | 
| data | OBJECT | |
| data.schema | OBJECT数组 | 字段描述 | 
| data.data | OBJECT数组 | 数据 | 
接口示例: 
http
POST /api/notebooks/{notebookId}/connections/{connectionId}/path-table-data HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
// Request Body:
{
    "table":"auth",
    "path":["public"]
}http
HTTP/1.1 200 Ok
Content-Type: application/json
{
    "version": "version@9a5e106#6730f0d",
    "code":0,
    "msg":"success",
    "data":{
        "data":[
            [1,3,"group",0,"dataset","read|write"],
            [2,3,"group",0,"connection","read|write"],
            [3,3,"group",0,"chart","read|write"],
            [4,3,"group",0,"dashboard","read|write"],
            [5,3,"group",0,"notebook","read|write"],
            [6,3,"group",0,"paragraph","read|write"],
            [7,3,"group",0,"publish","read|write"],
            [8,1,"group",0,"user","read|write"],
            [9,1,"group",0,"configuration","read|write"]
        ],
        "schema":[
            {
                "fieldName":"id",
                "originType":"integer",
                "config":{"dialectName":"PostgresqlDialect"},
                "type":"number",
                "visible":true,
                "nativeType":"bigserial",
                "suggestedTypes":["number","string"],
                "detectedType":"integer",
                "defaultAggrType":"sum",
                "basicType":"number"
            },
            {
                "fieldName":"ident",
                "originType":"integer",
                "config":{"dialectName":"PostgresqlDialect"},
                "type":"number",
                "visible":true,
                "nativeType":"int8",
                "suggestedTypes":["number","string"],
                "detectedType":"integer",
                "defaultAggrType":"sum",
                "basicType":"number"
            },
            {
                "fieldName":"ident_type",
                "originType":"string",
                "config":{},
                "type":"string",
                "visible":true,
                "nativeType":"varchar",
                "suggestedTypes":["string"],
                "detectedType":"string",
                "defaultAggrType":"count",
                "basicType":"string"
            },
            {
                "fieldName":"object_id",
                "originType":"integer",
                "config":{"dialectName":"PostgresqlDialect"},
                "type":"number",
                "visible":true,
                "nativeType":"int8",
                "suggestedTypes":["number","string"],
                "detectedType":"integer",
                "defaultAggrType":"sum",
                "basicType":"number"
            },
            {
                "fieldName":"object_type",
                "originType":"string",
                "config":{},
                "type":"string",
                "visible":true,
                "nativeType":"varchar",
                "suggestedTypes":["string"],
                "detectedType":"string",
                "defaultAggrType":"count",
                "basicType":"string"
            },
            {
                "fieldName":"action",
                "originType":"string",
                "config":{},
                "type":"string",
                "visible":true,
                "nativeType":"varchar",
                "suggestedTypes":["string"],
                "detectedType":"string",
                "defaultAggrType":"count",
                "basicType":"string"
            }
        ],
        "pagable":true,
        "importSwitchable":true,
        "randomable":false
    }
}