Skip to content

设置

租户页面设置

页面设置结构说明

租户结构说明

接口说明

获取页面设置

请求URL

http
GET /api/tenants/{tenantId} HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

请求参数

URL Path 参数
字段类型是否必须说明
tenantIdLONG租户的 id

返回对象格式说明

租户结构说明

接口示例1: 获取租户页面设置

http
GET /api/tenants/{tenantId} 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": 10001,
    "tenantName": "tenant",
    "code": "tenant",
    "options": {
      "appMartTabOrders": [
        {
          "visible": true,
          "title": "公共空间1",
          "key": "system_portal"
        },
        {
          "visible": true,
          "title": "平台空间",
          "key": "vendor_area"
        },
        {
          "visible": true,
          "title": "我的空间",
          "key": "app_mart"
        }
      ]
    }
  }
}

修改租户页面设置

请求URL

http
PUT /api/tenants/{tenantId} HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

请求参数

URL Path参数
字段类型是否必须说明
tenantIdLONG租户的 id
request body 参数

租户结构说明, options.appMartTabOrders部分说明。

返回对象格式说明

租户结构说明

接口示例1: 修改租户页面设置

http
PUT /api/tenants/{tenantId} HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

// Request Body:
{
    "options":{
        "appMartTabOrders":[
            {
                "key":"system_portal",
                "title":"公共空间1",
                "visible":true
            },
            {
                "key":"vendor_area",
                "title":"平台空间",
                "visible":true
            },
            {
                "key":"app_mart",
                "title":"我的空间",
                "visible":true
            }
        ]
    }
}
http
HTTP/1.1 200 Ok
Content-Type: application/json

{
  "version": "version@9a5e106#6730f0d",
  "code": 0,
  "msg": "success",
  "data": {
    "id": 10001,
    "tenantName": "tenant",
    "code": "tenant",
    "options": {
      "appMartTabOrders": [
        {
          "visible": true,
          "title": "公共空间1",
          "key": "system_portal"
        },
        {
          "visible": true,
          "title": "平台空间",
          "key": "vendor_area"
        },
        {
          "visible": true,
          "title": "我的空间",
          "key": "app_mart"
        }
      ]
    }
  }
}

平台页面设置

标签页设置结构说明

字段类型是否必须描述
tabOrdersJSON 数组是否显示
tabOrders.visibleBOOLEAN是否显示
tabOrders.titleSTRING标题
tabOrders.keySTRING租户应用集市标签页标识,可选值为:system_portal(公共空间),app_mart(我的空间)

标签页接口说明

获取标签页设置

请求URL

http
GET /api/configurations/app-mart-tag HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

请求参数

返回对象格式说明

标签页设置结构说明

接口示例1: 获取标签页设置

http
GET /api/configurations/app-mart-tag 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": {
    "tabOrders": [
      {
        "visible": true,
        "title": "我的空间",
        "key": "app_mart"
      },
      {
        "visible": true,
        "title": "公共空间1",
        "key": "system_portal"
      }
    ]
  }
}

修改标签页设置

请求URL

http
PUT /api/configurations/app-mart-tag HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

请求参数

URL 参数

request body 参数

平台页面设置结构说明

返回对象格式说明

平台页面设置结构说明

接口示例1: 修改租户页面设置

http
PUT /api/configurations/app-mart-tag HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

// Request Body:
{
    "tabOrders":[
        {
            "visible":true,
            "title":"我的空间",
            "key":"app_mart"
        },
        {
            "visible":true,
            "title":"公共空间1",
            "key":"system_portal"
        }
    ]
}
http
HTTP/1.1 200 Ok
Content-Type: application/json

{
  "version": "version@9a5e106#6730f0d",
  "code": 0,
  "msg": "success",
  "data": {
    "tabOrders": [
      {
        "visible": true,
        "title": "我的空间",
        "key": "app_mart"
      },
      {
        "visible": true,
        "title": "公共空间1",
        "key": "system_portal"
      }
    ]
  }
}

首页设置结构说明

字段类型是否必须描述
defaultLandingPageSTRING默认首页,可选值为:home(首页),app_mart(应用集市)

首页设置接口说明

获取首页设置

请求URL

http
GET /api/configurations/home HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

请求参数

返回对象格式说明

首页设置结构说明

接口示例1: 获取首页设置

http
GET /api/configurations/home 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": {
    "defaultLandingPage": "app_mart"
  },
  "chartDataStartTimeMillis": 0
}

修改首页设置

请求URL

http
PUT /api/configurations/home HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

请求参数

request body 参数

首页设置结构说明

返回对象格式说明

首页设置结构说明

接口示例1: 修改首页设置

http
PUT /api/configurations/home HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

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

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

公开数仓

数仓结构说明

字段类型描述
enableBOOL公开数仓是否开启
hostSTRING数仓地址
portINTEGER数仓端口
usernameSTRING登录用户名
passwordSTRING登录密码

接口说明

获取数仓信息

请求URL

http
GET /api/configurations/open-dwinfo HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

请求参数

返回对象格式说明

数仓结构说明

接口示例1: 获取数仓信息

http
GET /api/configurations/open-dwinfo 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": {
        "enable": true,
        "host": "greenplum.hengshi.org",
        "port": 15432,
        "dbname": "dev_engine_hs_dw",
        "username": "demo",
        "password": "abcd"
    }
}

修改数仓信息

http
PUT /api/configurations/open-dwinfo HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

请求参数

request body
字段类型描述
enableBOOL公开数仓是否开启
passwordSTRING登录密码

返回对象格式说明

数仓结构说明

接口示例1: 修改数仓信息

http
PUT /api/configurations/open-dwinfo HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

// Request Body:
{
    "password":"abcd",
    "enable":true
}
http
HTTP/1.1 200 Ok
Content-Type: application/json

{
  "version": "version@9a5e106#6730f0d",
  "code": 0,
  "msg": "success",
  "data": {
    "enable": true,
    "username": "demo",
    "password": "abcd"
  }
}

皮肤

皮肤结构说明

字段类型是否必须描述
baseSTRING皮肤,可选值为 :light/dark
customJSON自定义皮肤的json对象

接口说明

修改皮肤

请求URL
http
PUT /api/configurations/skin HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

请求参数

URL 参数

request body 参数

皮肤结构说明

返回对象的格式说明

皮肤结构说明

偏好配置

偏好配置的定义

可以获取偏好的配置

偏好结构说明

字段类型说明
versionSTRING当前系统版本哈希值
data.skin.baseSTRING皮肤,值为 :light/dark
data.home.defaultLandingPageSTRING首页设置,参考首页设置结构说明

接口说明

获取偏好配置

请求URL

http
GET /api/system-preferences HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

请求参数

URL 参数

request body 参数

返回对象的格式说明

偏好结构说明

安全策略配置

安全策略配置的定义

可以获取和修安全策略配置

安全策略结构说明

字段类型描述
enableComplexPasswordBOOL是否启用复杂密码
enablePasswordExpireBOOL是否密码90天失效
enableCaptchaBOOL是否启用图片验证码
enableWatermarkBOOL是否开启水印保护
sessionTimeoutINTEGERsession 回话过期时间,单位是小时
enableHmacBOOL是否启用HMAC签名保护
hmacKeySTRINGHMAC key
downloadRowLimitINTEGER数据集和图片下载excel行数限制
exportingDataConfig.exportSwitchBOOL是否允许导出数据
exportingDataConfig.policy导出数据策略,可选值为:ENUMWHITE(包含), BLACK(排除)
exportingDataConfig.usersBOOL包含/排除的用户列表
exportingDataConfig.organizationsBOOL包含/排除的用户组列表
exportingDataConfig.orgsBOOL包含/排除的组织架构列表
exportingDataConfig.tenantsBOOL包含/排除的租户列表

接口说明

获取安全策略配置

请求URL

http
GET /api/configurations/security HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

请求参数

URL 参数

request body 参数

返回对象的格式说明

字段类型描述
dataOBJECT安全策略结构说明

接口示例1: 获取安全策略配置

http
GET /api/configurations/security 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": {
    "enableComplexPassword": false,
    "enablePasswordExpire": false,
    "enableCaptcha": false,
    "enableWatermark": false,
    "exportingDataConfig": {
      "exportSwitch": true,
      "policy": "WHITE",
      "users": [],
      "organizations": [
        {
          "id": 0,
          "name": "ALL_USERS"
        }
      ],
      "orgs": [],
      "tenants": [
        {
          "id": 0,
          "tenantName": "ALL_TENANTS"
        }
      ]
    },
    "downloadRowLimit": 100000,
    "sessionTimeout": "38",
    "sessionTimeoutInt": 38
  }
}

修改安全策略配置

请求URL

http
PUT /api/configurations/security HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

请求参数

URL 参数

request body 参数

安全策略结构说明

返回对象的格式说明

字段类型描述
dataOBJECT安全策略结构说明

接口示例1: 修改安全策略配置

http
PUT /api/configurations/security HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

// Request Body:
{
  "exportingDataConfig":{
    "exportSwitch":true,
    "policy":"WHITE",
    "users":[
      {
        "id":29
      }
    ],
    "organizations":[
      {
        "id":0
      }
    ],
    "orgs":[

    ],
    "tenants":[
      {
        "id":0,
        "tenantName":"ALL_TENANTS",
        "code":"ALL_TENANTS",
        "resetPassword":true,
        "isTenant":true
      }
    ]
  }
}
http
HTTP/1.1 200 Ok
Content-Type: application/json

{
  "version": "version@9a5e106#6730f0d",
  "code": 0,
  "msg": "success",
  "data": {
    "enableComplexPassword": false,
    "enablePasswordExpire": false,
    "enableCaptcha": false,
    "enableWatermark": false,
    "exportingDataConfig": {
      "exportSwitch": true,
      "policy": "WHITE",
      "users": [],
      "organizations": [
        {
          "id": 0,
          "name": "ALL_USERS"
        }
      ],
      "orgs": [],
      "tenants": [
        {
          "id": 0,
          "tenantName": "ALL_TENANTS"
        }
      ]
    },
    "downloadRowLimit": 100000,
    "sessionTimeout": "38",
    "sessionTimeoutInt": 38
  }
}

系统设置

系统设置的定义

可以获取和修系统设置

系统设置结构说明

字段类型描述
versionSTRING当前版本号(只读)
startTimeINTEGER系统启动时间,精确到毫秒(只读)
baseUrlSTRING系统域名
hsHttpProxySTRINGHTTP代理
hsResultCacheIntervalINTEGER图表数据换成周期(秒)
datasetCacheLimitINTEGER数据集缓存大小限制(MB)
disableCSRFBOOL是否停用CSRF
totalEngineResourceINTEGER租户能用的总资源数
cpuPerResourceUnitNUMBER资源数代表的cpu核数(只读 )
memPerResourceUnitNUMBER资源数代表的内存大小,单位MB(只读)
disableAreaRefreshBOOL停止应用创作的数据集定时更新

接口说明

获取系统设置

请求URL

http
GET /api/configurations/everest HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

请求参数

URL 参数

request body 参数

返回对象的格式说明

字段类型描述
dataOBJECT系统设置结构说明

接口示例:获取系统设置

http
GET /api/configurations/everest 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":{
        "baseUrl": "https://develop.hengshi.org",
        "datasetCacheLimit": 500000,
        "hsResultCacheInterval": 7200,
        "startTime": 1634734561711,
        "version": "version@9a5e106#6730f0d",
        "totalEngineResource":10000,
        "cpuPerResourceUnit":0.001,
        "memPerResourceUnit":10,
        "disableAreaRefresh":false
    }
}

修改系统设置

请求URL

http
PUT /api/configurations/everest HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

请求参数

URL 参数

request body 参数

系统设置结构说明中的非只读字段

返回对象的格式说明

字段类型描述
dataOBJECT系统设置结构说明

接口示例:修改系统设置

http
PUT /api/configurations/everest HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

// Request Body:
{
    "baseUrl": "https://develop.hengshi.org",
    "datasetCacheLimit": 500000,
    "hsResultCacheInterval": 7200,
    "totalEngineResource":1000,
    "disableAreaRefresh":true
}
http
HTTP/1.1 200 Ok
Content-Type: application/json

{
    "version": "version@9a5e106#6730f0d",
    "code":0,
    "msg":"success",
    "data":{
        "baseUrl": "https://develop.hengshi.org",
        "datasetCacheLimit": 500000,
        "hsResultCacheInterval": 7200,
        "startTime": 1634734561711,
        "version": "version@9a5e106#6730f0d",
        "totalEngineResource":1000,
        "cpuPerResourceUnit":0.01,
        "memPerResourceUnit":100,
        "disableAreaRefresh":true
    }
}

GET 获取日志清理计划配置信息

获取当前衡石系统日志清理计划的配置信息。

http
GET /api/configurations/running-log 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,
  "msg": "success",
  "data": {
    "days": 7
  },
  "chartDataStartTimeMillis": 0
}

返回结果

状态码状态码含义说明数据模型
200OK成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenonenone
» msgstringtruenonenone
» dataobjecttruenonenone
»» daysintegertruenone日志保留天数
» chartDataStartTimeMillisintegertruenonenone

GET 获取日志清理任务状态

获取当前衡石系统清理任务的状态信息。

http
GET /api/running-log/log HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
http
HTTP/1.1 200 Ok
Content-Type: application/json

{
  "code": 0,
  "msg": "success",
  "data": {
    "executeObject": "系统",
    "endingTime": "2023-08-10 22:08:00",
    "startTime": "2023-08-10 22:00:00",
    "status": "FAILED",
    "releaseSize": 0,
    "earliestSaveTime": "2023-08-04"
  },
  "chartDataStartTimeMillis": 0
}

返回结果

状态码状态码含义说明数据模型
200OK成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenonenone
» msgstringtruenonenone
» dataobjecttruenonenone
»» executeObjectstringtruenone触发此次清理任务的对象(具体用户或者衡石系统)
»» endingTimestringtruenone任务结束时间
»» startTimestringtruenone任务开始时间
»» statusstringtruenone任务状态
»» releaseSizeintegertruenone释放空间大小
»» earliestSaveTimestringtruenone日志最早保留时间
» chartDataStartTimeMillisintegertruenonenone

HENGSHI SENSE API 使用手册