Retrieves the list of users for a specified 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 instance ID of the bastion host for which you want to query the user list. Note
You can invoke the DescribeInstances operation to obtain this parameter. |
bastionhost-cn-st220aw**** |
| RegionId |
string |
No |
The region ID of the bastion host for which you want to query the user list. Note
For the mapping between region IDs and region names, see Regions and zones. |
cn-hangzhou |
| PageNumber |
string |
No |
The page number of the current page in a paging query. Default value: 1. |
1 |
| PageSize |
string |
No |
The maximum number of entries per page in a paging query. Note
Do not leave PageSize 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. |
testuser |
| Source |
string |
No |
The source 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 status of the user that you want to query. Valid values:
|
Normal |
| SourceUserId |
string |
No |
The unique identity of the user that you want to query. Only exact match is supported. Note
This parameter is the unique identity of the Resource Access Management (RAM) user that corresponds to the bastion host user. This parameter takes effect when the source of the newly created user is a RAM user (that is, Source is set to Ram). You can invoke the ListUsers operation of access control and obtain this parameter from the UserId field in the response. |
122748924538**** |
| UserGroupId |
string |
No |
The ID of the user group that you want to query. Note
You can call the ListUserGroups operation to obtain this parameter. |
1 |
When you call this operation, you must include the common request parameters of Alibaba Cloud APIs in addition to the request parameters described in this topic. For more information about common request parameters, see Common parameters. For the request format of this operation, see the request examples in this topic.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response data. |
||
| TotalCount |
integer |
The total number of users returned. |
1 |
| RequestId |
string |
The request ID. |
EC9BF0F4-8983-491A-BC8C-1B4DD94976DE |
| Users |
array<object> |
The list of 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 country code of the mobile phone number of the user. Valid values:
|
CN |
| Mobile |
string |
The mobile phone number of the user. |
1359999**** |
| UserId |
string |
The user ID. |
1 |
| Source |
string |
The source of the user. Valid values:
|
Local |
| UserName |
string |
The logon name of the user. |
abc_def |
| SourceUserId |
string |
The unique identity of the user. Note
This parameter is the unique identity of the Resource Access Management (RAM) user that corresponds to the bastion host user. This parameter is returned when the user source is a RAM user (that is, Source is set to Ram). If the user source is a local user (that is, Source is set to Local), this parameter is empty. |
122748924538**** |
| UserState |
array |
The user status array. |
|
|
string |
The status of the user. Valid values:
|
["Normal"] |
|
| EffectiveStartTime |
integer |
The start time of the validity period of the user, in seconds (UNIX timestamp format). |
1669630029 |
| EffectiveEndTime |
integer |
The end time of the validity period of the user, in seconds (UNIX timestamp format). |
1672502400 |
| NeedResetPassword |
boolean |
Indicates whether the password must be reset upon next logon. Valid values:
|
true |
| TwoFactorStatus |
string |
The two-factor authentication status of the user. Valid values:
|
Enable |
| TwoFactorMethods |
array |
The array of enabled two-factor authentication methods. |
|
|
string |
The array of enabled two-factor authentication methods. A maximum of one method is supported. Valid values:
|
[ "sms" ] |
|
| LanguageStatus |
string |
The language setting for message notifications. Valid values:
|
Custom |
| Language |
string |
The language for message notifications. This parameter is required when 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.