Environment management API - GET all environments of an account
Lists all environments and management zones of an account.
The request produces an application/json
payload.
GET |
|
Authentication
To execute this request, you need the Allow read access for environment resources (account-env-read
) scope assigned to your token. To learn how to obtain and use it, see Authentication.
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
accountUuid | string | The ID of the required account. You can find the UUID on the Account > Account management API page, during creation of an OAuth client. | path | required |
Response
Response codes
Code | Type | Description |
---|---|---|
200 | EnvironmentResourceDto | Success. The response contains a list of the account's environments. |
Response body objects
The EnvironmentResourceDto
object
Element | Type | Description |
---|---|---|
tenantResources | TenantResourceDto[] | A list of environments in the account. |
managementZoneResources | ManagementZoneResourceDto[] | A list of management zones in the account. |
The TenantResourceDto
object
Element | Type | Description |
---|---|---|
name | string | The name of the environment. |
id | string | The ID of the environment. |
The ManagementZoneResourceDto
object
Element | Type | Description |
---|---|---|
parent | string | The ID of the environment to which the management zone belongs. |
name | string | The name of the management zone. |
id | string | The ID of the management zone. |
Response body JSON model
1{2 "tenantResources": [3 {4 "name": "string",5 "id": "string"6 }7 ],8 "managementZoneResources": [9 {10 "parent": "string",11 "name": "string",12 "id": "string"13 }14 ]15}
Example
In this example, the request lists all environments and management zones of the account with the UUID of 9ad20784-76c6-4167-bfba-9b0d8d72a71d.
Curl
1curl --request GET \2 --url 'https://api.dynatrace.com/env/v1/accounts/9ad20784-76c6-4167-bfba-9b0d8d72a71d/environments' \3 --header 'Authorization: Bearer abcdefjhij1234567890'
Request URL
1https://api.dynatrace.com/env/v1/accounts/9ad20784-76c6-4167-bfba-9b0d8d72a71d/environments
Response body
1{2 "tenantResources": [3 {4 "name": "Sample environment",5 "id": "mySampleEnv"6 },7 {8 "name": "Sample environment - staging",9 "id": "mySampleEnvStaging"10 }11 ],12 "managementZoneResources": [13 {14 "name": "mobile app only",15 "id": "154240256445017454",16 "parent": "mySampleEnv"17 },18 {19 "name": "load tests only",20 "id": "144245256741917454",21 "parent": "mySampleEnvStaging"22 }23 ]24}
Response code
200