All Products
Search
Document Center

Simple Log Service:list_machines

Last Updated:Oct 26, 2023

Queries the servers in a specified machine group.

Request syntax

aliyunlog log list_machines --project_name=<value> --group_name=<value> [--offset=<value>] [--size=<value>] [--access-id=<value>] [--access-key=<value>] [--sts-token=<value>] [--region-endpoint=<value>] [--client-name=<value>] [--jmes-filter=<value>] [--format-output=<value>] [--decode-output=<value>]

Request parameters

The following table describes the required and specific parameters of the list_machines command.
ParameterTypeRequiredExampleDescription
--project_nameStringYesaliyun-test-projectThe name of the project.
--group_nameStringYestest-groupThe name of the machine group.
--offsetIntegerNo0The start position of entries to return. Default value: 0.
--sizeIntegerNo5The maximum number of entries to return on each page. Maximum value: 500.
For information about the global parameters of the Log Service command-line interface (CLI), see Global parameters.

Examples

  • Sample requests
    Query the servers in the test-group machine group that belongs to the default account.
    aliyunlog log list_machines --project_name="aliyun-test-project" --group_name="test-group" --offset=0 --size=5
  • Sample responses
    {
      "count": 1,
      "machines": [
        {
          "ip": "203.0.113.10",
          "lastHeartbeatTime": 1622106889,
          "machine-uniqueid": "26964724-6767-443c-a5fc-5d7b8e4fd06c",
          "userdefined-id": ""
        }
      ],
      "total": 1
    }

Error codes

If an error message is returned, fix the error based on the error codes of the related API operation. For more information, see Error codes of ListMachines.

API reference

ListMachines