Help Center/ Application Performance Management/ API Reference(2.0)/ APIs/ CMDB/ Obtaining the Environment List of a Component
Updated on 2023-08-02 GMT+08:00

Obtaining the Environment List of a Component

Function

This API is used to obtain the environment list of a component.

URI

GET /v1/apm2/openapi/cmdb/envs/get-app-envs

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

app_id

Yes

Long

Component ID.

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

envs

Array of EnvNodeModel objects

Environment information list.

Table 4 EnvNodeModel

Parameter

Type

Description

id

Long

Environment ID.

gmt_create

String

Creation time.

gmt_modify

String

Update time.

app_id

Long

Component ID.

business_name

String

Application name.

inner_domain_id

Integer

Tenant ID.

name

String

Environment name.

is_default

Boolean

Whether the environment is a default environment.

app_name

String

Component name.

business_id

Long

Application ID.

region

String

Region.

Example Requests

Obtain the environment list of component 11.

/v1/apm2/openapi/cmdb/envs/get-app-envs?app_id=11

Example Responses

Status code: 200

OK: The request is successful.

{
  "envs" : [ {
    "id" : 11,
    "gmt_create" : null,
    "gmt_modify" : null,
    "app_id" : 11,
    "business_name" : null,
    "inner_domain_id" : null,
    "name" : "suzhou-roma-2",
    "is_default" : false,
    "app_name" : null,
    "business_id" : 162,
    "region" : "suzhou-roma-2"
  } ]
}

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.