Retrieves the details of a specified Bastionhost user.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
yundun-bastionhost:GetUser |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The instance ID of the Bastionhost instance to which the user belongs. Note
You can invoke DescribeInstances to obtain this parameter. |
bastionhost-cn-st220aw**** |
| RegionId |
string |
No |
The region ID of the Bastionhost instance to which the user belongs. Note
For the mapping between region IDs and region names, see Regions and zones. |
cn-hangzhou |
| UserId |
string |
Yes |
The ID of the user that you want to query. Note
You can call ListUsers to obtain this parameter. |
1 |
When you call this operation, you must include the Alibaba Cloud common request parameters in addition to the request parameters described in this topic. For more information about common request parameters, see Common parameters. For the request format, see the request examples in this topic.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response data. |
||
| RequestId |
string |
The unique request ID generated by Alibaba Cloud for this request. |
EC9BF0F4-8983-491A-BC8C-1B4DD94976DE |
| User |
object |
The details of the queried user. |
|
| DisplayName |
string |
The display name of the user. |
Bob |
| Comment |
string |
The remarks of the user. |
commet |
|
string |
The email address of the user. |
1099**@qq.com |
|
| Mobile |
string |
The mobile phone number of the user. |
1359999**** |
| MobileCountryCode |
string |
The country code of the mobile phone number of the user. Valid values:
|
CN |
| UserId |
string |
The ID of the user. |
1 |
| Source |
string |
The source of the user. Valid values:
|
Local |
| UserName |
string |
The logon name of the user. |
abcabc_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 Bastionhost user. This parameter is returned when the user source is a RAM user (the value of Source is Ram). If the user source is a local user (the value of Source is 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 the next logon. Valid values:
|
true |
| TwoFactorMethods |
array |
The array of enabled two-factor authentication methods. |
|
|
string |
The array of enabled two-factor authentication methods. Currently, a maximum of one method is supported. Valid values:
|
[ "sms" ] |
|
| TwoFactorStatus |
string |
The two-factor authentication status of the user. Valid values:
|
Enable |
| LanguageStatus |
string |
The notification language setting. Valid values:
|
Custom |
| Language |
string |
The notification language. This parameter is required when LanguageStatus is set to Custom. Valid values:
|
en |
Examples
Success response
JSON format
{
"RequestId": "EC9BF0F4-8983-491A-BC8C-1B4DD94976DE",
"User": {
"DisplayName": "Bob",
"Comment": "commet",
"Email": "1099**@qq.com",
"Mobile": "1359999****",
"MobileCountryCode": "CN",
"UserId": "1",
"Source": "Local",
"UserName": "abcabc_def",
"SourceUserId": "122748924538****",
"UserState": [
"[\"Normal\"]"
],
"EffectiveStartTime": 1669630029,
"EffectiveEndTime": 1672502400,
"NeedResetPassword": true,
"TwoFactorMethods": [
"[\n \"sms\"\n]"
],
"TwoFactorStatus": "Enable",
"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. |
| 404 | UserNotFound | The user is not found. | The user is not found. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.