获取应用树
功能介绍
获取应用树。
URI
GET /v1/apm2/openapi/cmdb/topology-trees/get-topology-trees
请求参数
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
x-business-id |
是 |
Long |
应用id。 |
|
X-Auth-Token |
是 |
String |
从IAM服务获取的用户Token。 |
响应参数
状态码: 200
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
topology_tree |
TopologyTree object |
拓扑树信息。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
id |
String |
拓扑树节点id。 |
|
parent |
String |
拓扑树节点的父节点。 |
|
real_id |
Long |
拓扑树节点的实际id。 |
|
name |
String |
拓扑树节点名称。 |
|
display_name |
String |
拓扑树节点展示名称。 |
|
app_name |
String |
组件名称。 |
|
app_id |
Long |
组件id。 |
|
is_admin |
Boolean |
是否是管理节点。 |
|
is_root |
Boolean |
是否是根节点。 |
|
business_id |
Long |
应用id。 |
|
node_type |
String |
节点类型。 枚举值:
|
|
region |
String |
区域。 |
|
is_default |
Boolean |
是否是默认的节点。 |
请求示例
获取应用ID为162的拓扑树信息。
/v1/apm2/openapi/cmdb/topology-trees/get-topology-trees?business_id=162
响应示例
状态码: 200
OK,请求响应成功。
{
"topology_tree" : {
"tree" : [ {
"id" : "162-55-11",
"parent" : "162-55",
"real_id" : 11,
"name" : "apm-pu-task",
"display_name" : "apm-pu-task",
"app_name" : null,
"app_id" : null,
"is_admin" : false,
"is_root" : false,
"business_id" : 162,
"node_type" : "APPLICATION",
"is_default" : false,
"region" : null
}, {
"id" : "162-55",
"parent" : "162",
"real_id" : 55,
"name" : "App",
"display_name" : "App",
"app_name" : null,
"app_id" : null,
"is_admin" : false,
"is_root" : false,
"business_id" : 162,
"node_type" : "SUB_BUSINESS",
"is_default" : false,
"region" : null
}, {
"id" : "162",
"parent" : null,
"real_id" : 162,
"name" : "LubanApm",
"display_name" : "LubanApm",
"app_name" : null,
"app_id" : null,
"is_admin" : false,
"is_root" : true,
"business_id" : 162,
"node_type" : "BUSINESS",
"is_default" : false,
"region" : null
}, {
"id" : "162-55-11-11",
"parent" : "162-55-11",
"real_id" : 11,
"name" : "xxx-roma-2",
"display_name" : "xxx-roma-2",
"app_name" : "apm-pu-task",
"app_id" : 11,
"is_admin" : false,
"is_root" : false,
"business_id" : 162,
"node_type" : "ENVIRONMENT",
"is_default" : false,
"region" : "xxx-roma-2"
} ]
}
}
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
OK,请求响应成功。 |
|
400 |
Bad Request,语义或参数有误。 |
|
401 |
Unauthorized,没有权限。 |
|
403 |
Forbidden,禁止访问。 |
|
404 |
Not Found,没有找到要请求的资源。 |
错误码
请参见错误码。