Get Assets by Application¶
Get all assets that the current user can access under a specified application.
Request Format¶
GET https://{apigw-address}/app-portal-service/v2.1/user/app/asset/tree
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Required or Not |
Data Type |
Description |
---|---|---|---|---|
accessKey |
Query |
true |
String |
Service account of the application. The application authenticates with |
Request Parameters (Header)¶
Name |
Required or Not |
Data Type |
Description |
---|---|---|---|
Authorization |
true |
String |
Access Token, represented as Bearer Token. Refer to Log In or Refresh Access Token to learn how to get Access Token. |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
data |
data struct |
Asset list |
data Struct¶
Name |
Data Type |
Description |
---|---|---|
id |
String |
Node ID |
name |
String |
Node name |
tag |
String |
Tag of a node. If the current node is an asset, the tag is “asset”, otherwise the node is an organizational structure node and the tag is “null”. (As the asset can only be mounted on the leaf node of the organizational structure, so when the tag is “asset”, there must be a parent node and the parent node is an organizational structure node, and there must be no child nodes.) |
parentId |
String |
Parent node ID |
children |
data struct |
Child nodes |
Sample¶
Request Sample¶
GET
https://{apigw-address}/app-portal-service/v2.1/user/app/asset/tree?accessKey=app_1
headers: {"Authorization":"Bearer APP_PORTAL_S_TDKKeqfYBK3m5z3LRgKVqThWDYnRBN44"}
Return Sample¶
{
"id": "sg15663523816801",
"name": "Solar_shangHai",
"tag": null,
"parentId": "",
"children": [
{
"id": "sg15663524029331",
"name": "江阴",
"tag": null,
"parentId": "sg15663523816801",
"children": [
{
"id": "zULM004t",
"name": "Solar_Assert",
"tag": "asset",
"parentId": "",
"children": null
},
{
"id": "osvxGtJC",
"name": "shangHai",
"tag": "asset",
"parentId": "",
"children": null
}
]
}
]
}