Retrieves the list of the machines to which a Logtail configuration file is applied.

Request syntax

GET /configs/{configName}/machinegroups 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 GetAppliedMachineGroups 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
    ConfigName string Yes logtail-config-sample The name of the Logtail configuration file.

Response parameters

  • Response headers

    The GetAppliedMachineGroups 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
    If the request succeeds, the response body contains the list of all machines in the specified machine group. The following table describes the parameters of the response body.
    Parameter Type Example Description
    count Integer 1 The number of the machine groups that are returned.
    machinegroups String array sample-group The name list of the machine groups that are returned.

Examples

  • Sample requests
    GET /configs/logtail-config-sample/machinegroups
    Header:
    {
        "Content-Length": 0, 
        "x-log-signaturemethod": "hmac-sha1", 
        "x-log-bodyrawsize": 0, 
        "User-Agent": "log-python-sdk-v-0.6.0", 
        "Host": "ali-test-project.cn-hangzhou-devcommon-intranet.sls.aliyuncs.com", 
        "Date": "Mon, 09 Nov 2015 09:51:38 GMT", 
        "x-log-apiversion": "0.6.0", 
        "Authorization": "LOG <yourAccessKeyId>:<yourSignature>"
    }
  • Sample responses
    Header : 
    {
        "content-length": "44", 
        "server": "nginx/1.6.1", 
        "connection": "close", 
        "date": "Mon, 09 Nov 2015 09:51:38 GMT", 
        "content-type": "application/json", 
        "x-log-requestid": "56406CAA99248CAA230BE828"
    }
    Body:
    {
        "count": 1, 
        "machinegroups": 
        [
            "sample-group"
        ]
    }

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.