调用DescribeSendFileResults查询云助手下发文件列表及状态。
接口说明:
- 当您下发文件后,不代表文件一定成功下发。您需要通过接口返回值查看实际下发结果,并以实际输出结果为准。
- 您可以查询最近6周的下发记录。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeSendFileResults | 系统规定参数。取值:DescribeSendFileResults。 |
RegionId | String | 是 | cn-hangzhou | ECS实例所在的地域ID。您可以调用DescribeRegions查看最新的阿里云地域列表。 |
ResourceGroupId | String | 否 | rg-bp67acfmxazb4p**** | 文件下发的资源组ID。传入该参数后,需要在下发文件时指定ResourceGroupId,支持筛选出对应的文件下发结果。 |
InvokeId | String | 否 | f-hz0jdfwd9f**** | 执行ID。 |
Name | String | 否 | test.txt | 文件名称。传入该参数后,将查询该名称文件的所有的下发记录。 |
InstanceId | String | 否 | i-hz0jdfwd9f**** | 实例ID。传入该参数后,将查询该实例所有的文件下发记录。 |
PageNumber | Long | 否 | 1 | 当前页码。 起始值为1。 默认值为1。 |
PageSize | Long | 否 | 10 | 分页查询时设置的每页行数。 最大值为50。 默认值为10。 |
Tag.N.Key | String | 否 | TestKey | 文件下发的标签键。N的取值范围为1~20。一旦传入该值,则不允许为空字符串。 使用一个标签过滤资源,查询到该标签下的资源数量不能超过1000个。使用多个标签过滤资源,查询到同时绑定了多个标签的资源数量不能超过1000个。如果资源数量超过1000个,您需要使用ListTagResources接口进行查询。 最多支持64个字符,不能以 |
Tag.N.Value | String | 否 | TestValue | 文件下发的标签值。N的取值范围为1~20。该值可以为空字符串。 最多支持128个字符,不能包含 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
PageSize | Long | 10 | 每页行数。 |
RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E | 请求ID。 |
PageNumber | Long | 1 | 查询结果的当前页码。 |
TotalCount | Long | 2 | 脚本总个数。 |
Invocations | Array of Invocation | 文件下发记录。 |
|
Invocation | |||
CreationTime | String | 2019-12-20T06:15:54Z | 文件下发任务创建时间。 |
InvocationStatus | String | Success | 文件的总下发状态。总状态取决于本次下发的全部实例的共同执行状态,可能值:
|
ContentType | String | PlainText | 文件内容类型。可能值:
|
TargetDir | String | /home/user | 目标路径。 |
FileOwner | String | test | 文件的用户。 |
Description | String | This is a test file. | 描述信息。 |
VmCount | Integer | 1 | 下发实例的数量。 |
FileMode | String | 777 | 文件的权限。 |
FileGroup | String | test | 文件的用户组。 |
InvokeId | String | f-hz0jdfwd9f**** | 执行ID。 |
Name | String | test.txt | 文件名称。 |
Content | String | #!/bin/bash echo "Current User is :" echo $(ps | grep "$$" | awk '{print $2}') | 文件内容。 |
Overwrite | String | false | 是否允许覆盖。 |
InvokeInstances | Array of InvokeInstance | 下发文件目标实例集类型。 |
|
InvokeInstance | |||
CreationTime | String | 2019-12-20T06:15:54Z | 文件下发任务的创建时间。 |
StartTime | String | 2019-12-20T06:15:54Z | 下发任务在实例中开始执行的时间。 |
InvocationStatus | String | Success | 下发任务的状态。 |
FinishTime | String | 2019-12-20T06:15:54Z | 下发任务的结束时间。 |
UpdateTime | String | 2019-12-20T06:15:54Z | 任务状态的更新时间。 |
ErrorInfo | String | the instance is not running when create task | 文件下发的失败或执行失败原因详情。可能值:
|
ErrorCode | String | InstanceNotExists | 文件下发的失败原因代码。可能值:
|
InstanceId | String | i-uf614fhehhz**** | 实例ID。 |
Tags | Array of Tag | 文件下发的标签信息。 |
|
Tag | |||
TagKey | String | owner | 文件下发的标签键。 |
TagValue | String | zhangsan | 文件下发的标签值。 |
示例
请求示例
https://ecs.aliyuncs.com/?Action=DescribeSendFileResults
&RegionId=cn-hangzhou
&InvokeId=f-hz0vk9****
&Name=test.txt
&InstanceId=i-bp1hsglsw****
&PageNumber=1
&PageSize=10
&<公共请求参数>
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/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>/home/user</TargetDir>
<FileGroup>test</FileGroup>
<FileOwner>test</FileOwner>
<InvokeInstances>
<InvokeInstance>
<InvocationStatus>Success</InvocationStatus>
<FinishTime>2020-09-11T08:30:55Z</FinishTime>
<InstanceId>i-bp1hsglsw****</InstanceId>
<ErrorInfo/>
<CreationTime>2020-09-11T08:30:55Z</CreationTime>
<StartTime>2020-09-11T08:30:55Z</StartTime>
<UpdateTime>2020-09-11T08:30:55Z</UpdateTime>
<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
格式
HTTP/1.1 200 OK
Content-Type:application/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" : "/home/user",
"FileGroup" : "test",
"FileOwner" : "test",
"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 | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | RegionId.ApiNotSupported | The api is not supported in this region. | 指定地域下不支持调用 API。请检查 RegionId 参数取值是否正确。 |
400 | MissingParameter.TagKey | You must specify Tag.N.Key. | 请指定标签键。 |
400 | Duplicate.TagKey | The Tag.N.Key contain duplicate key. | 标签中存在重复的键,请保持键的唯一性。 |
400 | InvalidTagKey.Malformed | The specified Tag.n.Key is not valid. | 指定的标签键参数有误。 |
400 | InvalidTagValue.Malformed | The specified Tag.n.Value is not valid. | 指定的标签值参数有误。 |
400 | InvalidParam.PageNumber | The specified parameter is invalid. | 指定的 PageNumber 参数无效。 |
400 | InvalidParam.PageSize | The specified parameter is invalid. | 指定的 PageSize 参数无效。 |
403 | Operation.Forbidden | The operation is not permitted. | 该操作是不被允许的。 |
500 | InternalError.Dispatch | An error occurred when you dispatched the request. | 发送请求时发生错误,请稍后重试。 |
访问错误中心查看更多错误码。