All Products
Search
Document Center

Simple Application Server:DescribeInvocationResult

Last Updated:Sep 08, 2026

Queries the execution result of a single command.

Operation description

  • After you run a command, the command is not necessarily executed successfully or produces the expected results. Call this operation to view the actual execution result based on the actual output.

  • You can query execution information from the last two weeks. A maximum of 100,000 entries of execution information can be retained.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

swas-open:DescribeInvocationResult

get

*Instance

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

None None

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The instance ID of the simple application server instance.

ace0706b2ac4454d984295a94213****

InvokeId

string

Yes

The command execution ID. You can call the DescribeInvocations operation to query the InvokeId.

t-bj02prjhw1n****

RegionId

string

Yes

The region ID. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The request ID.

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

InvocationResult

object

The command execution result.

StartTime

string

The time when the command started to be executed on the instance. The time is displayed in UTC (Z) in the YYYY-MM-DDThh:mm:ssZ format.

2022-07-11T06:37:16Z

FinishedTime

string

The time when the command finished being executed on the instance. The time is displayed in UTC (Z) in the YYYY-MM-DDThh:mm:ssZ format.

2022-07-11T06:37:17Z

InvocationStatus

string

The execution status of the command on the instance. Valid values:

  • Pending: The system is verifying or sending the command.

  • Invalid: The specified command type or parameter is invalid.

  • Aborted: Failed to send the command to the instance. The instance must be in the Running state, and the command must be delivered within 1 minute.

  • Running: The command is being executed on the instance.

  • Success: The command execution is complete, and the exit code is 0.

  • Failed: The command execution is complete, and the exit code is non-zero.

  • Error: An exception occurred during command execution and the command cannot continue.

  • Timeout: The command execution timed out.

  • Cancelled: The command execution has been canceled, and the command was never started.

  • Stopping: The command being executed is being stopped.

  • Terminated: The command was terminated during execution.

Success

ExitCode

integer

The exit code of the command.

  • For Linux instances, the exit code is the exit code of the shell command.

  • For Windows instances, the exit code is the exit code of the Bat or PowerShell command.

0

ErrorInfo

string

The details of the command delivery failure or execution failure. Valid values:

  • Empty: The command was executed normally.

  • the specified instance does not exists: The specified instance does not exist or has been released.

  • the instance has released when create task: The instance was released during command execution.

  • the instance is not running when create task: The instance was not in the Running state when the command was executed.

  • the command is not applicable: The command is not applicable to the specified instance.

  • the specified account does not exists: The specified account does not exist.

  • the specified directory does not exists: The specified directory does not exist.

  • the cron job expression is invalid: The specified cron expression is invalid.

  • the aliyun service is not running on the instance: The Cloud Assistant Agent is not running.

  • the aliyun service in the instance does not response: The Cloud Assistant Agent is not responding.

  • the aliyun service in the instance is upgrading now: The Cloud Assistant Agent is being upgraded.

  • the aliyun service in the instance need upgrade: The Cloud Assistant Agent needs to be upgraded.

  • the command delivery has been timeout: The command delivery timed out.

  • the command execution has been timeout: The command execution timed out.

  • the command execution got an exception: An exception occurred during command execution.

  • the command execution has been interrupted: The command execution was interrupted.

  • the command execution exit code is not zero: The command execution is complete, and the exit code is non-zero.

the specified instance does not exists

ErrorCode

string

The error code for the command delivery failure or execution failure. Valid values:

  • Empty: The command was executed normally.

  • InstanceNotExists: The specified instance does not exist or has been released.

  • InstanceReleased: The instance was released during command execution.

  • InstanceNotRunning: The instance was not in the Running state when the command was executed.

  • CommandNotApplicable: The command is not applicable to the specified instance.

  • AccountNotExists: The specified account does not exist.

  • DirectoryNotExists: The specified directory does not exist.

  • BadCronExpression: The specified cron expression is invalid.

  • ClientNotRunning: The Cloud Assistant Agent is not running.

  • ClientNotResponse: The Cloud Assistant Agent is not responding.

  • ClientIsUpgrading: The Cloud Assistant Agent is being upgraded.

  • ClientNeedUpgrade: The Cloud Assistant Agent needs to be upgraded.

  • DeliveryTimeout: The command delivery timed out.

  • ExecutionTimeout: The command execution timed out.

  • ExecutionException: An exception occurred during command execution.

  • ExecutionInterrupted: The command execution was interrupted.

  • ExitCodeNonzero: The command execution is complete, and the exit code is non-zero.

InstanceNotExists

InvokeId

string

The command execution ID.

t-bj02prjje65****

InvokeRecordStatus

string

The command execution status. Valid values:

  • Running: running.

  • Finished: completed.

  • Failed: failed.

  • Stopped: stopped.

Finished

InvokeUser

string

The username used to execute the command on the simple application server.

root

Output

string

The output of the command execution.

YWRtaW4K

InstanceId

string

The instance ID of the simple application server instance.

ace0706b2ac4454d984295a94213****

Examples

Success response

JSON format

{
  "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****"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.