Help Center/ Application Performance Management/ API Reference(2.0)/ APIs/ APM/ Searching for Components, Environments, and Agents in a Region
Updated on 2023-08-02 GMT+08:00

Searching for Components, Environments, and Agents in a Region

Function

This API is used to search for components, environments, and Agents in a region.

URI

POST /v1/apm2/openapi/apm-service/app-mgr/search

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token obtained from IAM.

x-business-id

Yes

Long

Application ID.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

business_id

Yes

Long

Application ID.

region

Yes

String

Region name.

page

Yes

Integer

Page number.

page_size

Yes

Integer

Number of records on each page.

keyword

No

String

Keyword.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

app_info_list

Array of AppInfo objects

Component list.

app_total_count

Integer

Total number of components.

app_info_map

Map<String,AppInfo>

Mappings between component names and details.

Table 4 AppInfo

Parameter

Type

Description

env_name

String

Environment name.

env_id

Long

Environment ID.

app_name

String

Component name.

app_id

Long

Component ID.

online_count

Integer

Number of online Agents.

disable_count

Integer

Number of Agents that are manually stopped.

offline_count

Integer

Number of offline Agents.

Example Requests

Search for the Agents whose region ID is ap-southeast-3 and application ID is 6, with the page number set to 1 and page size set to 10.

/v1/apm2/openapi/apm-service/app-mgr/search

{
  "business_id" : 6,
  "region" : "xx-xxx-xxx",
  "keyword" : "",
  "page" : 1,
  "page_size" : 10
}

Example Responses

Status code: 200

OK: The request is successful.

{
  "app_info_list" : [ {
    "env_name" : "beta",
    "env_id" : 1,
    "app_name" : "application_name",
    "app_id" : 2,
    "online_count" : 2,
    "disable_count" : 1,
    "offline_count" : 1
  } ],
  "app_total_count" : 4,
  "app_info_map" : {
    "additionalProp1" : {
      "env_name" : "string",
      "env_id" : 0,
      "app_name" : "string",
      "app_id" : 0,
      "online_count" : 0,
      "disable_count" : 0,
      "offline_count" : 0
    },
    "additionalProp2" : {
      "env_name" : "string",
      "env_id" : 0,
      "app_name" : "string",
      "app_id" : 0,
      "online_count" : 0,
      "disable_count" : 0,
      "offline_count" : 0
    },
    "additionalProp3" : {
      "env_name" : "string",
      "env_id" : 0,
      "app_name" : "string",
      "app_id" : 0,
      "online_count" : 0,
      "disable_count" : 0,
      "offline_count" : 0
    }
  }
}

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.