主题
资源管理
资源说明
资源管理定义
资源管理用于批量删除、转移系统内不同用户的不同资源,资源包括:应用、链接、数据集成、数据科学
接口说明
- 资源管理的所有接口都需要用户拥有
系统管理员角色
获取资源列表
请求URL
http
GET /api/resource-managements HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...请求参数
URL 参数
| 字段 | 类型 | 是否必须 | 说明 |
|---|---|---|---|
| types | SET<STRING> | 否 | 要查询的资源类型 |
| userIds | SET<LONG> | 否 | 指定查询哪些用户下的资源 |
| q | STRING | 否 | 搜索关键字 |
| offset | INTEGER | 可选,分页字段,起始查询位置 | |
| limit | INTEGER | 可选,分页字段,查询数量 | |
| orderBy | STRING | 可选,排序字段,默认是按照更新时间降序排序 | |
| orderType | STRING | 可选,排序类型,asc - 表示升序,desc - 表示降序 |
返回对象的格式说明
| 字段 | 类型 | 说明 |
|---|---|---|
| version | STRING | 当前系统版本哈希值 |
| data | OBJECT | 每种应用参数的共同结构见应用参数结构说明。 |
接口示例1: 获取资源列表
http
GET /api/resource-managements?offset=0&limit=20&types=connection&userIds=2&orderBy=type&orderType=asc&q=CA 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": 7,
"title": "Local",
"type": "connection",
"createdBy": 2,
"createdAt": "2020-05-26 14:59:12",
"updatedBy": 2,
"updatedAt": "2020-05-26 14:59:12",
"creator": {
"id": 2,
"name": "test2",
"email": "anonymous@hengshi.com"
},
"updater": {
"id": 2,
"name": "test2",
"email": "anonymous@hengshi.com"
}
},
{
"id": 115,
"title": "Local",
"type": "connection",
"createdBy": 2,
"createdAt": "2020-05-26 14:57:58",
"updatedBy": 2,
"updatedAt": "2020-05-26 14:57:58",
"creator": {
"id": 2,
"name": "test2",
"email": "anonymous@hengshi.com"
},
"updater": {
"id": 2,
"name": "test2",
"email": "anonymous@hengshi.com"
}
}
],
"totalHits": 2,
"offset": 0
}资源转移
请求URL
http
PUT /api/resource-managements/transfer HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...请求参数
Request Body 参数
| 字段 | 类型 | 是否必须 | 说明 |
|---|---|---|---|
| targetUserId | LONG | 是 | 资源转移目标用户 |
| resourceMap | MAP<STRING, LIST<OBJECT>> | 是 | 被转移资源列表 |
返回对象的格式说明
| 字段 | 类型 | 说明 |
|---|---|---|
| version | STRING | 当前系统版本哈希值 |
| data | OBJECT | 每种应用参数的共同结构见应用参数结构说明。 |
接口示例1: 资源转移
http
PUT /api/resource-managements/transfer HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
// Request Body:
{
"targetUserId": 9,
"resourceMap": {
"app": [
{
"id": 31,
"createdBy": 2
}
],
"notebook": [
{
"id": 8,
"createdBy": 2
}
],
"connection": [
{
"id": 6,
"createdBy": 2
}
]
}
}http
HTTP/1.1 200 Ok
Content-Type: application/json
{
"version": "version@9a5e106#6730f0d",
"code": 0,
"msg": "success"
}资源删除
请求URL
http
DELETE /api/resource-managements HTTP/1.1
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...请求参数
Request Body 参数
| 字段 | 类型 | 是否必须 | 说明 |
|---|---|---|---|
| resourceMap | MAP<STRING, LIST<OBJECT>> | 是 | 被转移资源列表 |
返回对象的格式说明
| 字段 | 类型 | 说明 |
|---|---|---|
| version | STRING | 当前系统版本哈希值 |
| data | OBJECT | 每种应用的共同结构见应用参数结构说明。 |
接口示例1: 资源删除
http
DELETE /api/resource-managements HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
// Request Body:
{
"resourceMap": {
"app": [
{
"id": 31,
"createdBy": 9
}
],
"notebook": [
{
"id": 8,
"createdBy": 9
}
],
"connection": [
{
"id": 6,
"createdBy": 9
}
]
}
}http
HTTP/1.1 200 Ok
Content-Type: application/json
{
"version": "version@9a5e106#6730f0d",
"code": 0,
"msg": "success"
}