文档

DescribeInvocationResult - 查询单个命令的执行结果

更新时间:

查询单个命令的执行结果。

接口说明

  • 当您执行命令后,不代表命令一定成功执行,并且一定有预期的命令效果。您需要通过本接口查看实际的具体执行结果,以实际输出结果为准。
  • 您可以查询最近 2 周的执行信息,执行信息的保留上限为 10 万条。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

当前API暂无授权信息透出。

请求参数

名称类型必填描述示例值
InstanceIdstring

轻量应用服务器实例 ID。

ace0706b2ac4454d984295a94213****
InvokeIdstring

命令执行 ID。您可以通过接口 DescribeInvocations 查询 InvokeId。

t-bj02prjhw1n****
RegionIdstring

地域 ID。您可以调用 DescribeRegions 查看最新的阿里云地域列表。

cn-hangzhou

返回参数

名称类型描述示例值
object

Schema of Response

RequestIdstring

请求 ID。

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

命令执行结果信息。

StartTimestring

命令在实例中开始执行的时间。

2022-07-11T06:37:16Z
FinishedTimestring

命令在实例中执行完成时间。

2022-07-11T06:37:17Z
InvocationStatusstring

实例的命令进度状态,可能值:

  • Pending:系统正在校验或发送命令。
  • Invalid:指定命令类型或参数有误。
  • Aborted:向实例发送命令失败。实例必须在运行中,且命令可以 1 分钟内发送完成。
  • Running:命令正在实例上执行。
  • Success:命令执行完成,且退出码为 0。
  • Failed:命令执行完成,且退出码非 0。
  • Error:命令执行时发生异常无法继续。
  • Timeout:命令执行超时。
  • Cancelled:命令的执行动作已经取消,命令未曾启动。
  • Stopping:正在停止执行的命令。
  • Terminated:命令执行时被终止。
Success
ExitCodelong

命令的退出码。

  • Linux 实例为 Shell 命令的退出码。
  • Windows 实例为 Bat 或者 PowerShell 命令的退出码。
0
ErrorInfostring

命令的下发失败或执行失败原因的详情,可能值:

  • 空:命令执行正常。
  • 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
ErrorCodestring

命令的下发失败或执行失败原因的代码,可能值:

  • 空:命令执行正常。
  • InstanceNotExists:指定的实例不存在或已释放。
  • InstanceReleased:执行命令期间,该实例被释放。
  • InstanceNotRunning:命令执行时,该实例不在运行中。
  • CommandNotApplicable:命令不适用于指定的实例。
  • AccountNotExists:指定的账号不存在。
  • DirectoryNotExists:指定的目录不存在。
  • BadCronExpression:指定的周期表达式不合法。
  • ClientNotRunning:云助手客户端未运行。
  • ClientNotResponse:云助手客户端无响应。
  • ClientIsUpgrading:云助手客户端正在升级中。
  • ClientNeedUpgrade:云助手客户端需要升级。
  • DeliveryTimeout:发送命令超时。
  • ExecutionTimeout:命令执行超时。
  • ExecutionException:命令执行发生异常。
  • ExecutionInterrupted:命令执行被中断。
  • ExitCodeNonzero:命令执行结束,退出码非 0。
InstanceNotExists
InvokeIdstring

命令执行 ID。

t-bj02prjje65****
InvokeRecordStatusstring

命令执行状态。可能值:

  • Running:运行中。
  • Finished:已完成。
  • Failed:失败。
  • Stopped:已停止。
Finished
InvokeUserstring

在轻量应用服务器实例中执行命令的用户名称。

root
Outputstring

命令执行后的输出信息。

YWRtaW4K
InstanceIdstring

轻量应用服务器实例 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****"
  }
}

错误码

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
暂无变更历史
  • 本页导读 (1)
文档反馈