All Products
Search
Document Center

Bastionhost:GetUser

Last Updated:Jul 17, 2026

Retrieves the details of a specified Bastionhost user.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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

Email

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: the Chinese mainland (+86)

  • HK: Hong Kong (China) (+852)

  • MO: Macao (China) (+853)

  • TW: Taiwan (China) (+886)

  • RU: Russia (+7)

  • SG: Singapore (+65)

  • MY: Malaysia (+60)

  • ID: Indonesia (+62)

  • DE: Germany (+49)

  • AU: Australia (+61)

  • US: United States (+1)

  • AE: Dubai (+971)

  • JP: Japan (+81)

  • GB: United Kingdom (+44)

  • IN: India (+91)

  • KR: South Korea (+82)

  • PH: Philippines (+63)

  • CH: Switzerland (+41)

  • SE: Sweden (+46)

CN

UserId

string

The ID of the user.

1

Source

string

The source of the user. Valid values:

  • Local: a local user.

  • Ram: a Resource Access Management (RAM) user.

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: normal.

  • Frozen: locked.

  • Expired: expired.

  • RemoteDeleted: the user source has been deleted.

  • Inactive: inactive due to prolonged absence of logon.

  • PasswordExpired: the user password has expired.

  • RemoteDNChanged: the user DN has been updated.

  • RemoteFrozen: freeze on the RAM side. This status applies only to Resource Access Management (RAM) users.

["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: The password must be reset.

  • false: The password does not need to be reset.

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: text message.

  • email: email.

  • dingtalk: DingTalk.

  • totp OTP: token.

[ "sms" ]

TwoFactorStatus

string

The two-factor authentication status of the user. Valid values:

  • Global: follows the global settings.

  • Disable: two-factor authentication is disabled.

  • Enable: two-factor authentication is enabled and follows the individual user settings.

Enable

LanguageStatus

string

The notification language setting. Valid values:

  • Global: follows the global settings.

  • Custom: custom settings.

Custom

Language

string

The notification language. This parameter is required when LanguageStatus is set to Custom. Valid values:

  • zh-cn: Simplified Chinese.

  • en: English.

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.