All Products
Search
Document Center

Simple Application Server:DescribeInvocationResult

Last Updated:Oct 30, 2024

Queries the execution result of a command.

Operation description

  • After you execute a command, the command may not succeed or return the expected results. You can call this operation to query the execution result of a command.
  • You can query the execution results that were generated within the last two weeks. A maximum of 100,000 entries of execution results can be retained.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
swas-open:DescribeInvocationResultget
  • Instance
    acs:swas-open:{#regionId}:{#accountId}:command/{#InstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the simple application server.

ace0706b2ac4454d984295a94213****
InvokeIdstringYes

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

t-bj02prjhw1n****
RegionIdstringYes

The region ID of the simple application server. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

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

The execution results.

StartTimestring

The time when the execution started.

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

The time when the execution ended.

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

The status of the execution progress. Valid values:

  • Pending: The command is being verified or sent.
  • Invalid: The specified command type or parameter is invalid.
  • Aborted: The command fails to be sent to the server. To send a command to a server, make sure that the server is in the Running state and the command can be sent within 1 minute.
  • Running: The command is being executed on the server.
  • Success: The execution is completed, and the exit code is 0.
  • Failed: The execution is completed, and the exit code is not 0.
  • Error: The execution cannot proceed due to an exception.
  • Timeout: The execution times out.
  • Cancelled: The execution is canceled, and the command is not executed.
  • Stopping: The command in the Running state is being stopped.
  • Terminated: The command is terminated while it is being executed.
Success
ExitCodelong

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 batch or PowerShell command.
0
ErrorInfostring

The error message returned when the command is not successfully sent or executed. Valid values:

  • If this parameter is empty, the command is executed normally.
  • the specified instance does not exists: The specified server does not exist or is released.
  • the instance has released when create task: The server was released while the command was being executed on the server.
  • the instance is not running when create task: The server is not in the Running state while the command is being executed.
  • the command is not applicable: The command is not applicable to the specified server.
  • 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 Assistance client is not running.
  • the aliyun service in the instance does not response: The Cloud Assistant client does not respond to your request.
  • the aliyun service in the instance is upgrading now: The Cloud Assistant client is being upgraded.
  • the aliyun service in the instance need upgrade: The Cloud Assistant client needs to be upgraded.
  • the command delivery has been timeout: Command sending times out.
  • the command execution has been timeout: The execution times out.
  • the command execution got an exception: An exception occurs while the command is being executed.
  • the command execution has been interrupted: The execution is interrupted.
  • the command execution exit code is not zero: The execution is complete, and the exit code is not 0.
the specified instance does not exists
ErrorCodestring

The error code that is returned if the command failed to be sent or executed.

  • If this parameter is empty, the command is executed normally.
  • InstanceNotExists: The specified server does not exist or is released.
  • InstanceReleased: The server was released while the command was being executed on the server.
  • InstanceNotRunning: The server is not in the Running state while the command is being executed.
  • CommandNotApplicable: The command is not applicable to the specified server.
  • AccountNotExists: The specified account does not exist.
  • DirectoryNotExists: The specified directory does not exist.
  • BadCronExpression: The specified cron expression for the execution schedule is invalid.
  • ClientNotRunning: The Cloud Assistant client is not running.
  • ClientNotResponse: The Cloud Assistant client does not respond.
  • ClientIsUpgrading: The Cloud Assistant client is being upgraded.
  • ClientNeedUpgrade: The Cloud Assistant client needs to be upgraded.
  • DeliveryTimeout: Command sending times out.
  • ExecutionTimeout: The execution times out.
  • ExecutionException: An exception occurs while the command is being executed.
  • ExecutionInterrupted: The execution is interrupted.
  • ExitCodeNonzero: The execution is complete, but the exit code is not 0.
InstanceNotExists
InvokeIdstring

The execution ID.

t-bj02prjje65****
InvokeRecordStatusstring

The status of the execution. Valid values:

  • Running
  • Finished
  • Failed
  • Stopped
Finished
InvokeUserstring

The username who executes the command on the simple application server.

root
Outputstring

The command output.

YWRtaW4K
InstanceIdstring

The ID of the simple application server.

ace0706b2ac4454d984295a94213****

Examples

Sample success responses

JSONformat

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

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history