You can call this operation to query the execution list and execution status of Cloud Assistant commands.

Description

  • After you run a command, it may not succeed. You can call this operation to query the actual execution result.
  • You can query the execution information in the last two weeks. A maximum of 100,000 pieces of execution information can be retained.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeInvocations

The operation that you want to perform. Set the value to DescribeInvocations.

RegionId String Yes cn-hangzhou

The ID of the region.

InvokeId String No t-hz0jdfwd9f****

The ID of the execution.

CommandType String No RunPowerShellScript

The type of the command. Valid values:

  • RunBatScript
  • RunPowerShellScript
InvokeStatus String No Finished

The overall execution status of the command. The overall execution status of the command is determined by the execution status of the command on one or more cloud desktops. Valid values:

  • Running: The command is running on one or more cloud desktops.
  • Finished: The command finishes running all cloud desktops, or the command is manually stopped on some cloud desktops and finishes running on the others.
  • Failed: The command fails to run on all cloud desktops.
  • PartialFailed: The command fails to run on some cloud desktops.
  • Stopped: The command is stopped.

Default value: Running.

DesktopId String No ecd-7w78ozhjcwa3u****

The ID of the cloud desktop. If you specify this parameter, all the execution records of Cloud Assistant commands on the specified cloud desktop are queried.

IncludeOutput Boolean No false

Specifies whether to return the command outputs in the response. Valid values:

  • true: returnes the command outputs.
  • false: does not return the command outputs.

Default value: false.

ContentEncoding String No PlainText

The encoding method of the command content and command outputs. Valid values:

  • PlainText: returns the original command content and command outputs.
  • Base64: returns Base64-encoded command content and command outputs.

Default value: Base64.

MaxResults Integer No 10

The number of entries to return on each page.

Default value: 100.

NextToken String No AAAAAV3MpHK1AP0pfERHZN5pu6nmB7qrRFJ8vmttjxPL****

The query token. Set the value to the NextToken value returned in the last call to the DescribeInvocations operation.

Response parameters

Parameter Type Example Description
Invocations Array of Invocation

Details about the command executions.

CommandContent String cnBtIC1xYSB8IGdyZXAgdnNm****

The Base64-encoded command content.

CommandType String RunPowerShellScript

The type of the command.

CreationTime String 2020-12-19T09:15:46Z

The time when the execution was created.

InvocationStatus String Pending

The overall execution status of the command. The overall execution status of the command is determined by the execution status of the command on all involved cloud desktops. Valid values:

  • Pending: The system is verifying or sending the command. When the execution status on at least one cloud desktop is Pending, the overall execution status is Pending.
  • Running: The command is running on cloud desktops. When the execution status on at least one cloud desktop is Running, the overall execution status is Running.
  • Success: When the execution status on all cloud desktops Success, or when the execution status on at least one cloud desktop is Success and the execution status on the others is Stopped, the overall execution status is Success.
  • Failed: When the execution status on all cloud desktops Failed, or when the execution status on at least one cloud desktop is Failed and the execution status on the others is Stopped, the overall execution status is Failed. When the execution status on a cloud desktop is one of the following values, Failed is returned for the command on the cloud desktop:
    • Invalid: The command is invalid.
    • Aborted: The command fails to be sent.
    • Failed: The command finishes running but the exit code is not 0.
    • Timeout: The execution times out.
    • Error: An error occurs when the command is running.
  • Stopping: The command is being stopped. When the execution status on at least one cloud desktop is Stopping, the overall execution status is Stopping.
  • Stopped: The command is stopped. When the execution status on all cloud desktops is Stopped, the overall execution status is Stopped. When the execution status on a cloud desktop is one of the following values, Stopped is returned for the command on the cloud desktop:
    • Cancelled: The execution is canceled.
    • Terminated: The execution is terminated.
  • PartialFailed: The command finishes running on some cloud desktops and fails to run on others. If the execution status on different cloud desktops is Success, Failed, and Stopped, the overall execution status is PartialFailed.
InvokeDesktops Array of InvokeDesktop

The cloud desktops on which attempts were made to run the command.

CreationTime String 2020-12-20T06:15:54Z

The time when the execution was created.

DesktopId String ecd-7w78ozhjcwa3u****

The ID of the cloud desktop.

Dropped Integer 0

The size of the text truncated and discarded when the Output value exceeds 24 KB in size.

ErrorCode String InstanceNotExists

The code for the cause why a command failed to be sent or run. Valid values:

  • If this parameter is empty, the command runs normally.
  • InstanceNotExists: The cloud desktop does not exist or is released.
  • InstanceReleased: The cloud desktop is released while the command is being executed.
  • InstanceNotRunning: The cloud desktop is not running when the execution is being created.
  • CommandNotApplicable: The command is not applicable to the specified cloud desktop.
  • ClientNotRunning: The Cloud Assistant client is not running.
  • ClientNotResponse: The Cloud Assistant client is not responding.
  • ClientIsUpgrading: The Cloud Assistant client is being upgraded.
  • ClientNeedUpgrade: The Cloud Assistant client needs to be upgraded.
  • DeliveryTimeout: The request to send the command times out.
  • ExecutionTimeout: The execution times out.
  • ExecutionException: An exception occurs when the command is running.
  • ExecutionInterrupted: The execution is interrupted.
  • ExitCodeNonzero: The command finishes running but the exit code is not 0.
ErrorInfo String the specified instance does not exists

The detailed cause why a command failed to be sent or run. Valid values:

  • If this parameter is empty, the command runs normally.
  • the specified instance does not exists: The cloud desktop does not exist or is released.
  • the instance has released when create task: The cloud desktop is released while the command is being executed.
  • the instance is not running when create task: The cloud desktop is not running when the execution is being created.
  • the command is not applicable: The command is not applicable to the specified cloud desktop.
  • 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 is not responding.
  • 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: The request to send the command times out.
  • the command execution has been timeout: The execution times out.
  • the command execution got an exception: An exception occurs when the command is running.
  • the command execution has been interrupted: The execution is interrupted.
  • the command execution exit code is not zero: The command finishes running but the exit code is not 0.
ExitCode Long 0

The exit code of the execution.

FinishTime String 2020-12-20T06:15:56Z

The end time of the execution.

InvocationStatus String Success

The execution status on the cloud desktop.

Output String OutPutTestmsg

The output of the command.

Repeats Integer 0

The number of times that the command ran on the cloud desktop.

StartTime String 2020-12-20T06:15:55Z

The start time of the execution.

StopTime String 2020-12-25T09:15:47Z

The time when you called the StopInvocation operation to manually stop the command.

UpdateTime String 2020-12-25T06:15:56Z

The time when the execution status was updated.

InvokeId String t-hz0jdfwd9f****

The ID of the execution.

NextToken String AAAAAV3MpHK1AP0pfERHZN5pu6nmB7qrRFJ8vmttjxPL****

The query token returned in this call.

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

Examples

Sample requests

https://ecd.cn-hangzhou.aliyuncs.com/?Action=DescribeInvocations
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

<DescribeInvocationsResponse>
      <NextToken>AAAAAV3MpHK1AP0pfERHZN5pu6nmB7qrRFJ8vmttjxPL****</NextToken>
      <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
      <Invocations>
            <CreationTime>2020-12-19T09:15:46Z</CreationTime>
            <CommandContent>cnBtIC1xYSB8IGdyZXAgdnNm****</CommandContent>
            <InvocationStatus>Pending</InvocationStatus>
            <CommandType>RunPowerShellScript</CommandType>
            <InvokeId>t-hz0jdfwd9f****</InvokeId>
      </Invocations>
      <Invocations>
            <InvokeDesktops>
                  <Dropped>0</Dropped>
                  <InvocationStatus>Success</InvocationStatus>
                  <ErrorInfo>the specified instance does not exists</ErrorInfo>
                  <ExitCode>0</ExitCode>
                  <StartTime>2020-12-20T06:15:55Z</StartTime>
                  <DesktopId>ecd-7w78ozhjcwa3u****</DesktopId>
                  <Repeats>0</Repeats>
                  <FinishTime>2020-12-20T06:15:56Z</FinishTime>
                  <Output>OutPutTestmsg</Output>
                  <UpdateTime>2020-12-25T06:15:56Z</UpdateTime>
                  <CreationTime>2020-12-20T06:15:54Z</CreationTime>
                  <ErrorCode>InstanceNotExists</ErrorCode>
                  <StopTime>2020-12-25T09:15:47Z</StopTime>
            </InvokeDesktops>
      </Invocations>
</DescribeInvocationsResponse>

JSON format

{
	"NextToken": "AAAAAV3MpHK1AP0pfERHZN5pu6nmB7qrRFJ8vmttjxPL****",
	"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
	"Invocations": [{
		"CreationTime": "2020-12-19T09:15:46Z",
		"CommandContent": "cnBtIC1xYSB8IGdyZXAgdnNm****",
		"InvocationStatus": "Pending",
		"CommandType": "RunPowerShellScript",
		"InvokeId": "t-hz0jdfwd9f****"
	}, {
		"InvokeDesktops": [{
			"Dropped": "0",
			"InvocationStatus": "Success",
			"ErrorInfo": "the specified instance does not exists",
			"ExitCode": "0",
			"StartTime": "2020-12-20T06:15:55Z",
			"DesktopId": "ecd-7w78ozhjcwa3u****",
			"Repeats": "0",
			"FinishTime": "2020-12-20T06:15:56Z",
			"Output": "OutPutTestmsg",
			"UpdateTime": "2020-12-25T06:15:56Z",
			"CreationTime": "2020-12-20T06:15:54Z",
			"ErrorCode": "InstanceNotExists",
			"StopTime": "2020-12-25T09:15:47Z"
		}]
	}]
}

Error codes

For a list of error codes, visit the API Error Center.