获取工作区详情
使用该接口可以获取指定工作区的详情,其中包括工作区信息、项目列表、项目中的数据表列表
请求
curl -vvv "$API_HOST/open/api/v1/workspaces/$type/$id/" -H "Authorization: $access-token"
Python 示例
def get_workspace_detail(access_token, workspace):
url = '%s/open/api/v1/workspaces/%s/%d/' % (API_HOST, workspace['type'], workspace['id'])
headers = {'Authorization': access_token}
req = requests.get(url, headers=headers)
return req.json()
响应
响应体
| Name | Type | Description |
|---|---|---|
| detail | object | Workspace info |
| ∟ currentUser | object | User info |
| ∟ projects | array | Project list |
| ∟ recycleProjects | array | Projects in the trash |
| ∟ dataFiles | array | Dataset list |
| ∟ recycleDataFiles | array | Datasets in the trash |
| ∟ unreadNotificationsCount | int64 | Unread notifications count |
项目列表
| Name | Type | Description |
|---|---|---|
| projects | array | Project list |
| ∟ id | int64 | Project ID |
| ∟ name | string | Project name |
| ∟ desc | string | Project description |
| ∟ icon | string | Project icon |
| ∟ updateTime | string | Project updated time |
| ∟ createTime | string | Project created time |
| ∟ memberCount | string | Project member count |
| ∟ creator | object | Project creator |
| ∟ id | int64 | Project creator ID |
| ∟ name | string | Project creator name |
| ∟ avatar | string | Project creator avatar |
| ∟ tableNodes | array | Tables in projects |
数据表列表
| 名称 | 类型 | 描述 |
|---|---|---|
| tableNodes | array | 数据表列表 |
| ∟ id | int64 | 数据表 ID |
| ∟ name | string | 名称 |
| ∟ type | string | 类型: table, bigTable, group |
| ∟ subscribed | boolean | 是否为订阅表 |
| ∟ published | boolean | 是否已发布为订阅源 |
| ∟ createTime | string | 创建时间 |
响应体示例
{
"code": 0,
"detail": {
"type": "user",
"detail": {
"currentUser": {
"id": 16,
"name": "587****9399",
"avatar":null },
"projects": [
{
"id": 55,
"name": "Example Project",
"icon": "mapPin",
"desc": "Example Project",
"creator": {
"id": 16,
"name": "587****9399",
"avatar":null },
"updateTime": "2022-04-07T17:24:47.590592+08:00",
"createTime": "2022-04-07T17:24:47.590591+08:00",
"roleInherited":false,
"tableNodes": [
{
"id": 434,
"name": "Parcel List",
"type": "table",
"order": 1,
"parentID":null,
"subscribed":false,
"published":false,
"roleInherited":true,
"createTime": "2022-04-07T17:24:47.611129+08:00",
"updateTime": "2022-04-07T17:24:47.61113+08:00"
},
{
"id": 435,
"name": "Hangzhou Zone1",
"type": "table",
"order": 2,
"parentID":null,
"subscribed":false,
"published":false,
"roleInherited":true,
"createTime": "2022-04-07T17:24:47.636041+08:00",
"updateTime": "2022-04-14T17:47:28.752613+08:00"
}
],
"recycleTableNodes":null,
"mapConfig": {
"center": "120.209276,30.247413",
"zoomLevel": 10,
"positioning":false,
"ranging":true,
"isSet":true,
"baseMap": "AmapLight",
"shareToken": "",
"isShared":false },
"memberCount": 1
}
],
"recycleProjects":null,
"dataFiles":null,
"recycleDataFiles":null,
"unreadNotificationsCount": 0
}
},
"extra":null,
"message": "OK",
"requestID":null
}