223
阿里云
ListMachines__Logtail机器组相关接口_API-Reference_日志服务-阿里云
获得MachineGroup下属于用户并与Server端连接机器状态信息
GET /machinegroups/{groupName}/machines?offset=1&size=10
GET /machinegroups/{groupName}/machines 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 | 是 | 机器分组名称 |
offset | int | 否 | 返回记录的起始位置,默认为0 |
size | int | 否 | 每页返回最大条目,默认500(最大值) |
请求头
无特有请求头,关于Log Service API的公共请求头请参考公共请求头。
响应头
无特有响应头,关于Log Service API的公共响应头请参考公共响应头。
响应元素
名称 | 类型 | 描述 |
---|---|---|
count | int | 返回的machine数目 |
total | int | machine总数 |
machines | json array | 返回的machine名称列表 |
machines说明如下:
名称 | 类型 | 描述 |
---|---|---|
ip | string | 机器ip |
machine-uniqueid | string | 机器DMI UUID |
userdefined-id | string | 机器的用户自定义标示 |
{
"count":10,
"total":100,
"machines":
[{
"ip" : "testip1",
"machine-uniqueid" : "testuuid1",
"userdefined-id" : "testuserdefinedid1",
"lastHeartbeatTime" : 1447182247
},
{
"ip" : "testip1",
"machine-uniqueid" : "testuuid2",
"userdefined-id" : "testuserdefinedid2",
"lastHeartbeatTime" : 1447182247
},
{
"ip" : "testip2",
"machine-uniqueid" : "testuuid",
"userdefined-id" : "testuserdefinedid"
"lastHeartbeatTime" : 1447182247
}]
}
错误码
除了返回Log Service API的通用错误码,还可能返回如下特有错误码:
HTTP状态码 | ErrorCode | ErrorMessage |
---|---|---|
404 | GroupNotExist | group {GroupName} not exist |
500 | InternalServerError | internal server error |
细节描述
该接口只获取与Server端连接正常的机器列表。
示例
请求示例:
GET /machinegroups/test-machine-group-5/machines?offset=0&size=3 HTTP/1.1
Header :
{
"x-log-apiversion": "0.6.0",
"Authorization": "LOG 94to3z418yupi6ikawqqd370:9yoK0iJPxr0RrWf/wW9NJYXu4zo=",
"Host": "ali-test-project.cn-hangzhou-devcommon-intranet.sls.aliyuncs.com",
"Date": "Tue, 10 Nov 2015 19:04:57 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 19:04:58 GMT",
"Content-Length": "324",
"x-log-requestid": "56423FD999248C827B000A57",
"Connection": "close",
"Content-Type": "application/json",
"Server": "nginx/1.6.1"
}
Body :
{
"machines": [
{
"ip": "10.101.166.116",
"machine-uniqueid": "",
"userdefined-id": "",
"lastHeartbeatTime": 1447182247
},
{
"ip": "10.101.165.193",
"machine-uniqueid": "",
"userdefined-id": "",
"lastHeartbeatTime": 1447182246
},
{
"ip": "10.101.166.91",
"machine-uniqueid": "",
"userdefined-id": "",
"lastHeartbeatTime": 1447182248
}
],
"count": 3,
"total": 8
}
最后更新:2016-11-23 16:04:03
上一篇:
RemoveConfigFromMachineGroup__Logtail机器组相关接口_API-Reference_日志服务-阿里云
下一篇:
GetAppliedConfigs__Logtail机器组相关接口_API-Reference_日志服务-阿里云
定时运行作业__快速开始_数据集成-阿里云
网络类型说明与使用场景__常见问题_专有网络 VPC-阿里云
资源__基本概念_基本介绍_大数据计算服务-阿里云
MQTT 数据查询__MQTT 接入(物联)_消息队列 MQ-阿里云
创建 Job__SchedulerX for EDAS_二方服务_企业级分布式应用服务 EDAS-阿里云
文字水印__图片水印_老版图片服务手册_对象存储 OSS-阿里云
用户及权限管理__数据库管理语言_SQL语法参考_云数据库 OceanBase-阿里云
转换付费模式__购买指南_云数据库 MongoDB 版-阿里云
应用容量__应用基本配置_产品使用手册_开放搜索-阿里云
日志查询工具__开发者工具_消息服务-阿里云
相关内容
常见错误说明__附录_大数据计算服务-阿里云
发送短信接口__API使用手册_短信服务-阿里云
接口文档__Android_安全组件教程_移动安全-阿里云
运营商错误码(联通)__常见问题_短信服务-阿里云
设置短信模板__使用手册_短信服务-阿里云
OSS 权限问题及排查__常见错误及排除_最佳实践_对象存储 OSS-阿里云
消息通知__操作指南_批量计算-阿里云
设备端快速接入(MQTT)__快速开始_阿里云物联网套件-阿里云
查询API调用流量数据__API管理相关接口_API_API 网关-阿里云
使用STS访问__JavaScript-SDK_SDK 参考_对象存储 OSS-阿里云