閱讀320 返回首頁    go iPhone_iPad_Mac_手機_平板_蘋果apple


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_日誌服務-阿裏雲