调用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个字符,不能以aliyunacs:开头,不能包含http://https://

Tag.N.Value String TestValue

文件下发的标签值。N的取值范围为1~20。该值可以为空字符串。

最多支持128个字符,不能包含http://https://

返回数据

名称 类型 示例值 描述
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

文件的总下发状态。总状态取决于本次下发的全部实例的共同执行状态,可能值:

  • Pending:系统正在校验或下发文件。
  • Invalid:指定文件参数有误,校验失败。
  • Running:正在实例上下发文件。
  • Aborted:向实例下发文件失败。实例必须在运行中,且文件可以1分钟内发送完成。
  • Success:文件下发完成。
  • Failed:文件在实例内创建失败。
  • Error:下发文件时发生异常无法继续。
  • Timeout:下发文件超时。
  • Cancelled:下发文件的动作已经取消。
  • Stopping:正在停止下发文件。
  • Terminated:文件下发时被终止。
ContentType String PlainText

文件内容类型。可能值:

  • PlainText:普通文本。
  • Base64:Base64编码。
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

文件下发的失败或执行失败原因详情。可能值:

  • 空:文件下发正常。
  • the specified instance does not exists:指定的实例不存在或已释放。
  • the specified instance has been released.:下发文件期间,该实例被释放。
  • the instance is not running when create task:创建下发文件任务时,该实例不在运行中。
  • the specified account does not exists:指定的账号不存在。
  • the aliyun service is not running on the instance:云助手Agent未运行。
  • the aliyun service in the instance does not response:云助手Agent无响应。
  • the aliyun service in the instance is upgrading now:云助手Agent正在升级中。
  • the aliyun service in the instance need upgrade:云助手Agent需要升级。
  • the command delivery has been timeout:下发文件超时。
  • the file creation is failed due to unknown error:文件创建失败。
  • the authority of file is invalid:文件权限不合法。
  • File content is empty:文件内容为空。
  • the content of file is invalid:文件内容不合法。
  • File already exists:相同路径下存在同名文件。
  • File name is invalid:文件名不合法。
  • File path is invalid:文件路径不合法。
  • Owner not exists:用户不存在。
  • Group not exists:用户组不存在。
  • Mode is invalid:文件权限设置不合法。
ErrorCode String InstanceNotExists

文件下发的失败原因代码。可能值:

  • 空:文件下发正常。
  • InstanceNotExists:指定的实例不存在或已释放。
  • InstanceReleased:下发文件期间,该实例被释放。
  • InstanceNotRunning:创建下发文件任务时,该实例不在运行中。
  • AccountNotExists:指定的账号不存在。
  • ClientNotRunning:云助手Agent未运行。
  • ClientNotResponse:云助手Agent无响应。
  • ClientIsUpgrading:云助手Agent正在升级中。
  • ClientNeedUpgrade:云助手Agent需要升级。
  • DeliveryTimeout:发送文件超时。
  • FileCreateFail:文件创建失败。
  • FileAlreadyExists:相同路径下存在同名文件。
  • FileContentInvalid:文件内容不合法。
  • FileNameInvalid:文件名不合法。
  • FilePathInvalid:文件路径不合法。
  • FileAuthorityInvalid:文件权限不合法。
  • UserGroupNotExists:发送文件时指定的用户组不存在。
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. 发送请求时发生错误,请稍后重试。

访问错误中心查看更多错误码。