Updated on 2023-07-18 GMT+08:00

Listing IAM Users

Function

This API is provided for the administrator to list all IAM users.

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

URI

GET /v3/users

Table 1 Query parameters

Parameter

Mandatory

Type

Description

domain_id

No

String

Account ID. For details about how to obtain the account ID, see Obtaining Account, IAM User, Group, Project, Region, and Agency Information.

enabled

No

Boolean

Enabling status of the IAM user. true (default value) indicates that the user is enabled. false indicates that the user is disabled.

name

No

String

IAM user name.

password_expires_at

No

String

Password expiration time. The value null indicates that the password will never expire.

Password format: password_expires_at={operator}:{timestamp}.

Timestamp format: YYYY-MM-DDTHH:mm:ssZ. Example:

password_expires_at=lt:2016-12-08T22:02:00Z
NOTE:
  • The value of operator can be lt, lte, gt, gte, eq, or neq.
  • lt: The expiration time is earlier than timestamp.
  • lte: The expiration time is earlier than or equal to timestamp.
  • gt: The expiration time is later than timestamp.
  • gte: The expiration time is equal to or later than timestamp.
  • eq: The expiration time is equal to timestamp.
  • neq: The expiration time is not equal to timestamp.

Request Parameters

Table 2 Parameters in the request header

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Fill application/json;charset=utf8 in this field.

X-Auth-Token

Yes

String

Access token issued to a user to bear its identity and permissions.

For details about the permissions required by the token, see Actions.

Response Parameters

Table 3 Parameters in the response body

Parameter

Type

Description

links

Object

Resource link information.

users

Array of objects

IAM user information.

Table 5 users

Parameter

Type

Description

name

String

IAM user name.

links

Object

IAM user resource link information.

domain_id

String

ID of the account to which the IAM user belongs.

enabled

Boolean

Enabling status of the IAM user. true (default value) indicates that the user is enabled. false indicates that the user is disabled.

id

String

IAM user ID.

password_expires_at

String

Password expiration time of the IAM user. If this parameter is set to null, the password will never expire.

NOTE:

The value is a UTC time in the YYYY-MM-DDTHH:mm:ss.ssssssZ format, for example, 2023-06-28T08:56:33.710000Z. For details about the date and timestamp formats, see ISO-8601.

description

String

Description of the IAM user.

pwd_status

Boolean

Password status. true means that the password needs to be changed, and false means that the password is normal.

last_project_id

String

ID of the project that the IAM user lastly accessed before exiting the system.

pwd_strength

String

Password strength. The value can be high, mid, or low.

Example Request

Request for listing IAM users as an administrator

GET https://iam.myhuaweicloud.com/v3/users

To narrow down the query range, add a path parameter. For example:

GET https://iam.myhuaweicloud.com/v3/users?domain_id=d78cbac186b744899480f25bd02...&enabled=true

Example Response

Status code: 200

The request is successful.

{
    "links": {
        "next": null,
        "previous": null,
        "self": "https://iam.myhuaweicloud.com/v3/users"
    },
    "users": [
        {
            "domain_id": "d78cbac186b744899480f25bd02...",
            "name": "IAMUserA",
            "description": "IAMDescriptionA",
            "password_expires_at": null,
            "links": {
                "next": null,
                "previous": null,
                "self": "https://iam.myhuaweicloud.com/v3/users/07667db96a00265f1fc0c003a3..."
            },
            "id": "07667db96a00265f1fc0c003a...",
            "enabled": true
        },
        {
            "pwd_status": true,
            "domain_id": "d78cbac186b744899480f25bd02...",
            "last_project_id": "065a7c66da0010992ff7c0031e5a...",

            "name": "IAMUserB",
            "description": "IAMDescriptionB",
            "password_expires_at": null,
            "links": {
                "next": null,
                "previous": null,
                "self": "https://iam.myhuaweicloud.com/v3/users/07609fb9358010e21f7bc003751c7..."
            },
            "id": "07609fb9358010e21f7bc003751c7...",
            "enabled": true
        }
    ]
}

Status Codes

Status Code

Description

200

The request is successful.

400

Invalid parameters.

401

Authentication failed.

403

Access denied.

404

The requested resource cannot be found.

405

The method specified in the request is not allowed for the requested resource.

413

A resource conflict occurs.

500

The request entity is too large.

503

Service unavailable.

Error Codes

None