调用DescribeSendFileResults查询云助手下发文件列表及状态。
接口说明
- 当您下发文件后,不代表文件一定成功下发。您需要通过接口返回值查看实际下发结果,并以实际输出结果为准。
- 您可以查询最近2周的下发记录,下发记录的保留上限为10万条。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeSendFileResults |
系统规定参数。取值:DescribeSendFileResults |
RegionId | String | 是 | cn-hangzhou |
ECS实例所在的地域ID。您可以调用DescribeRegions查看最新的阿里云地域列表。 |
InvokeId | String | 否 | f-hz0jdfwd9f**** |
执行ID。 |
InstanceId | String | 否 | i-hz0jdfwd9f**** |
实例ID。传入该参数后,将查询该实例所有的文件下发记录。 |
Name | String | 否 | test.txt |
文件名称。传入该参数后,将查询该名称文件的所有的下发记录。 |
PageNumber | Long | 否 | 1 |
当前页码。 起始值:1 默认值:1 |
PageSize | Long | 否 | 10 |
分页查询时设置的每页行数。 最大值:50 默认值:10 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Invocations | Array of Invocation |
文件下发记录。 |
|
Invocation | |||
Content | String | #!/bin/bash echo "Current User is :" echo $(ps | grep "$$" | awk '{print $2}') |
文件内容。 |
ContentType | String | PlainText |
文件内容类型。可能值:
|
CreationTime | String | 2019-12-20T06:15:54Z |
文件下发任务创建时间。 |
Description | String | This is a test file. |
描述信息。 |
FileGroup | String | root |
文件的用户组。 |
FileMode | String | 777 |
文件的权限。 |
FileOwner | String | root |
文件的用户。 |
InvocationStatus | String | Success |
文件的总下发状态。总状态取决于本次下发的全部实例的共同执行状态,可能值:
|
InvokeId | String | f-hz0jdfwd9f**** |
执行ID。 |
InvokeInstances | Array of InvokeInstance |
下发文件目标实例集类型。 |
|
InvokeInstance | |||
CreationTime | String | 2019-12-20T06:15:54Z |
文件下发任务的创建时间。 |
ErrorCode | String | InstanceNotExists |
文件下发的失败原因代码。可能值:
|
ErrorInfo | String | the instance is not running when create task |
文件下发的失败或执行失败原因详情。可能值:
|
FinishTime | String | 2019-12-20T06:15:54Z |
下发任务的结束时间。 |
InstanceId | String | i-uf614fhehhz**** |
实例ID。 |
InvocationStatus | String | Success |
下发任务的状态。 |
StartTime | String | 2019-12-20T06:15:54Z |
下发任务在实例中开始执行的时间。 |
UpdateTime | String | 2019-12-20T06:15:54Z |
任务状态的更新时间。 |
Name | String | test.txt |
文件名称。 |
Overwrite | String | false |
是否允许覆盖。 |
TargetDir | String | /root |
目标路径。 |
VmCount | Integer | 1 |
下发实例的数量。 |
PageSize | Long | 10 |
每页行数。 |
RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
请求ID。 |
TotalCount | Long | 2 |
脚本总个数。 |
PageNumber | Long | 1 |
查询结果的当前页码。 |
示例
请求示例
https://ecs.aliyuncs.com/?Action=DescribeSendFileResults
&RegionId=cn-hangzhou
&InvokeId=f-hz0vk9****
&Name=test.txt
&InstanceId=i-bp1hsglsw****
&PageNumber=1
&PageSize=10
&<公共请求参数>
正常返回示例
XML
格式
<DescribeSendFileResultsResponse>
<TotalCount>1</TotalCount>
<RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
<PageSize>10</PageSize>
<PageNumber>1</PageNumber>
<Invocations>
<Invocation>
<FileMode>0644</FileMode>
<Overwrite>false</Overwrite>
<InvocationStatus>Success</InvocationStatus>
<Description>This is a test file.</Description>
<ContentType>PlainText</ContentType>
<VmCount>1</VmCount>
<TargetDir>/root</TargetDir>
<FileGroup>root</FileGroup>
<FileOwner>root</FileOwner>
<InvokeInstances>
<InvokeInstance>
<InvocationStatus>Success</InvocationStatus>
<FinishTime>2020-09-11T08:30:55Z</FinishTime>
<InstanceId>i-bp1hsglsw****</InstanceId>
<ErrorInfo></ErrorInfo>
<CreationTime>2020-09-11T08:30:55Z</CreationTime>
<StartTime>2020-09-11T08:30:55Z</StartTime>
<UpdateTime>2020-09-11T08:30:55Z</UpdateTime>
<ErrorCode></ErrorCode>
</InvokeInstance>
</InvokeInstances>
<Name>test.txt</Name>
<Content>ZWNobyBoZWxsbw==</Content>
<CreationTime>2020-09-11T08:30:55Z</CreationTime>
<InvokeId>f-hz0vk9****</InvokeId>
</Invocation>
</Invocations>
</DescribeSendFileResultsResponse>
JSON
格式
{
"TotalCount": 1,
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"PageSize": 10,
"PageNumber": 1,
"Invocations": {
"Invocation": [
{
"FileMode": "0644",
"Overwrite": false,
"InvocationStatus": "Success",
"Description": "This is a test file.",
"ContentType": "PlainText",
"VmCount": 1,
"TargetDir": "/root",
"FileGroup": "root",
"FileOwner": "root",
"InvokeInstances": {
"InvokeInstance": [
{
"InvocationStatus": "Success",
"FinishTime": "2020-09-11T08:30:55Z",
"InstanceId": "i-bp1hsglsw****",
"ErrorInfo": "",
"CreationTime": "2020-09-11T08:30:55Z",
"StartTime": "2020-09-11T08:30:55Z",
"UpdateTime": "2020-09-11T08:30:55Z",
"ErrorCode": ""
}
]
},
"Name": "test.txt",
"Content": "ZWNobyBoZWxsbw==",
"CreationTime": "2020-09-11T08:30:55Z",
"InvokeId": "f-hz0vk9****"
}
]
}
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
500 | InternalError.Dispatch | An error occurred when you dispatched the request. | 发送请求时发生错误,请稍后重试。 |
403 | InvalidParam.PageNumber | The specified parameter is invalid. | 指定的PageNumber参数无效。 |
403 | InvalidParam.PageSize | The specified parameter is invalid. | 指定的PageSize参数无效。 |
访问错误中心查看更多错误码。