Queries the details of a specified host account.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes GetHostAccount

The operation that you want to perform.

Set the value to GetHostAccount.

InstanceId String Yes bastionhost-cn-st220aw****

The ID of the bastion host in which you want to query the details of the host account.

Note You can call the DescribeInstances operation to query the ID of the bastion host.
RegionId String No cn-hangzhou

The region ID of the bastion host in which you want to modify the information about the host account.

Note For more information about the mapping between region IDs and region names, see Regions and zones.
HostAccountId String Yes 1

The ID of the host account that you want to query.

Note You can call the ListHostAccounts operation to query the ID of the host account.

Response parameters

Parameter Type Example Description
RequestId String EC9BF0F4-8983-491A-BC8C-1B4DD94976DE

The ID of the request. The ID is a unique identifier of the request.

HostAccount Object

The details of the host account that were queried.

HasPassword Boolean true

Indicates whether a password is set for the host account. Valid values:

  • true: yes
  • false: no
PrivateKeyFingerprint String fe:ca:37:42:30:00:9d:95:e6:73:e5:b0:32:0a:**:**

The fingerprint of the private key.

ProtocolName String SSH

The protocol that is used by the host. Valid values:

  • SSH
  • RDP
HostAccountName String abc

The name of the host account.

HostAccountId String 1

The ID of the host account.

HostId String 1

The ID of the host to which the host account belongs.

HostShareKeyId String 1

The ID of the shared key.

HostShareKeyName String name

The name of the shared key.

Examples

Sample requests

http(s)://[Endpoint]/?Action=GetHostAccount
&HostAccountId=1
&InstanceId=bastionhost-cn-st220aw****
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<GetHostAccountResponse>
    <RequestId>EC9BF0F4-8983-491A-BC8C-1B4DD94976DE</RequestId>
    <HostAccount>
        <HostAccountName>abc</HostAccountName>
        <ProtocolName>SSH</ProtocolName>
        <PrivateKeyFingerprint>fe:ca:37:42:30:00:9d:95:e6:73:e5:b0:32:0a:**:**</PrivateKeyFingerprint>
        <HostId>1</HostId>
        <HasPassword>true</HasPassword>
        <HostAccountId>1</HostAccountId>
    </HostAccount>
</GetHostAccountResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "EC9BF0F4-8983-491A-BC8C-1B4DD94976DE",
  "HostAccount" : {
    "HostAccountName" : "abc",
    "ProtocolName" : "SSH",
    "PrivateKeyFingerprint" : "fe:ca:37:42:30:00:9d:95:e6:73:e5:b0:32:0a:**:**",
    "HostId" : "1",
    "HasPassword" : "true",
    "HostAccountId" : "1"
  }
}

Error codes

HTTP status code Error code Error message Description
400 InvalidParameter The argument is invalid. The error message returned because one or more parameters are invalid.
404 HostAccountNotFound The host account is not found. The error message returned because the host account does not exist.
500 InternalError An unknown error occurred. The error message returned because an unknown error has occurred.

For a list of error codes, visit the API Error Center.