Skip to content

数据网关

数据网关的数据结构

字段类型描述
idLONG数据网关对象 id
titleSTRING数据网关名字
enableBOOL数据网关是否启用

接口说明

新增数据网关

请求

http
POST /api/data-gateways HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

请求参数

request body 参数

数据网关的数据结构

返回对象格式
字段类型说明
dataOBJECT数据网关的数据结构
接口示例
http
POST /api/data-gateways HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

// Request Body:
{
  "title":"dgw3"
}
http
HTTP/1.1 200 Ok
Content-Type: application/json

{
  "version": "version@9a5e106#6730f0d",
  "code": 0,
  "msg": "success",
  "data": {
    "id": 4,
    "title": "dgw3"
    "enable": true
  }
}

获取数据网关列表

说明

仅能获取用户自己建立的数据网关

请求

http
GET /api/data-gateways HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
请求参数

返回对象格式
字段类型说明
dataOBJECT数据网关的数据结构
接口示例
http
GET /api/data-gateways 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": [
    {
      "id": 2,
      "title": "dgw2",
      "enable": true
    },
    {
      "id": 1,
      "title": "dgw1.1",
      "enable": false
    },
    {
      "id": 4,
      "title": "dgw3",
      "enable": true
    }
  ]
}

修改数据网关对象

请求

http
PUT /api/data-gateways/{dataGatewayId} HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
request body 参数

数据网关的数据结构

返回对象格式
字段类型说明
dataOBJECT数据网关的数据结构
接口示例
http
PUT /api/data-gateways/1 HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

// Request Body:
{
  "title":"dgw1.2"
}
http
HTTP/1.1 200 Ok
Content-Type: application/json

{
  "version": "version@9a5e106#6730f0d",
  "code": 0,
  "msg": "success",
  "data": {
    "id": 1,
    "title": "dgw1.2"
  }
}

删除数据网关对象

请求

http
DELETE /api/data-gateways/{dataGatewayId} HTTP/1.1
request body 参数

返回对象格式

接口示例
http
DELETE /api/data-gateways/1 HTTP/1.1
http
HTTP/1.1 200 Ok
Content-Type: application/json

{
  "version": "version@9a5e106#6730f0d",
  "code": 0,
  "msg": "success"
}

下载客户端压缩包

请求

http
GET /api/data-gateways/{dataGatewayId}/clientpkg HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, br, zstd
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

请求参数

返回对象格式
http
HTTP/1.1 200 Ok
Content-Disposition: attachment;filename=data-gateway-w.zip
Content-Type: application/zip;charset=UTF-8

data-gateway-w.zip

下载客户端配置文件

请求

http
GET /api/data-gateways/{dataGatewayId}/clientconfig HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, br, zstd
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

请求参数

返回对象格式

data-gateway-xxx.json 文件内容

http
HTTP/1.1 200 Ok
Content-Disposition: attachment;filename=data-gateway-w.json
Content-Encoding: gzip
Content-Type: text/plain;charset=UTF-8

data-gateway-w.json

HENGSHI SENSE API 使用手册