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
Parameter | Mandatory | Type | Description |
---|---|---|---|
app_id | Yes | Long | Component ID. |
Request 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
Parameter | Type | Description |
---|---|---|
envs | Array of EnvNodeModel objects | Environment information list. |
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. |
data_source | String | Data source. |
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": [{"default": false,"id": 11,"gmt_create": null,"gmt_modify": null,"app_id": 11,"business_name": null,"inner_domain_id": null,"name": "","is_default": false,"app_name": null,"business_id": 162,"region": "","data_source": "APM",}]}
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
See Error Codes.
- Function
- URI
- Request Parameters
- Response Parameters
- Example Requests
- Example Responses
- Status Codes
- Error Codes