Lists the machines in a machine group. The machines are connected to Log Service.

Description

The API operation lists only the machines that are normally connected to Log Service.

Request syntax

GET /machinegroups/{groupName}/machines HTTP/1.1
Authorization: <AuthorizationString> 
Date: <GMT Date>
Host: <Project Endpoint>
x-log-apiversion: 0.6.0
x-log-signaturemethod: hmac-sha1

Request parameters

  • Request headers

    The ListMachines operation does not have operation-specific request headers. For information about the common request headers of Log Service API operations, see Common request headers.

  • Parameters
    Parameter Type Required Example Description
    groupName string Yes test-machine-group-5 The name of the machine group.
    offset int No 0 The start position of entries to return. Default value: 0.
    size int No 3 The maximum number of entries to return on each page. Default value: 500.

Response parameters

  • Response headers

    The ListMachines API operation does not have operation-specific response headers. For information about the common response headers of Log Service API operations, see Common response headers.

  • Response elements
    Parameter Type Example Description
    count int 3 The number of machines that are returned on the current page.
    total int 8 The total number of machines.
    machines json array N/A The information list of the machines that are returned.
    The following table describes the parameters of the machines element.
    Parameter Type Example Description
    ip string 10.***. ***. *** The IP address of the machine.
    machine-uniqueid string N/A The universally unique identifier (UUID) of the machine.
    userdefined-id string N/A The user-defined identifier of the machine.

Examples

  • Sample requests
    GET /machinegroups/test-machine-group-5/machines? offset=0&size=3 HTTP/1.1
    Header :
    {
        "x-log-apiversion": "0.6.0",
        "Authorization": "LOG <yourAccessKeyId>:<yourSignature>",
        "Host": "ali-test-project.cn-hangzhou-devcommon-intranet.sls.aliyuncs.com",
        "Date": "Tue, 10 Nov 2015 19:04:57 GMT",
        "Content-Length": "0",
        "x-log-signaturemethod": "hmac-sha1",
        "User-Agent": "sls-java-sdk-v-0.6.0",
        "Content-Type": "application/x-protobuf",
        "x-log-bodyrawsize": "0"
    }
  • Sample success responses
    HTTP/1.1 200 OK
    Header :
    {
        "Date": "Tue, 10 Nov 2015 19:04:58 GMT",
        "Content-Length": "324",
        "x-log-requestid": "56423FD999248C827B000A57",
        "Connection": "close",
        "Content-Type": "application/json",
        "Server": "nginx/1.6.1"
    }
    Body :
    {
        "machines":     [
            {
                "ip": "10. ***. ***.***",
                "machine-uniqueid": "",
                "userdefined-id": "",
                "lastHeartbeatTime": 1447182247
            },
            {
                "ip": "10. ***. ***.***",
                "machine-uniqueid": "",
                "userdefined-id": "",
                "lastHeartbeatTime": 1447182246
            },
            {
                "ip": "10. ***. ***.***",
                "machine-uniqueid": "",
                "userdefined-id": "",
                "lastHeartbeatTime": 1447182248
            }
        ],
        "count": 3,
        "total": 8
    }

Error codes

HTTP status code Error code Error message Description
404 GroupNotExist group {GroupName} does not exist. The error message returned because the specified machine group does not exist.
500 InternalServerError internal server error. The error message returned because an internal server error has occurred.

For more information about the error codes, see Common error codes.