在指定的執行個體上安裝 Agent。
介面說明
呼叫本介面安裝 Agent 是非同步的,呼叫介面後會回傳一個 task_id,可以憑藉該 ID 呼叫 GetAgentTask 介面取得任務的執行情況。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
sysom:InstallAgentWithType |
create |
*全部資源。
|
無 | 無 |
請求文法
POST /api/v1/am/agent/installAgent HTTP/1.1
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| body |
object |
否 |
請求 Body。 |
|
| Tag |
array<object> |
否 |
||
|
object |
否 |
|||
| Key |
string |
否 |
||
| Value |
string |
否 |
||
| agentId |
string |
是 |
要安裝的元件 ID。 |
74a86327-3170-412c-8e67-da3389ec56a9 |
| agentVersion |
string |
是 |
要安裝的元件版本。 |
3.4.0-1 |
| configId |
string |
否 |
要安裝的元件設定 ID。 |
f0078fbb-4213-11f0-a19b-00163e4ae208 |
| instanceType |
string |
是 |
執行個體類型。 |
ecs |
| instances |
array<object> |
是 |
需要安裝元件的執行個體清單。 |
|
|
object |
是 |
執行個體資訊。 |
||
| instance |
string |
是 |
執行個體 ID。 |
i-wz9b9vucz1iubsz8sjqo |
| region |
string |
是 |
區域 ID。 |
cn-hangzhou |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
Schema of Response |
||
| code |
string |
狀態碼
|
Success |
| data |
object |
回傳資料。 |
|
| taskId |
string |
任務 ID。 可以憑藉本任務 ID 呼叫 GetAgentTask 介面檢視任務的執行情況。 |
26b3cd97389c43dcad6bc4901c36fcec |
| message |
string |
Id of the request |
"" |
| requestId |
string |
請求 ID,可用於全鏈路診斷。 |
1D8887FC-4BDB-5A1C-AB19-135C29A9E481 |
樣本
正常返回樣本
JSON格式
{
"code": "Success",
"data": {
"taskId": "26b3cd97389c43dcad6bc4901c36fcec"
},
"message": "\"\"",
"requestId": "1D8887FC-4BDB-5A1C-AB19-135C29A9E481\n"
}
錯誤碼
|
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. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。