Policy management API - GET native policies
Lists all policies that are native to a policy level.
The request produces an application/json
payload.
GET |
|
Authentication
To execute this request, you need the Allow IAM policy configuration for environments (iam-policies-management
) permission assigned to your token. To learn how to obtain and use it, see Authentication.
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
levelType | string | The type of the policy level. The following values are available:
Each level inherits the policies of the higher level and extends them with its own policies. | path | required |
levelId | string | The ID of the policy level. Use one of the following values, depending on the level type:
| path | required |
name | string | Optional policy name. Only policies that are of equal name will be returned. | query | optional |
Response
Response codes
Code | Type | Description |
---|---|---|
200 | PolicyDtoList | Success. The response contains the list of policies. |
404 | ErrorDto | Failed. The specified resource is not found. |
Response body objects
The PolicyDtoList
object
Element | Type | Description |
---|---|---|
policies | PolicyDto[] | A list of policies. |
The PolicyDto
object
Element | Type | Description |
---|---|---|
uuid | string | The ID of the policy. |
name | string | The display name of the policy. |
description | string | A short description of the policy. |
Response body JSON model
1{2 "policies": [3 {4 "uuid": "string",5 "name": "string",6 "description": "string"7 }8 ]9}
Example
In this example, the request lists native policies of the mySampleEnv environment. The result is truncated to two entries.
Curl
1curl --request GET \2 --url 'https://api.dynatrace.com/iam/v1/repo/environment/mySampleEnv/policies' \3 --header 'Authorization: Bearer abcdefjhij1234567890'
Request URL
1https://api.dynatrace.com/iam/v1/repo/environment/mySampleEnv/policies
Response body
1{2 "policies": [3 {4 "uuid": "b420b269-7acb-4081-b98f-b5772de63542",5 "name": "Settings Reader",6 "description": "Settings Reader Policy"7 },8 {9 "uuid": "d10eb8e0-875a-40c8-821c-6214c23ac0b3",10 "name": "Settings Writer",11 "description": "Settings Writer Policy"12 }13 ]14}
Response code
200