Help Center/ Identity and Access Management/ API Reference/ API/ Enterprise Project Management/ Querying Users Directly Associated with an Enterprise Project
Updated on 2024-11-18 GMT+08:00

Querying Users Directly Associated with an Enterprise Project

Function

This API is used to query the users directly associated with a specified enterprise project.

The API can be called using both the global endpoint and region-specific endpoints. For IAM endpoints, see Regions and Endpoints.

Debugging

You can debug this API in API Explorer.

URI

GET /v3.0/OS-PERMISSION/enterprise-projects/{enterprise_project_id}/users

Table 1 URI parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

Yes

String

ID of the enterprise project to be queried.

Request Parameters

Table 2 Parameters in the request header

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Authenticated token with iam:permissions:listUsersForEnterpriseProject or Security Administrator permission.

Response Parameters

Status code: 200

Table 3 Parameters in the response body

Parameter

Type

Description

users

Array of objects

User information.

Table 4 users

Parameter

Type

Description

domain_id

String

ID of the account which an authorized user belongs to.

id

String

ID of the authorized user.

name

String

Name of the authorized user.

enabled

Boolean

Indicates whether the authorized user is enabled. The value can be true or false. The default value is true.

description

String

Description of the authorized user.

policy_num

Integer

Number of policies that have been assigned to the authorized user.

lastest_policy_time

Long

Duration (in milliseconds) for which the user has been last associated with a policy in the enterprise project.

Example Request

Request for querying users associated with an enterprise project

GET https://iam.myhuaweicloud.com/v3.0/OS-PERMISSION/enterprise-projects/{enterprise_project_id}/users

Example Response

Status code: 200

The request is successful.

{
  "users" : [ {
    "domain_id" : "d78cbac186b744899480f25bd02...",
    "id" : "07667db96a00265f1fc0c003a...",
    "name" : "IAMUserA",
    "enabled" : true,
    "description" : "IAMDescriptionA",
    "policy_num" : 2,
    "lastest_policy_time" : 1589874427000
  } ]
}

Status Codes

Status Code

Description

200

The request is successful.

400

Parameter error.

401

Authentication failed.

403

Access denied.

404

The requested resource cannot be found.

500

The system is abnormal.