Updated on 2024-11-25 GMT+08:00

Querying Environment Permissions

Function

This API is used to query environment permissions.

Calling Method

For details, see Calling APIs.

URI

GET /v2/applications/{application_id}/environments/{environment_id}/permissions

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

application_id

Yes

String

Application ID

environment_id

Yes

String

Environment ID

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

[items]

Array<Array<DevUcEnvironmentPermission>>

Permission data, which is of the list type

Table 4 DevUcEnvironmentPermission

Parameter

Type

Description

id

Integer

Permission ID

role_id

String

Role ID

devuc_role_id_list

Array of strings

Role ID list

role_type

String

Role type. environment-creator: Environment creator. project: Project administrator. template-customized-inst: System roles.

template-project-customized and project-customized: Custom roles.

name

String

Role name

region

String

Region information

environment_id

String

Environment ID

can_view

Boolean

Whether you have the view permission

can_edit

Boolean

Whether you have the edit permission

can_delete

Boolean

Whether you have the delete permission

can_deploy

Boolean

Whether you have the deploy permission

can_manage

Boolean

Whether you can manage permissions

create_time

String

Creation time

update_time

String

Modification time

Example Requests

https://{endpoint}/v2/applications/8ddf0566c1784da29faac80516fa8425/environments/54e5b8b0d10148cc96142ac9d6c1c1f6/permissions

Example Responses

Status code: 200

Permission data, which is of the list type

[ {
  "region" : "region",
  "id" : 99213234,
  "name" : "Environment creator",
  "role_id" : "0",
  "devuc_role_id_list" : null,
  "environment_id" : "be3e9690d6f64b23b54e79cd02c4b156",
  "can_view" : true,
  "can_edit" : true,
  "can_delete" : true,
  "can_deploy" : true,
  "can_manage" : true,
  "create_time" : "2024-06-21 17:23:55.0",
  "update_time" : "2024-06-21 17:23:55.0",
  "role_type" : "environment-creator"
}, {
  "region" : "region",
  "id" : 99213235,
  "name" : "Project admin",
  "role_id" : "a2e65d2647574f8491cac659a0249d24",
  "devuc_role_id_list" : null,
  "environment_id" : "be3e9690d6f64b23b54e79cd02c4b156",
  "can_view" : true,
  "can_edit" : true,
  "can_delete" : true,
  "can_deploy" : true,
  "can_manage" : true,
  "create_time" : "2024-06-21 17:23:55.0",
  "update_time" : "2024-06-21 17:23:55.0",
  "role_type" : "project"
} ]

Status Codes

Status Code

Description

200

Permission data, which is of the list type

Error Codes

See Error Codes.