调用DescribeInvocations查询云助手脚本的执行列表和状态。
接口说明
- 当您执行命令后,不代表命令一定成功执行,并且一定有预期的命令效果。您需要通过接口返回值来查看实际执行结果,以实际输出结果为准。
- 您可以查询最近2周的执行信息,执行信息的保留上限为10万条。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeInvocations |
系统规定参数。取值:DescribeInvocations。 |
RegionId | String | 是 | cn-hangzhou |
地域ID。 |
InvokeId | String | 否 | t-hz0jdfwd9f**** |
脚本进程执行ID。 |
CommandType | String | 否 | RunPowerShellScript |
脚本类型。取值范围:
|
InvokeStatus | String | 否 | Finished |
脚本执行的总执行状态。总执行状态取决于创建执行中的一台或多台云桌面的共同执行状态。取值范围:
默认值:Running。 |
DesktopId | String | 否 | ecd-7w78ozhjcwa3u**** |
云桌面ID。如果指定了云桌面,则查询该桌面所有的脚本执行记录。 |
IncludeOutput | Boolean | 否 | false |
是否在结果中返回脚本运行的输出信息。取值范围:
默认值:false。 |
ContentEncoding | String | 否 | PlainText |
返回数据的编码方式。取值范围:
默认值:Base64。 |
MaxResults | Integer | 否 | 10 |
分页查询时每页行数。 默认值:100。 |
NextToken | String | 否 | AAAAAV3MpHK1AP0pfERHZN5pu6nmB7qrRFJ8vmttjxPL**** |
查询凭证(Token),取值为上一次API调用返回的NextToken参数值。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
NextToken | String | AAAAAV3MpHK1AP0pfERHZN5pu6nmB7qrRFJ8vmttjxPL**** |
本次调用返回的查询凭证值。 |
RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
请求ID。 |
Invocations | Array of Invocation |
脚本执行记录信息集合。 |
|
CreationTime | String | 2020-12-19T09:15:46Z |
任务的创建时间。 |
InvocationStatus | String | Pending |
脚本执行的总执行状态,总执行状态取决于本次调用的全部云桌面的共同执行状态,可能值:
|
InvokeId | String | t-hz0jdfwd9f**** |
执行ID。 |
CommandType | String | RunPowerShellScript |
脚本类型。 |
CommandContent | String | cnBtIC1xYSB8IGdyZXAgdnNm**** |
脚本内容,以Base64编码后传输。 |
InvokeDesktops | Array of InvokeDesktop |
执行目标云桌面集合。 |
|
CreationTime | String | 2020-12-20T06:15:54Z |
脚本进程的创建时间。 |
InvocationStatus | String | Success |
单台云桌面的脚本进度状态。 |
FinishTime | String | 2020-12-20T06:15:56Z |
脚本进程的结束时间。 |
UpdateTime | String | 2020-12-25T06:15:56Z |
任务状态的更新时间。 |
Repeats | Integer | 0 |
命令在该桌面上执行的次数。 |
DesktopId | String | ecd-7w78ozhjcwa3u**** |
云桌面ID。 |
Output | String | OutPutTestmsg |
脚本进程的输出信息。
|
Dropped | Integer | 0 |
Output字段中文字长度超出24 KB后,截断丢弃的文字长度。 |
StopTime | String | 2020-12-25T09:15:47Z |
如果调用了stopInvocation,表示调用的时间。 |
ExitCode | Long | 0 |
脚本进程的退出代码。 |
StartTime | String | 2020-12-20T06:15:55Z |
脚本进程在桌面中开始执行的时间。 |
ErrorInfo | String | the specified instance does not exists |
命令的下发失败或执行失败原因的详情,可能值:
|
ErrorCode | String | InstanceNotExists |
命令的下发失败或执行失败原因的代码,可能值:
|
示例
请求示例
https://ecd.cn-hangzhou.aliyuncs.com/?Action=DescribeInvocations
&RegionId=cn-hangzhou
&<公共请求参数>
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<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
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"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"
} ]
} ]
}