閱讀1022 返回首頁    go windows


ListMachineGroup__Logtail機器組相關接口_API-Reference_日誌服務-阿裏雲

示例:

GET /machinegroups?offset=1&size=100

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

請求參數

URL參數:

參數名稱 類型 是否必須 描述
offset int 返回記錄的起始位置,默認為0
size int 每頁返回最大條目,默認500(最大值)
groupName string 用於過濾的機器組名稱(支持部分匹配)

請求頭

無特有請求頭,關於Log Service API的公共請求頭請參考公共請求頭

響應頭

無特有響應頭,關於Log Service API的公共響應頭請參考公共響應頭

響應元素

請求成功,其響應Body會包括指定Project下的所有MachineGroup名稱列表,具體格式如下:

名稱 類型 描述
count int 返回的machinegroup數目
total int 返回machineGroup總數
machinegroups json array 返回的machinegroup名稱列表
{
    "machinegroups":     [
        "test-machine-group",
        "test-machine-group-2"
    ],
    "count": 2,
    "total": 2
}

錯誤碼

除了返回Log Service API的通用錯誤碼,還可能返回如下特有錯誤碼:

HTTP狀態碼 ErrorCode ErrorMessage
500 InternalServerError internal server error

細節描述

示例

請求示例:
GET /machinegroups?groupName=test-machine-group&offset=0&size=3 HTTP/1.1
Header :
{
    "x-log-apiversion": "0.6.0",
    "Authorization": "LOG 94to3z418yupi6ikawqqd370:XN5helROz9QYV0FKhElSNuTBysA=",
    "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"
}
響應示例:
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
}

最後更新:2016-11-23 16:04:02

  上一篇:go UpdateMachineGroup__Logtail機器組相關接口_API-Reference_日誌服務-阿裏雲
  下一篇:go GetMachineGroup__Logtail機器組相關接口_API-Reference_日誌服務-阿裏雲