Queries the list and status of commands run by Cloud Assistant.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
swas-open:DescribeCommandInvocations |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. You can call ListRegions to query available regions. |
cn-hangzhou |
| InstanceId |
string |
No |
The instance ID of the simple application server. |
ace0706b2ac4454d984295a94213**** |
| CommandId |
string |
No |
The command ID. You can call DescribeCommands to query all available command IDs. |
c-sh02yh0932w**** |
| InvokeId |
string |
No |
The command execution ID. |
t-hz02p9545t6**** |
| CommandName |
string |
No |
The command name. If the InstanceId parameter is also specified, this parameter does not take effect. |
testName |
| InvocationStatus |
string |
No |
The overall execution status of the command. The overall execution status depends on the common execution status across all instances in this invocation. Valid values:
Note
The |
Success |
| CommandType |
string |
No |
The command type. Valid values:
|
RunPowerShellScript |
| PageNumber |
string |
No |
The page number. Minimum value: 1. Default value: 1. |
1 |
| PageSize |
string |
No |
The number of entries per page for a paged query. Maximum value: 50. Default value: 10. |
10 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The request ID. |
30637AD6-D977-4833-A54C-CC89483E**** |
| TotalCount |
integer |
The total number of entries. |
10 |
| PageNumber |
integer |
The page number of the query result. |
1 |
| PageSize |
integer |
The number of entries per page settings for a paged query. This is the paging size. |
10 |
| CommandInvocations |
array<object> |
The list of command executions. |
|
|
array<object> |
The command execution information struct. |
||
| InvokeId |
string |
The command execution ID. |
t-hz0373jyzxt**** |
| CreationTime |
string |
The time when the command was created, in the format of YYYY-MM-DDThh:mm:ss. |
2023-04-27T10:11:58 |
| CommandId |
string |
The command ID. |
c-hy0338xh28r**** |
| InvocationStatus |
string |
The execution status of the command. Valid values:
|
Success |
| CommandName |
string |
The command name. |
testCommandName |
| CommandType |
string |
The command type. |
RunShellScript |
| CommandDescription |
string |
The command description. |
testDescription |
| Username |
string |
The username used to run the command. |
root |
| WorkingDir |
string |
The path in which the command was executed. |
c:\wwwroot |
| Timeout |
integer |
The timeout period, in seconds. |
60 |
| CommandContent |
string |
The command content. |
echo 123 |
| Parameters |
string |
The custom parameters included in the command. If no parameters exist, the default value is {}. |
{} |
| InvokeInstances |
array<object> |
The list of target instances for execution. |
|
|
object |
The target instance information struct. |
||
| InstanceId |
string |
The instance ID of the simple application server. |
2445f4aecdac4b71ba2c7e3a7ccf**** |
| StartTime |
string |
The time when the command started running on the instance. The time is displayed in UTC (Z) in the format of YYYY-MM-DDThh:mm:ssZ. |
2023-05-09T03:32:24Z |
| FinishTime |
string |
The time when the command process ended. The time is displayed in UTC (Z) in the format of YYYY-MM-DDThh:mm:ssZ. |
2023-04-03T02:42:29Z |
| InvocationStatus |
string |
The command execution status on a single instance. Valid values:
|
Running |
| Output |
string |
The output information of the command execution. |
OutputMsg |
| ExitCode |
integer |
The exit code of the command.
|
0 |
| ErrorInfo |
string |
The details of the command delivery failure or execution failure. Valid values:
|
the specified instance does not exists |
| ErrorCode |
string |
The error code for the command delivery failure or execution failure. Valid values:
|
InstanceNotExists |
Examples
Success response
JSON format
{
"RequestId": "30637AD6-D977-4833-A54C-CC89483E****",
"TotalCount": 10,
"PageNumber": 1,
"PageSize": 10,
"CommandInvocations": [
{
"InvokeId": "t-hz0373jyzxt****",
"CreationTime": "2023-04-27T10:11:58",
"CommandId": "c-hy0338xh28r****",
"InvocationStatus": "Success",
"CommandName": "testCommandName",
"CommandType": "RunShellScript",
"CommandDescription": "testDescription",
"Username": "root",
"WorkingDir": "c:\\wwwroot",
"Timeout": 60,
"CommandContent": "echo 123",
"Parameters": "{}",
"InvokeInstances": [
{
"InstanceId": "2445f4aecdac4b71ba2c7e3a7ccf****",
"StartTime": "2023-05-09T03:32:24Z",
"FinishTime": "2023-04-03T02:42:29Z",
"InvocationStatus": "Running",
"Output": "OutputMsg",
"ExitCode": 0,
"ErrorInfo": "the specified instance does not exists",
"ErrorCode": "InstanceNotExists"
}
]
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.