You need to enable JavaScript to run this app.
导航
数据连接
最近更新时间:2023.10.08 10:43:09首次发布时间:2023.10.08 10:43:09
1. 创建数据连接

接口说明
本接口可以根据传入的信息创建数据连接
请求地址

POST https://{domain}/aeolus/prep/userOpenAPI/v1/upstream

请求参数

参数名称类型默认值必填说明
appIdint项目ID
typestring数据连接类型,示例:mysql
datasourceNamestring

connectionParams

object

数据连接参数,示例:{
"host": "10.225.118.181",
"port": "3306",
"user": "aeolus_db_w",
"password": "xxx"
}

uuidstring示例:c428121e-654c-4433-8a53-87555a9c0be4
fileIdsint[]文件数据连接ID列表

请求参数示例

{
    "appId": 555327,
    "type": "mysql",
    "datasourceName": "数据连接_2022090818143012",
    "connectionParams": {
        "host": "10.225.118.181",
        "port": "3306",
        "user": "aeolus_db_w",
        "password": "xxx"
    },
    "uuid": "c428121e-654c-4433-8a53-87555a9c0be4"
}

返回结果示例

{
    "code": "prep/ok",
    "message": "成功",
    "extraMsg": null,
    "advice": null,
    "data": 24461
}
2. 删除数据连接

接口说明
本接口可以根据传入的信息删除数据连接
请求地址

DELETE https://{domain}/aeolus/prep/userOpenAPI/v1/upstream

请求参数

参数名称类型默认值必填说明
upstreamDatasourceIdint数据连接数据源ID
appIdint项目ID
typestring数据源类型,示例:mysql
fileIdsint[]文件数据连接ID列表

请求参数示例

{
    "upstreamDatasourceId": 24461,
    "appId": 555327,
    "type": "mysql"
}

返回结果示例

{
    "code": "prep/ok",
    "message": "成功",
    "extraMsg": null,
    "advice": null,
    "data": true
}
3. 修改数据连接

接口说明
本接口可以根据传入的信息修改数据连接。
请求地址

PUT https://{domain}/aeolus/prep/userOpenAPI/v1/upstream

请求参数

参数名称类型默认值必填说明
idint数据连接 ID
appIdint项目ID
typestring数据连接类型,示例:mysql
datasourceNamestring

connectionParams

object

数据连接参数,示例:{
"host": "10.225.118.181",
"port": "3306",
"user": "aeolus_db_w",
"password": "xxx"
}

uuidstring示例:c428121e-654c-4433-8a53-87555a9c0be4
fileIdsint[]文件数据连接ID列表

请求参数示例

{
    "id": 24461,
    "appId": 555327,
    "type": "mysql",
    "datasourceName": "数据连接_2022090818143012",
    "connectionParams": {
        "host": "10.225.118.181",
        "port": "3306",
        "user": "aeolus_db_w",
        "password": "xxx"
    },
    "uuid": "c428121e-654c-4433-8a53-87555a9c0be4"
}

返回结果示例

{
    "code": "prep/ok",
    "message": "成功",
    "extraMsg": null,
    "advice": null,
    "data": true
}
4. 查询数据连接

接口说明
本接口可以根据传入的信息查询数据连接
请求地址

GET https://{domain}/aeolus/prep/userOpenAPI/v1/upstream

请求参数

参数名称类型默认值必填说明
idint查询参数,数据连接 ID

请求参数示例

curl https://${domain}/aeolus/prep/userOpenAPI/v1/upstream?id=24461

返回结果示例

{
  "code": "prep/ok",
  "message": "成功",
  "extraMsg": null,
  "advice": null,
  "data": {
    "id": 24461,
    "name": "数据连接_20220908181430344",
    "appId": 555327,
    "host": "10.225.118.181",
    "port": "3306",
    "type": "mysql",
    "user": "aeolus_db_w",
    "additionalParams": {},
    "doradoDatasourceId": 12625,
    "ownerEmailPrefix": "xuyi.556677",
    "encryptMethod": 1,
    "ctime": "2022-09-08 18:17:24",
    "mtime": "2022-09-08 18:19:41",
    "roleList": [],
    "taskList": []
  }
}
5. 获取数据连接元信息

接口说明
本接口可以获得数据连接的元信息
请求地址

GET https://{domain}/aeolus/prep/userOpenAPI/v1/upstream/metadata

请求参数

参数名称类型默认值必填说明
typestring数据连接类型

请求参数示例

curl https://${domain}/aeolus/prep/userOpenAPI/v1/upstream/metadata?type=mysql

返回结果
"data"部分为type类型数据连接的元信息,不同类型数据连接元信息存在差异,元信息对应建立数据连接时需要填写的信息。
返回结果示例

{
    "code": "prep/ok",
    "message": "成功",
    "extraMsg": null,
    "advice": null,
    "data": [
        {
            "name": "host",
            "required": 1,
            "sensitiveInput": 0,
            "defaultValue": "",
            "conditions": null,
            "fieldType": "",
            "choices": null
        },
        {
            "name": "port",
            "required": 1,
            "sensitiveInput": 0,
            "defaultValue": "",
            "conditions": null,
            "fieldType": "",
            "choices": null
        },
        {
            "name": "user",
            "required": 1,
            "sensitiveInput": 0,
            "defaultValue": "",
            "conditions": null,
            "fieldType": "",
            "choices": null
        },
        {
            "name": "password",
            "required": 1,
            "sensitiveInput": 1,
            "defaultValue": "",
            "conditions": null,
            "fieldType": "password",
            "choices": null
        }
    ]
}
6. 获取数据源类型的信息

接口说明
本接口可以获得数据源类型的信息
请求地址

GET https://{domain}/aeolus/prep/userOpenAPI/v1/upstream/dataSourceTypeList

请求参数

参数名称类型默认值必填说明
dataSourceTypeListstring数据源类型

请求参数示例

curl https://${domain}/aeolus/prep/userOpenAPI/v1/upstream/dataSourceTypeList?dataSourceType=mysql

返回结果示例

{
    "code": "prep/ok",
    "message": "成功",
    "extraMsg": null,
    "advice": null,
    "data": [
        {
            "alias": "MySQL",
            "category": [
                "关系型数据库"
            ],
            "config": {
                "enableCustomSql": true,
                "enableLiveMode": true,
                "enableCustomSqlPreview": true,
                "showClusterDesc": true,
                "enableTestConnection": true,
                "loadToExpandDB": true
            },
            "dataSourceType": "mysql"
        }
    ]
}
7. 获取数据连接列表

接口说明
本接口可以获得数据连接列表
请求地址

GET https://{domain}/aeolus/prep/userOpenAPI/v1/upstream/list

请求参数

参数名称类型默认值必填说明
appIdlong项目ID
kwstring""
typestring数据连接类型

请求参数示例

curl https://${domain}/aeolus/prep/userOpenAPI/v1/upstream/list?appId=555327&kw=&type=mysql

返回结果示例

{
    "code":"prep/ok",
    "message":"成功",
    "extraMsg":null,
    "advice":null,
    "data":[
        {
            "id":25750,
            "name":"jk开发机_MySQL57",
            "appId":555327,
            "host":"10.37.1.208",
            "port":"3306",
            "type":"mysql",
            "user":"root",
            "additionalParams":{

            },
            "doradoDatasourceId":12803,
            "ownerEmailPrefix":"jinke.jk",
            "encryptMethod":1,
            "ctime":"2022-11-24 19:52:28",
            "mtime":"2022-11-24 19:52:28",
            "roleList":[
                {
                    "roleName":"管理",
                    "action":"admin"
                },
                {
                    "roleName":"编辑",
                    "action":"write_role"
                },
                {
                    "roleName":"查看",
                    "action":"read_role"
                }
            ],
            "taskList":[

            ]
        },
        {
            "id":25701,
            "name":"域内mysql2",
            "appId":555327,
            "host":"10.31.146.134",
            "port":"25003",
            "type":"mysql",
            "user":"root",
            "additionalParams":{

            },
            "doradoDatasourceId":12775,
            "ownerEmailPrefix":"dingdong.kent",
            "encryptMethod":1,
            "ctime":"2022-11-21 16:40:29",
            "mtime":"2022-11-21 16:40:29",
            "roleList":[
                {
                    "roleName":"管理",
                    "action":"admin"
                },
                {
                    "roleName":"编辑",
                    "action":"write_role"
                },
                {
                    "roleName":"查看",
                    "action":"read_role"
                }
            ],
            "taskList":[

            ]
        }
    ]
}
8. 获取数据源token

接口说明
本接口可以获得数据源token
请求地址

GET https://{domain}/aeolus/prep/userOpenAPI/v1/upstream/upstreamDatasourceToken

请求参数

参数名称类型默认值必填说明
ownerEmailPrefixstring用户名
dataSourceTypestring数据源类型

请求参数示例

curl https://${domain}/aeolus/prep/userOpenAPI/v1/upstream/upstreamDatasourceToken?ownerEmailPrefix=yangshaojie.ysj&dataSourceType=mysql

返回结果示例

{
    "code": "prep/dataSource/metaUpstreamTokenNotFound",
    "message": "未找到用户yangshaojie.ysj的${type}数据源的token信息",
    "extraMsg": null,
    "advice": null,
    "data": null
}