全部產品
Search
文件中心

Simple Application Server:DescribeInvocationResult - 查詢單個命令的執行結果

更新時間:Dec 21, 2025

查詢單個命令的執行結果。

介面說明

  • 當您執行命令後,不代表命令一定成功執行,並且一定有預期的命令效果。您需要通過本介面查看實際的具體執行結果,以實際輸出結果為準。

  • 您可以查詢最近 2 周的執行資訊,執行資訊的保留上限為 10 萬條。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

swas-open:DescribeInvocationResult

get

*Instance

acs:swas-open:{#regionId}:{#accountId}:command/{#InstanceId}

請求參數

名稱

類型

必填

描述

樣本值

InstanceId

string

Simple Application Server執行個體 ID。

ace0706b2ac4454d984295a94213****

InvokeId

string

命令執行 ID。您可以通過介面 DescribeInvocations 查詢 InvokeId。

t-bj02prjhw1n****

RegionId

string

地區 ID。您可以調用 DescribeRegions 查看最新的阿里雲地區列表。

cn-hangzhou

返回參數

名稱

類型

描述

樣本值

object

Schema of Response

RequestId

string

請求 ID。

20758A-585D-4A41-A9B2-28DA8F4F****

InvocationResult

object

命令執行結果資訊。

StartTime

string

命令在執行個體中開始執行的時間。

2022-07-11T06:37:16Z

FinishedTime

string

命令在執行個體中執行完成時間。

2022-07-11T06:37:17Z

InvocationStatus

string

執行個體的命令進度狀態,可能值:

  • Pending:系統正在校正或發送命令。

  • Invalid:指定命令類型或參數有誤。

  • Aborted:向執行個體發送命令失敗。執行個體必須在運行中,且命令可以 1 分鐘內發送完成。

  • Running:命令正在執行個體上執行。

  • Success:命令執行完成,且退出碼為 0。

  • Failed:命令執行完成,且退出碼非 0。

  • Error:命令執行時發生異常無法繼續。

  • Timeout:命令執行逾時。

  • Cancelled:命令的執行動作已經取消,命令未曾啟動。

  • Stopping:正在停止執行的命令。

  • Terminated:命令執行時被終止。

Success

ExitCode

integer

命令的退出碼。

  • Linux 執行個體為 Shell 命令的退出碼。

  • Windows 執行個體為 Bat 或者 PowerShell 命令的退出碼。

0

ErrorInfo

string

命令的下發失敗或執行失敗原因的詳情,可能值:

  • 空:命令執行正常。

  • the specified instance does not exists:指定的執行個體不存在或已釋放。

  • the instance has released when create task:執行命令期間,該執行個體被釋放。

  • the instance is not running when create task:命令執行時,該執行個體不在運行中。

  • the command is not applicable:命令不適用於指定的執行個體。

  • the specified account does not exists:指定的帳號不存在。

  • the specified directory does not exists:指定的目錄不存在。

  • the cron job expression is invalid:指定的周期運算式不合法。

  • the aliyun service is not running on the instance:雲助手用戶端未運行。

  • the aliyun service in the instance does not response:雲助手用戶端無響應。

  • the aliyun service in the instance is upgrading now:雲助手用戶端正在升級中。

  • the aliyun service in the instance need upgrade:雲助手用戶端需要升級。

  • the command delivery has been timeout:發送命令逾時。

  • the command execution has been timeout:命令執行逾時。

  • the command execution got an exception:命令執行發生異常。

  • the command execution has been interrupted:命令執行被中斷。

  • the command execution exit code is not zero:命令執行結束,退出碼非 0。

the specified instance does not exists

ErrorCode

string

命令的下發失敗或執行失敗原因的代碼,可能值:

  • 空:命令執行正常。

  • InstanceNotExists:指定的執行個體不存在或已釋放。

  • InstanceReleased:執行命令期間,該執行個體被釋放。

  • InstanceNotRunning:命令執行時,該執行個體不在運行中。

  • CommandNotApplicable:命令不適用於指定的執行個體。

  • AccountNotExists:指定的帳號不存在。

  • DirectoryNotExists:指定的目錄不存在。

  • BadCronExpression:指定的周期運算式不合法。

  • ClientNotRunning:雲助手用戶端未運行。

  • ClientNotResponse:雲助手用戶端無響應。

  • ClientIsUpgrading:雲助手用戶端正在升級中。

  • ClientNeedUpgrade:雲助手用戶端需要升級。

  • DeliveryTimeout:發送命令逾時。

  • ExecutionTimeout:命令執行逾時。

  • ExecutionException:命令執行發生異常。

  • ExecutionInterrupted:命令執行被中斷。

  • ExitCodeNonzero:命令執行結束,退出碼非 0。

InstanceNotExists

InvokeId

string

命令執行 ID。

t-bj02prjje65****

InvokeRecordStatus

string

命令執行狀態。可能值:

  • Running:運行中。

  • Finished:已完成。

  • Failed:失敗。

  • Stopped:已停止。

Finished

InvokeUser

string

在Simple Application Server執行個體中執行命令的使用者名稱稱。

root

Output

string

命令執行後的輸出資訊。

YWRtaW4K

InstanceId

string

Simple Application Server執行個體 ID。

ace0706b2ac4454d984295a94213****

樣本

正常返回樣本

JSON格式

{
  "RequestId": "20758A-585D-4A41-A9B2-28DA8F4F****",
  "InvocationResult": {
    "StartTime": "2022-07-11T06:37:16Z",
    "FinishedTime": "2022-07-11T06:37:17Z",
    "InvocationStatus": "Success",
    "ExitCode": 0,
    "ErrorInfo": "the specified instance does not exists",
    "ErrorCode": "InstanceNotExists",
    "InvokeId": "t-bj02prjje65****",
    "InvokeRecordStatus": "Finished",
    "InvokeUser": "root",
    "Output": "YWRtaW4K",
    "InstanceId": "ace0706b2ac4454d984295a94213****"
  }
}

錯誤碼

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情