查詢命令助手執行命令的列表和狀態。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
swas-open:DescribeCommandInvocations |
get |
*全部資源
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| RegionId |
string |
是 |
地區 ID。您可以調用 ListRegions 查詢可用地區。 |
cn-hangzhou |
| InstanceId |
string |
否 |
指定的Simple Application Server的執行個體 ID。 |
ace0706b2ac4454d984295a94213**** |
| CommandId |
string |
否 |
命令 ID。您可以通過介面 DescribeCommands 查詢所有可用的 CommandId。 |
c-sh02yh0932w**** |
| InvokeId |
string |
否 |
命令執行 ID。 |
t-hz02p9545t6**** |
| CommandName |
string |
否 |
命令名稱。如果同時設定了 InstanceId 參數,則該參數不生效。 |
testName |
| InvocationStatus |
string |
否 |
命令執行的總執行狀態,總執行狀態取決於本次調用的全部執行個體的共同執行狀態,可能值:
說明
返回參數中的 |
Success |
| CommandType |
string |
否 |
命令類型。可能值:
|
RunPowerShellScript |
| PageNumber |
string |
否 |
當前頁碼。起始值:1。預設值:1。 |
1 |
| PageSize |
string |
否 |
分頁查詢時設定的每頁行數。 最大值:50。 預設值:10。 |
10 |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
Schema of Response |
||
| RequestId |
string |
請求 ID。 |
30637AD6-D977-4833-A54C-CC89483E**** |
| TotalCount |
integer |
總條數。 |
10 |
| PageNumber |
integer |
查詢結果的頁碼。 |
1 |
| PageSize |
integer |
分頁查詢時設定的每頁行數。 |
10 |
| CommandInvocations |
array<object> |
命令執行列表。 |
|
|
array<object> |
命令執行資訊結構體。 |
||
| InvokeId |
string |
命令執行 ID。 |
t-hz0373jyzxt**** |
| CreationTime |
string |
命令建立時間。 |
2023-04-27T10:11:58 |
| CommandId |
string |
命令 ID。 |
c-hy0338xh28r**** |
| InvocationStatus |
string |
命令執行的狀態。可能值:
|
Success |
| CommandName |
string |
命令名稱。 |
testCommandName |
| CommandType |
string |
命令類型。 |
RunShellScript |
| CommandDescription |
string |
命令描述。 |
testDescription |
| Username |
string |
執行命令的使用者名稱稱。 |
root |
| WorkingDir |
string |
命令執行的路徑。 |
c:\wwwroot |
| Timeout |
integer |
逾時時間,單位為秒(s)。 |
60 |
| CommandContent |
string |
命令內容。 |
echo 123 |
| Parameters |
string |
命令中包含自訂參數。如果沒有參數,預設為{}. |
{} |
| InvokeInstances |
array<object> |
執行目標執行個體列表。 |
|
|
object |
執行目標執行個體資訊結構體。 |
||
| InstanceId |
string |
Simple Application Server的執行個體 ID。 |
2445f4aecdac4b71ba2c7e3a7ccf**** |
| StartTime |
string |
命令在執行個體中開始執行的時間。 |
2023-05-09T03:32:24Z |
| FinishTime |
string |
命令進程的結束時間。 |
2023-04-03T02:42:29Z |
| InvocationStatus |
string |
單台執行個體的命令進度狀態,可能值:
|
Running |
| Output |
string |
命令執行後的輸出資訊。 |
OutputMsg |
| ExitCode |
integer |
命令的退出碼。
|
0 |
| ErrorInfo |
string |
命令的下發失敗或執行失敗原因的詳情,可能值:
|
the specified instance does not exists |
| ErrorCode |
string |
命令的下發失敗或執行失敗原因的代碼,可能值:
|
InstanceNotExists |
樣本
正常返回樣本
JSON格式
{
"RequestId": "30637AD6-D977-4833-A54C-CC89483E****",
"TotalCount": 10,
"PageNumber": 1,
"PageSize": 10,
"CommandInvocations": [
{
"InvokeId": "t-hz0373jyzxt****",
"CreationTime": "2023-04-27T10:11:58",
"CommandId": "c-hy0338xh28r****",
"InvocationStatus": "Success",
"CommandName": "testCommandName",
"CommandType": "RunShellScript",
"CommandDescription": "testDescription",
"Username": "root",
"WorkingDir": "c:\\wwwroot",
"Timeout": 60,
"CommandContent": "echo 123",
"Parameters": "{}",
"InvokeInstances": [
{
"InstanceId": "2445f4aecdac4b71ba2c7e3a7ccf****",
"StartTime": "2023-05-09T03:32:24Z",
"FinishTime": "2023-04-03T02:42:29Z",
"InvocationStatus": "Running",
"Output": "OutputMsg",
"ExitCode": 0,
"ErrorInfo": "the specified instance does not exists",
"ErrorCode": "InstanceNotExists"
}
]
}
]
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。