Lists machine groups.

Request syntax

GET /machinegroups? offset=1&size=100 HTTP/1.1
Authorization: <AuthorizationString> 
Date: <GMT Date>
Host: <Project Endpoint>
x-log-apiversion: 0.6.0
x-log-signaturemethod: hmac-sha1

Request elements

  • Request headers

    The UpdateMachineGroup API 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
    offset int No 1 The start line number of entries to return. Default value: 0.
    size int No 3 The maximum number of entries to return on each page. Default and maximum value: 500.
    groupName string No test-machine-group The machine group name that is used as a filtering condition. Fuzzy match is supported.
Request headers response headers response parameters

If a request is successful, the response body contains the list of all machine groups in the specified project. The following example is a sample response body:

{
    "machinegroups":     [
        "test-machine-group",
        "test-machine-group-2"
    ],
    "count": 2,
    "total": 2
}

Response parameters

  • Response headers

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

  • Response parameters
    The HTTP status code 200 indicates that the request is successful. The response body contains a list of all names of the machine groups in the specified project. The following table lists the parameters in the response body.
    Parameter Type Example Description
    count int 2 The number of returned machine groups.
    total int 2 The total number of returned machine groups.
    machinegroups json array test-machine-group, test-machine-group-2 The name list of returned machine groups.

Examples

  • Sample requests
    GET /machinegroups? groupName=test-machine-group&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 18:34:44 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 18:34:44 GMT",
        "Content-Length": "83",
        "x-log-requestid": "564238C499248C8F7B0001DE",
        "Connection": "close",
        "Content-Type": "application/json",
        "Server": "nginx/1.6.1"
    }
    Body :
    {
        "machinegroups":     [
            "test-machine-group",
            "test-machine-group-2"
        ],
        "count": 2,
        "total": 2
    }

Error codes

HTTP status code Error code Error message Description
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.