在指定的執行個體上安裝 Agent。
介面說明
呼叫本介面安裝 Agent 是非同步的,呼叫介面後會傳回一個 task_id,可以憑藉該 ID 呼叫 GetAgentTask 介面取得任務的執行情況。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
sysom:InstallAgent |
none |
*全部資源。
|
無 | 無 |
請求文法
POST /api/v1/am/agent/install_agent HTTP/1.1
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| body |
object |
否 |
請求 Body。 |
|
| agent_id |
string |
是 |
要安裝的元件 ID。 |
74a86327-3170-412c-8e67-da3389ec56a9 |
| agent_version |
string |
是 |
要安裝的元件版本。 |
3.4.0-1 |
| install_type |
string |
是 |
安裝類型:
|
InstallAndUpgrade |
| instances |
array<object> |
是 |
需要安裝元件的執行個體清單。 |
|
|
object |
是 |
執行個體資訊。 |
||
| instance |
string |
是 |
執行個體 ID。 |
i-wz9b9vucz1iubsz8sjqo |
| region |
string |
是 |
地域 ID。 |
cn-hangzhou |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
Schema of Response |
||
| RequestId |
string |
請求 ID,可用於全鏈路診斷。 |
1D8887FC-4BDB-5A1C-AB19-135C29A9E481 |
| code |
string |
狀態碼
|
Success |
| data |
object |
傳回資料。 |
|
| task_id |
string |
任務 ID。 可以憑藉本任務 ID 呼叫 GetAgentTask 介面檢視任務的執行情況。 |
26b3cd97389c43dcad6bc4901c36fcec |
| message |
string |
錯誤資訊
|
"" |
樣本
正常返回樣本
JSON格式
{
"RequestId": "1D8887FC-4BDB-5A1C-AB19-135C29A9E481",
"code": "Success",
"data": {
"task_id": "26b3cd97389c43dcad6bc4901c36fcec"
},
"message": "\"\""
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | SysomOpenAPI.AgentNotExists | Agent not exists. | |
| 400 | SysomOpenAPI.AgentTaskNotFound | Agent task not found. | |
| 400 | SysomOpenAPI.AgentVersionNotExists | Agent version not exists. | |
| 400 | SysomOpenAPI.InstanceNotExists | Instance not exists. | |
| 400 | SysomOpenAPI.InvalidParameter | Invalid parameters passed when calling the interface. | |
| 400 | SysomOpenAPI.MissingParameter | Missing parameters. | |
| 400 | SysomOpenAPI.NoAgentInstalled | No SysOM Agent version available. | |
| 400 | SysomOpenAPI.NotAuthorizedInstance | Instance not authorized. | |
| 400 | SysomOpenAPI.NotOwnInstance | Not own current instance. | |
| 400 | SysomOpenAPI.NotOwnTask | Diagnosis result does not belong to the current account. | |
| 400 | SysomOpenAPI.NotSupportedAgentVersion | Unsupported sysom agent version. | |
| 400 | SysomOpenAPI.ServerError | Server error, please correct the code according to the error message. | |
| 400 | SysomOpenAPI.ServiceRoleNotExists | Service role does not exist, please init the sysom service first. | |
| 400 | SysomOpenAPI.RegionNotSupport | Region not supported. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。