阅读320 返回首页    go 阿里云 go 技术社区[云栖]


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

更新机器组信息,如果机器组已应用配置,则新加入、减少机器会自动增加、移除配置。

示例:

PUT /machinegroups/{groupName}

  1. PUT /machinegroups/{groupName} HTTP/1.1
  2. Authorization: <AuthorizationString>
  3. Content-Type:application/json
  4. Content-Length:<Content Length>
  5. Content-MD5<:<Content MD5>
  6. Date: <GMT Date>
  7. Host: <Project Endpoint>
  8. x-log-apiversion: 0.6.0
  9. x-log-signaturemethod: hmac-sha1
  10. {
  11. "groupName": "test-machine-group",
  12. "groupType" : "",
  13. "groupAttribute" : {
  14. "externalName" : "testgroup",
  15. "groupTopic": "testgrouptopic"
  16. },
  17. "machineIdentifyType" : "ip",
  18. "machineList" : [
  19. "test-ip1",
  20. "test-ip2"
  21. ]
  22. }

请求参数

URL参数:

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

Body参数:

属性名称 类型 是否必须 描述
groupName string 机器分组名称,Project下唯一
groupType string 机器分组类型,默认为空
machineIdentifyType string 机器标识类型,分为ip和userdefined两种
groupAttribute object 机器分组的属性,默认为空
machineList array 具体的机器标识,可以是ip或userdefined-id

groupAttribute说明如下:

属性名称 类型 是否必须 描述
groupTopic string 机器分组的topic,默认为空
externalName string 机器分组所依赖的外部管理标识,默认为空

请求头

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

响应头

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

响应元素

HTTP状态码返回200

错误码

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

HTTP状态码 ErrorCode ErrorMessage
404 GroupNotExist group {GroupName} not exist
400 InvalidParameter invalid group resource json
500 InternalServerError internal server error

细节描述

示例

请求示例:
  1. PUT /machinegroups/test-machine-group HTTP/1.1
  2. Header :
  3. {
  4. "x-log-apiversion": "0.6.0",
  5. "Authorization": "LOG 94to3z418yupi6ikawqqd370:ZJmBDS+LjRCzgSLuo21vFh6o7CE=",
  6. "Host": "ali-test-project.cn-hangzhou-devcommon-intranet.sls.aliyuncs.com",
  7. "Date": "Tue, 10 Nov 2015 18:41:43 GMT",
  8. "Content-Length": "194",
  9. "x-log-signaturemethod": "hmac-sha1",
  10. "Content-MD5": "2CEBAEBE53C078891527CB70A855BAF4",
  11. "User-Agent": "sls-java-sdk-v-0.6.0",
  12. "Content-Type": "application/json",
  13. "x-log-bodyrawsize": "0"
  14. }
  15. Body :
  16. {
  17. "groupName": "test-machine-group",
  18. "groupType": "",
  19. "machineIdentifyType": "userdefined",
  20. "groupAttribute": {
  21. "groupTopic": "testtopic2",
  22. "externalName": "testgroup2"
  23. },
  24. "machineList": [
  25. "uu_id_1",
  26. "uu_id_2"
  27. ]
  28. }
响应示例:
  1. HTTP/1.1 200 OK
  2. Header :
  3. {
  4. "Date": "Tue, 10 Nov 2015 18:41:43 GMT",
  5. "Content-Length": "0",
  6. "x-log-requestid": "56423A6799248CA57B00035C",
  7. "Connection": "close",
  8. "Server": "nginx/1.6.1"
  9. }

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

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