nav-img
Advanced

Obtaining an Application Tree

Function

This API is used to obtain an application tree.

URI

GET /v1/apm2/openapi/cmdb/topology-trees/get-topology-trees

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

region_id

No

String

Region ID.

business_id

Yes

Long

Application ID.

env_tag_id

No

Long

Environment tag ID.

env_keyword

No

String

Environment keyword.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

x-business-id

Yes

Long

Application ID.

X-Auth-Token

Yes

String

User token obtained from IAM.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

topology_tree

Topology tree information.

Table 4 TopologyTree

Parameter

Type

Description

tree

Array of TreeNode objects

Topology tree node.

Table 5 TreeNode

Parameter

Type

Description

id

String

ID of a node in the topology tree.

parent

String

Parent node in the topology tree.

real_id

Long

Actual ID of a node in the topology tree.

name

String

Name of a node in the topology tree.

display_name

String

Display name of a node in the topology tree.

app_name

String

Component name.

app_id

Long

Component ID.

is_admin

Boolean

Whether the node is a management node.

is_root

Boolean

Whether the node is a root node.

business_id

Long

Application ID.

node_type

String

Node type.

Enumeration values:

  • BUSINESS
  • SUB_BUSINESS
  • APPLICATION
  • ENVIRONMENT

region

String

Region.

is_default

Boolean

Whether the node is a default node.

Example Requests

Obtain the topology tree of application 162.

/v1/apm2/openapi/cmdb/topology-trees/get-topology-trees?business_id=162

Example Responses

Status code: 200

OK: The request is successful.

{
"topology_tree" : {
"tree" : [ {
"admin" : false,
"default" : false,
"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
}, {
"admin" : false,
"default" : false,
"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
}, {
"admin" : false,
"default" : false,
"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
}, {
"admin" : false,
"default" : false,
"id" : "162-55-11-11",
"parent" : "162-55-11",
"real_id" : 11,
"name" : "suzhou-roma-2",
"display_name" : "",
"app_name" : "apm-pu-task",
"app_id" : 11,
"is_admin" : false,
"is_root" : false,
"business_id" : 162,
"node_type" : "ENVIRONMENT",
"is_default" : false,
"region" : ""
} ]
}
}

Status Codes

Status Code

Description

200

OK: The request is successful.

400

Bad Request: Semantic or parameter error.

401

Unauthorized: No permissions.

403

Forbidden: Access forbidden.

404

Not Found: The requested resource is not found.

Error Codes