Queries a list of users of a bastion host.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
yundun-bastionhost:ListUsers |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The ID of the bastion host whose users you want to query. Note
You can call the DescribeInstances operation to query the bastion host ID. |
bastionhost-cn-st220aw**** |
| RegionId |
string |
No |
The region ID of the bastion host whose users you want to query. Note
For more information about the mapping between region IDs and region names, see Regions and zones. |
cn-hangzhou |
| PageNumber |
string |
No |
The page number. Default value: 1. |
1 |
| PageSize |
string |
No |
The number of entries per page. Note
We recommend that you do not leave this parameter empty. |
20 |
| UserName |
string |
No |
The logon name of the user that you want to query. Only exact match is supported. |
abc |
| DisplayName |
string |
No |
The display name of the user that you want to query. Only exact match is supported. |
用户 |
| Source |
string |
No |
The type of the user that you want to query. Valid values:
|
Local |
| Mobile |
string |
No |
The mobile phone number of the user that you want to query. Only exact match is supported. |
1359999**** |
| UserState |
string |
No |
The state of the user that you want to query. Valid values:
|
Normal |
| SourceUserId |
string |
No |
The unique ID of the user that you want to query. Only exact match is supported. Note
This parameter uniquely identifies a RAM user of the bastion host. This parameter is valid if Source is set to Ram. You can call the ListUsers operation in RAM to obtain the unique ID of the user from the UserId response parameter. |
122748924538**** |
| UserGroupId |
string |
No |
The ID of the user group to which the user you want to query belongs. Note
You can call the ListUserGroups operation to query the user group ID. |
1 |
All Alibaba Cloud API operations must include common request parameters. For more information about common request parameters, see Common request parameters. For more information about sample requests, see Sample requests.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The returned data. |
||
| TotalCount |
integer |
The total number of users returned. |
1 |
| RequestId |
string |
The request ID. |
EC9BF0F4-8983-491A-BC8C-1B4DD94976DE |
| Users |
array<object> |
The users returned. |
|
|
object |
|||
| DisplayName |
string |
The display name of the user. |
Bob |
|
string |
The email address of the user. |
1099**@qq.com |
|
| Comment |
string |
The remarks of the user. |
comment |
| MobileCountryCode |
string |
The location where the mobile phone number of the user is registered. Valid values:
|
CN |
| Mobile |
string |
The mobile phone number of the user. |
1359999**** |
| UserId |
string |
The user ID. |
1 |
| Source |
string |
The type of the user. Valid values:
|
Local |
| UserName |
string |
The logon name of the user. |
abc_def |
| SourceUserId |
string |
The unique ID of the user. Note
This parameter uniquely identifies a RAM user of the bastion host. A value is returned for this parameter if Source is set to Ram. No value is returned for this parameter if Source is set to Local. |
122748924538**** |
| UserState |
array |
An array that lists the states of users. |
|
|
string |
The state of the user. Valid values:
|
["Normal"] |
|
| EffectiveStartTime |
integer |
The start time of the validity period of the user. The value is a UNIX timestamp. Unit: seconds. |
1669630029 |
| EffectiveEndTime |
integer |
The end time of the validity period of the user. The value is a UNIX timestamp. Unit: seconds. |
1672502400 |
| NeedResetPassword |
boolean |
Indicates whether password reset is required upon the next logon. Valid values:
|
true |
| TwoFactorStatus |
string |
Indicates whether two-factor authentication is enabled for the user. Valid values:
|
Enable |
| TwoFactorMethods |
array |
An array of the enabled two-factor authentication methods. |
|
|
string |
The enabled two-factor authentication method. Only one method is supported for each user. Valid values:
|
[ "sms" ] |
|
| LanguageStatus |
string |
Indicates whether notifications are sent in the language specified in the global settings or a custom language.
|
Custom |
| Language |
string |
This parameter is required if LanguageStatus is set to Custom. Valid values:
|
en |
Examples
Success response
JSON format
{
"TotalCount": 1,
"RequestId": "EC9BF0F4-8983-491A-BC8C-1B4DD94976DE",
"Users": [
{
"DisplayName": "Bob",
"Email": "1099**@qq.com",
"Comment": "comment",
"MobileCountryCode": "CN",
"Mobile": "1359999****",
"UserId": "1",
"Source": "Local",
"UserName": "abc_def",
"SourceUserId": "122748924538****",
"UserState": [
"[\"Normal\"]"
],
"EffectiveStartTime": 1669630029,
"EffectiveEndTime": 1672502400,
"NeedResetPassword": true,
"TwoFactorStatus": "Enable",
"TwoFactorMethods": [
"[\n \"sms\"\n]"
],
"LanguageStatus": "Custom",
"Language": "en"
}
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter | The argument is invalid. | The argument is invalid. |
| 500 | InternalError | An unknown error occurred. | An unknown error occurred. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.