Updated on 2023-08-02 GMT+08:00

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

TopologyTree object

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.

admin

Boolean

Whether the node is a management node.

default

String

Whether the node is the default one.

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" : "6",
      "parent" : null,
      "real_id" : 6,
      "name" : "LubanApm",
      "display_name" : "LubanApm",
      "app_name" : null,
      "app_id" : null,
      "is_admin" : false,
      "is_root" : true,
      "business_id" : 6,
      "node_type" : "BUSINESS",
      "is_default" : false,
      "region" : null
    } ]
  }
}

Status Codes

Status Code

Description

200

OK: The request is successful.

401

Unauthorized: No permissions.

403

Forbidden: Access forbidden.

404

Not Found: The requested resource is not found.

Error Codes

See Error Codes.