$.parameters[11].schema.items.properties.Value.example
Operation description
API Guide
-
After you execute a command, it does not necessarily mean that the command was successfully executed or produced the expected effect. You must use this API to check the actual execution results, and the actual output takes precedence.
-
You can query execution information from the last four weeks, with a maximum retention limit of 100,000 records.
-
You can obtain job results through management event subscription for Cloud Assistant task status, which avoids frequent polling and improves efficiency.
-
When performing a paged query on the home page, you only need to set
MaxResultsto limit the number of returned entries. TheNextTokenin the return result serves as the credential for querying subsequent pages. When querying subsequent pages, set theNextTokenparameter to theNextTokenvalue obtained from the previous response as the query credential, and setMaxResultsto limit the number of returned entries. -
Differences between
DescribeInvocationsandDescribeInvocationResults:- When a single
RunCommand/InvokeCommandinvocation targets multiple instances:DescribeInvocationsprovides the execution status on each instance and an aggregation status across all instances.DescribeInvocationResultsonly provides individual execution statuses per instance, without aggregated multi-instance status.
- When a single
RunCommand/InvokeCommandinvocation targets one instance:There is little difference between
DescribeInvocationsandDescribeInvocationResults, and they can fully replace each other.
When you need to view the execution history of scheduled (periodic) tasks or automatic startup tasks (
RepeatMode=Period, EveryReboot), onlyDescribeInvocationResultscan retrieve historical execution records (by specifyingIncludeHistory=true). In contrast,DescribeInvocationsonly returns the latest task status.When you need to view the command content or parameters, only
DescribeInvocationsreturnsCommandContent.
- When a single
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:DescribeInvocationResults |
get |
Command
Instance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
$.parameters[11].schema.items.description |
cn-hangzhou |
| ResourceGroupId |
string |
No |
$.parameters[11].schema.items.example |
rg-bp67acfmxazb4p**** |
| RegionId |
string |
Yes |
$.parameters[11].schema.items.description |
cn-hangzhou |
| InvokeId |
string |
No |
$.parameters[11].schema.items.enumValueTitles |
t-hz0jdfwd9f**** |
| InstanceId |
string |
No |
$.parameters[11].schema.description |
i-bp1i7gg30r52z2em**** |
| CommandId |
string |
No |
$.parameters[11].schema.example |
c-hz0jdfwcsr**** |
| InvokeRecordStatus |
string |
No |
$.parameters[11].schema.enumValueTitles |
Running |
| IncludeHistory |
boolean |
No |
{
"RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE*****",
"Invocation" : {
"InvocationResults" : {
"InvocationResult" : [ {
"Dropped" : 0,
"InvocationStatus" : "Success",
"InstanceId" : "i-bp1i7gg30r52z2em****",
"ExitCode" : 0,
"ErrorInfo" : "the specified instance does not exists",
"StartTime" : "2019-12-20T06:15:55Z",
"Repeats" : 0,
"InvokeRecordStatus" : "Running",
"FinishedTime" : "2019-12-20T06:15:56Z",
"Output" : "MTU6MzA6MDEK",
"CommandId" : "c-hz0jdfwcsr****",
"ErrorCode" : "InstanceNotExists",
"InvokeId" : "t-hz0jdfwd9f****",
"StopTime" : "2020-01-19T09:15:47Z",
"ContainerId":"ab141ddfbacfe02d9dbc25966ed971536124527097398d419a6746873fea****",
"ContainerName":"test-container", |
false |
| ContentEncoding |
string |
No |
|
PlainText |
| PageNumber |
integer |
No |
acs:ecs:{#regionId}:{#accountId}:command/* |
1 |
| PageSize |
integer |
No |
acs:ecs:{#regionId}:{#accountId}:instance/* |
1 |
| MaxResults |
integer |
No |
FEATUREecsXZ3H4M |
10 |
| NextToken |
string |
No |
dubbo |
AAAAAdDWBF2 |
| Tag |
array<object> |
No |
The region ID of the command. You can call the DescribeRegions operation to query the most recent region list. |
|
|
object |
No |
The ID of the resource group. After you set this parameter, command execution results in the specified resource group are queried. |
||
| Value |
string |
No |
The ID of the command task. You can call the DescribeInvocations operation to query the IDs of all command tasks. |
TestValue |
| Key |
string |
No |
The ID of the instance. |
TestKey |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The ID of the command. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE***** |
| Invocation |
object |
The execution status of the command task. Valid values:
|
|
| PageSize |
integer |
Specifies whether to return the results of historical scheduled executions. Valid values:
Default value: false. |
1 |
| PageNumber |
integer |
The encoding mode of the
Default value: Base64. |
1 |
| TotalCount |
integer |
Note
This parameter will be removed in the future. We recommend that you use NextToken and MaxResults for a paged query. |
1 |
| NextToken |
string |
Note
This parameter will be removed in the future. We recommend that you use NextToken and MaxResults for a paged query. |
AAAAAdDWBF2 |
| InvocationResults |
object |
||
| InvocationResult |
array<object> |
The maximum number of entries per page. Valid values: 1 to 50. Default value: 10. |
|
|
array<object> |
|||
| Dropped |
integer |
The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken. |
0 |
| OssOutputDelivery |
string |
The tags of the command task. |
oss://testBucket/testPrefix |
| InvocationStatus |
string |
The tag of the command task. |
Success |
| InstanceId |
string |
The value of tag N of the command task. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot contain |
i-bp1i7gg30r52z2em**** |
| ExitCode |
integer |
The key of tag N of the command task. Valid values of N: 1 to 20. The tag key cannot be an empty string. If a single tag is specified to query resources, up to 1,000 resources that have this tag added can be displayed in the response. If multiple tags are specified to query resources, up to 1,000 resources that have all these tags added can be displayed in the response. To query more than 1,000 resources that have specified tags added, call the ListTagResources operation. The tag key can be up to 64 characters in length and cannot start with |
0 |
| ErrorInfo |
string |
The ID of the request. |
the specified instance does not exists |
| StartTime |
string |
Details about the execution results. |
2019-12-20T06:15:55Z |
| Repeats |
integer |
The number of entries per page. |
0 |
| InvokeRecordStatus |
string |
The page number. |
Running |
| FinishedTime |
string |
The total number of the commands. |
2019-12-20T06:15:56Z |
| OssOutputUri |
string |
A pagination token. It can be used in the next request to retrieve a new page of results. |
oss://testBucket/testPrefix/output.txt |
| OssOutputStatus |
string |
The execution results. |
Finished |
| OssOutputErrorCode |
string |
The error code when delivery fails. This field is returned only when OssOutputStatus is Failed.
|
CloudAssistant.UnsupportedInvocationStatus |
| OssOutputErrorInfo |
string |
The error details when delivery fails. This field is returned only when OssOutputStatus is Failed. |
The invocation status does not support output delivery. |
| Username |
string |
The size of the Output text that was truncated and discarded because the |
test |
| ContainerId |
string |
Command to execute the Output OSS delivery configuration. |
ab141ddfbacfe02d9dbc25966ed971536124527097398d419a6746873fea**** |
| ContainerName |
string |
The execution status on a single instance. Valid values:
|
test-container |
| Output |
string |
The instance ID. |
MTU6MzA6MDEK |
| Launcher |
string |
The exit code of the command task.
|
python3 -u {{ACS::ScriptFileName|Ext(".py")}} |
| CommandId |
string |
The error message returned when the command failed to be sent or run. Valid values:
|
c-hz0jdfwcsr**** |
| ErrorCode |
string |
The time when the command started to be run on the instance. |
InstanceNotExists |
| InvokeId |
string |
The number of times that the command was run on the instance.
|
t-hz0jdfwd9f**** |
| TerminationMode |
string |
The execution status of the command. Valid values:
|
ProcessTree |
| Tags |
object |
||
| Tag |
array<object> |
The time when the command task was completed. If the command task times out, the end time is equal to the start time of the command task specified by |
|
|
object |
The command execution Output delivers the object URI to OSS. This field is an empty string when the delivery fails or is in progress. |
||
| TagKey |
string |
The output delivery status of the command execution. Valid values:
|
owner |
| TagValue |
string |
The username used to run the command on the instance. |
zhangsan |
| StopTime |
string |
root |
2020-01-19T09:15:47Z |
Examples
Success response
JSON format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE*****",
"Invocation": {
"PageSize": 1,
"PageNumber": 1,
"TotalCount": 1,
"NextToken": "AAAAAdDWBF2",
"InvocationResults": {
"InvocationResult": [
{
"Dropped": 0,
"OssOutputDelivery": "oss://testBucket/testPrefix",
"InvocationStatus": "Success",
"InstanceId": "i-bp1i7gg30r52z2em****",
"ExitCode": 0,
"ErrorInfo": "the specified instance does not exists",
"StartTime": "2019-12-20T06:15:55Z",
"Repeats": 0,
"InvokeRecordStatus": "Running",
"FinishedTime": "2019-12-20T06:15:56Z",
"OssOutputUri": "oss://testBucket/testPrefix/output.txt",
"OssOutputStatus": "Finished",
"OssOutputErrorCode": "CloudAssistant.UnsupportedInvocationStatus",
"OssOutputErrorInfo": "The invocation status does not support output delivery.",
"Username": "test",
"ContainerId": "ab141ddfbacfe02d9dbc25966ed971536124527097398d419a6746873fea****",
"ContainerName": "test-container",
"Output": "MTU6MzA6MDEK",
"Launcher": "python3 -u {{ACS::ScriptFileName|Ext(\".py\")}}",
"CommandId": "c-hz0jdfwcsr****",
"ErrorCode": "InstanceNotExists",
"InvokeId": "t-hz0jdfwd9f****",
"TerminationMode": "ProcessTree",
"Tags": {
"Tag": [
{
"TagKey": "owner",
"TagValue": "zhangsan"
}
]
},
"StopTime": "2020-01-19T09:15:47Z"
}
]
}
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | RegionId.ApiNotSupported | The api is not supported in this region. | The API operation cannot be called in the specified region. Check whether the specified RegionId parameter is valid. |
| 400 | NumberExceed.Tags | The Tags parameter number is exceed. | The number of tags exceeds the maximum limit. |
| 400 | Duplicate.TagKey | The Tag.N.Key contain duplicate key. | The specified tag key already exists. Tag keys must be unique. |
| 400 | InvalidTagKey.Malformed | The specified Tag.n.Key is not valid. | The specified Tag.N.Key parameter is invalid. |
| 400 | InvalidTagValue.Malformed | The specified Tag.n.Value is not valid. | The specified tag value is invalid. |
| 400 | MissingParameter.TagKey | You must specify Tag.N.Key. | The tag key is not specified. |
| 400 | InvalidParam.PageNumber | The specified parameter is invalid. | |
| 400 | InvalidParam.PageSize | The specified parameter is invalid. | |
| 400 | InvalidParameter.NextToken | The specified parameter NextToken is not valid. | The specified parameter NextToken is illegal. |
| 400 | InvalidParameter.MaxResults | The specified parameter MaxResults is not valid. | The specified parameter MaxResults is illegal. |
| 500 | InternalError.Dispatch | An error occurred when you dispatched the request. | An error occurred while the request is being sent. Try again later. |
| 500 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | Operation.Forbidden | The operation is not permitted. | The operation is not supported. |
| 404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | Region information error |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.