阅读1022 返回首页    go 微信


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_日志服务-阿里云