阅读554 返回首页    go 微软 go windows


GetMachineGroup__Logtail机器组相关接口_API-Reference_日志服务-阿里云

查看具体MachineGroup信息

示例:

GET /machinegroups/{groupName}

GET /machinegroups/{groupName} HTTP/1.1
Authorization: <AuthorizationString> 
Date: <GMT Date>
Host: <Project Endpoint>
x-log-apiversion: 0.6.0
x-log-signaturemethod: hmac-sha1

请求参数

URL参数:

参数名称 类型 是否必须 描述
groupName string 机器分组名称

请求头

无特有请求头,关于Log Service API的公共请求头请参考公共请求头

响应头

无特有响应头,关于Log Service API的公共响应头请参考公共响应头

响应元素

属性名称 类型 描述
groupName string 机器分组名称,Project下唯一
groupType string 分组类型(空或者Armory),默认为空
machineIdentifyType string 机器标识类型,分为ip和userdefined两种
groupAttribute json object 机器分组的属性,默认为空
machineList json array 具体的机器标识,可以是ip或userdefined-id
createTime int 机器分组创建时间
lastModifyTime int 机器分组最近更新时间

groupAttribute说明如下:

属性名称 类型 是否必须 描述
groupTopic string 机器分组的topic,一般不设置
externalName string 机器分组所依赖的外部管理系统(Armory)标识
{
    "groupName": "test-machine-group",
    "groupType": "",
    "groupAttribute":     {
        "externalName": "testgroup",
        "groupTopic": "testtopic"
    },
    "machineIdentifyType": "ip",
    "machineList":     [
        "127.0.0.1",
        "127.0.0.2"
    ],
    "createTime": 1447178253,
    "lastModifyTime": 1447178253
}

错误码

除了返回Log Service API的通用错误码,还可能返回如下特有错误码:

HTTP状态码 ErrorCode ErrorMessage
404 GroupNotExist group {GroupName} not exist
500 InternalServerError internal server error

细节描述

示例

请求示例:
GET /machinegroups/test-machine-group HTTP/1.1
Header :
{
    "x-log-apiversion": "0.6.0",
    "Authorization": "LOG 94to3z418yupi6ikawqqd370:CNQaXNeExV6S/nQZkP/R+baZPZc=",
    "Host": "ali-test-project.cn-hangzhou-devcommon-intranet.sls.aliyuncs.com",
    "Date": "Tue, 10 Nov 2015 18:15:24 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:15:23 GMT",
    "Content-Length": "239",
    "x-log-requestid": "5642343B99248CB36D0060B8",
    "Connection": "close",
    "Content-Type": "application/json",
    "Server": "nginx/1.6.1"
}
Body :
{
    "groupName": "test-machine-group",
    "groupType": "",
    "groupAttribute":     {
        "externalName": "testgroup",
        "groupTopic": "testtopic"
    },
    "machineIdentifyType": "ip",
    "machineList":     [
        "127.0.0.1",
        "127.0.0.2"
    ],
    "createTime": 1447178253,
    "lastModifyTime": 1447178253
}

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

  上一篇:go ListMachineGroup__Logtail机器组相关接口_API-Reference_日志服务-阿里云
  下一篇:go ApplyConfigToMachineGroup__Logtail机器组相关接口_API-Reference_日志服务-阿里云