All Products
Search
Document Center

Bastionhost:ListHosts

Last Updated:Apr 18, 2024

Queries the hosts in a bastion host.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
yundun-bastionhost:ListHostsList
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the bastion host on which you want to query hosts.

Note You can call the DescribeInstances operation to query the ID of the bastion host.
bastionhost-cn-st220aw****
RegionIdstringNo

The region ID of the bastion host on which you want to query hosts.

Note For more information about the mapping between region IDs and region names, see Regions and zones.
cn-hangzhou
PageNumberstringNo

The number of the page to return. Default value: 1.

1
PageSizestringNo

The number of entries to return on each page. Default value: 10.

Note We recommend that you do not leave this parameter empty.
20
OSTypestringNo

The operating system of the host that you want to query. Valid values:

  • Linux
  • Windows
Linux
HostNamestringNo

The name of the host that you want to query. Only exact match is supported.

host
HostAddressstringNo

The address of the host that you want to query. You can set this parameter to a domain name or an IP address. Only exact match is supported.

1.1.XX.XX
SourcestringNo

The source of the host that you want to query. Valid values:

  • Local: a host in a data center
  • Ecs: an Elastic Compute Service (ECS) instance
  • Rds: a host in an ApsaraDB MyBase dedicated cluster
Local
SourceInstanceIdstringNo

The ID of the ECS instance or the host in an ApsaraDB MyBase dedicated cluster that you want to query. Only exact match is supported.

i-bp19ienyt0yax748****
SourceInstanceStatestringNo

The status of the host that you want to query. Valid values:

  • Normal: normal
  • Release: released
Normal
HostGroupIdstringNo

The ID of the host group to which the host to be queried belongs.

Note You can call the ListHostGroups operation to query the ID of the host group.
1

Response parameters

ParameterTypeDescriptionExample
object
TotalCountinteger

The total number of hosts returned.

1
RequestIdstring

The ID of the request, which is used to locate and troubleshoot issues.

EC9BF0F4-8983-491A-BC8C-1B4DD94976DE
Hostsobject []

An array that consists of the hosts returned.

Commentstring

The description of the host.

host
ActiveAddressTypestring

The address type of the host. Valid values:

  • Public: a public address
  • Private: a private address
Public
HostPublicAddressstring

The public address of the host. The value is a domain name or an IP address.

1.1.XX.XX
HostNamestring

The name of the host.

name
HostAccountCountinteger

The number of host accounts.

1
Sourcestring

The source of the host. Valid values:

  • Local: a host in a data center
  • Ecs: an ECS instance
  • Rds: a host in an ApsaraDB MyBase dedicated cluster
Local
HostPrivateAddressstring

The private address of the host. The value is a domain name or an IP address.

192.168.XX.XX
OSTypestring

The operating system of the host. Valid values:

  • Linux
  • Windows
Linux
HostIdstring

The ID of the host.

1
SourceInstanceStatestring

The status of the host. Valid values:

  • Normal: normal
  • Release: released
Normal
SourceInstanceIdstring

The ID of the ECS instance or the host in an ApsaraDB MyBase dedicated cluster.

Note No value is returned for this parameter if the Source parameter is set to Local.
i-bp19ienyt0yax748****

Examples

Sample success responses

JSONformat

{
  "TotalCount": 1,
  "RequestId": "EC9BF0F4-8983-491A-BC8C-1B4DD94976DE",
  "Hosts": [
    {
      "Comment": "host",
      "ActiveAddressType": "Public",
      "HostPublicAddress": "1.1.XX.XX",
      "HostName": "name",
      "HostAccountCount": 1,
      "Source": "Local",
      "HostPrivateAddress": "192.168.XX.XX",
      "OSType": "Linux",
      "HostId": "1",
      "SourceInstanceState": "Normal",
      "SourceInstanceId": "i-bp19ienyt0yax748****"
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameterThe argument is invalid.The argument is invalid.
500InternalErrorAn unknown error occurred.An unknown error occurred.

For a list of error codes, visit the Service error codes.