ListMachineGroup

Last Updated: Mar 31, 2017

Example:

GET /machinegroups?offset=1&size=100

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

Request parameters

URL parameters:

Name Type Required or Not Description
offset int No Start position of the returned results. The default value is 0.
size int No Maximum number of entries returned per page. The default value is 500 (maximum).
groupName string No Group machine name used for filtering (partial matching supported)

Request header

No special request header is available. For details about the public request header of the log service API, refer to Public Request Header.

Response header

No special response header is available. For details about the public response header of the log service API, refer to Public Response Header.

Response element

When the request is successful, the response Body contains a list of all machine groups in the specified project. The specific format is as follows:

Name Type Description
count int The number of returned machine groups
total int Total number of returned machine groups
machinegroups json array List of returned machine groups
  1. {
  2. "machinegroups": [
  3. "test-machine-group",
  4. "test-machine-group-2"
  5. ],
  6. "count": 2,
  7. "total": 2
  8. }

Error code

I addition to general error codes of the log service API, the following special error codes may be returned:

HTTP status code Error code Error message
500 InternalServerError internal server error

Detailed description

None

Example

Request example:
  1. GET /machinegroups?groupName=test-machine-group&offset=0&size=3 HTTP/1.1
  2. Header :
  3. {
  4. "x-log-apiversion": "0.6.0",
  5. "Authorization": "LOG 94to3z418yupi6ikawqqd370:XN5helROz9QYV0FKhElSNuTBysA=",
  6. "Host": "ali-test-project.cn-hangzhou-devcommon-intranet.sls.aliyuncs.com",
  7. "Date": "Tue, 10 Nov 2015 18:34:44 GMT",
  8. "Content-Length": "0",
  9. "x-log-signaturemethod": "hmac-sha1",
  10. "User-Agent": "sls-java-sdk-v-0.6.0",
  11. "Content-Type": "application/x-protobuf",
  12. "x-log-bodyrawsize": "0"
  13. }
Response example:
  1. HTTP/1.1 200 OK
  2. Header :
  3. {
  4. "Date": "Tue, 10 Nov 2015 18:34:44 GMT",
  5. "Content-Length": "83",
  6. "x-log-requestid": "564238C499248C8F7B0001DE",
  7. "Connection": "close",
  8. "Content-Type": "application/json",
  9. "Server": "nginx/1.6.1"
  10. }
  11. Body :
  12. {
  13. "machinegroups": [
  14. "test-machine-group",
  15. "test-machine-group-2"
  16. ],
  17. "count": 2,
  18. "total": 2
  19. }
Thank you! We've received your feedback.