Queries a list of host accounts.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
yundun-bastionhost:ListHostAccounts |
list |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The ID of the Bastionhost instance. Note
You can call the DescribeInstances operation to obtain the instance ID. |
bastionhost-cn-st220aw**** |
| RegionId |
string |
No |
The region ID of the Bastionhost instance. Note
For more information about the mapping between region IDs and region names, see Regions and zones. |
cn-hangzhou |
| HostId |
string |
Yes |
The ID of the host for which you want to query host accounts. Note
You can call the ListHosts operation to obtain the host ID. |
1 |
| PageNumber |
string |
No |
The number of the page to return. Default value: 1. |
1 |
| PageSize |
string |
No |
The number of entries to return on each page.
Note
We recommend that you do not leave this parameter empty. |
20 |
| HostAccountName |
string |
No |
The name of the host account that you want to query. The name can be up to 128 characters in length. This parameter supports only term queries. |
abc |
| ProtocolName |
string |
No |
The protocol of the host account that you want to query.
|
SSH |
| HostIds |
string |
No |
The array of host IDs for which you want to query host accounts. Note
This parameter takes effect only when the value of the HostId parameter is 0. If the HostId parameter is specified with a non-zero value, this parameter is ignored. |
["2","3"] |
Response parameters
|
Parameter |
Type |
Description |
Example |
|
object |
|||
| TotalCount |
integer |
The total number of returned host accounts. |
1 |
| RequestId |
string |
The ID of the request. |
EC9BF0F4-8983-491A-BC8C-1B4DD94976DE |
| HostAccounts |
array<object> |
The list of the returned host accounts. |
|
|
object |
|||
| ProtocolName |
string |
The protocol of the host account.
|
SSH |
| PrivateKeyFingerprint |
string |
The fingerprint of the private key of the host account. |
fe:ca:37:42:30:00:9d:95:e6:73:e5:b0:32:0a:**:** |
| HostId |
string |
The ID of the host. |
1 |
| HostAccountId |
string |
The ID of the host account. |
1 |
| HostAccountName |
string |
The name of the host account. |
abc |
| RotationMode |
string |
The password change mode of the account.
Note
This parameter is available only for Bastionhost instances of V3.2.47 or later. |
Privileged |
| HostShareKeyName |
string |
The name of the shared key of the host. |
name |
| HasPassword |
boolean |
Indicates whether a password is set for the host account.
|
true |
| HostShareKeyId |
string |
The ID of the shared key of the host. |
1 |
| PrivilegeType |
string |
The permission type of the account.
Note
This parameter is available only for Bastionhost instances of V3.2.47 or later. |
Normal |
Examples
Success response
JSON format
{
"TotalCount": 1,
"RequestId": "EC9BF0F4-8983-491A-BC8C-1B4DD94976DE",
"HostAccounts": [
{
"ProtocolName": "SSH",
"PrivateKeyFingerprint": "fe:ca:37:42:30:00:9d:95:e6:73:e5:b0:32:0a:**:**",
"HostId": "1",
"HostAccountId": "1",
"HostAccountName": "abc",
"RotationMode": "Privileged",
"HostShareKeyName": "name",
"HasPassword": true,
"HostShareKeyId": "1",
"PrivilegeType": "Normal"
}
]
}
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.