DescribeSendFileResults - 查询云助手下发文件列表及状态

更新时间:
复制为 MD 格式

调用DescribeSendFileResults查询云助手下发文件列表及状态。

接口说明

接口说明:

  • 当您下发文件后,不代表文件一定成功下发。您需要通过接口返回值查看实际下发结果,并以实际输出结果为准。

  • 您可以查询最近 6 周的下发记录。

  • 分页查询首页时,仅需设置MaxResults以限制返回信息的条目数,返回结果中的NextToken将作为查询后续页的凭证。查询后续页时,将NextToken参数设置为上一次返回结果中获取到的NextToken作为查询凭证,并设置MaxResults限制返回条目数。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

ecs:DescribeSendFileResults

get

Instance

acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}

请求参数

名称

类型

必填

描述

示例值

RegionId

string

ECS 实例所在的地域 ID。您可以调用 DescribeRegions 查看最新的阿里云地域列表。

cn-hangzhou

ResourceGroupId

string

文件下发的资源组 ID。传入该参数后,需要在下发文件时指定 ResourceGroupId,支持筛选出对应的文件下发结果。

rg-bp67acfmxazb4p****

RegionId

string

ECS 实例所在的地域 ID。您可以调用 DescribeRegions 查看最新的阿里云地域列表。

cn-hangzhou

InvokeId

string

执行 ID。

f-hz0jdfwd9f****

Name

string

文件名称。传入该参数后,将查询该名称文件的所有的下发记录。

test.txt

InstanceId

string

实例 ID。传入该参数后,将查询该实例所有的文件下发记录。

i-hz0jdfwd9f****

PageNumber

integer

说明

该参数即将下线,推荐您使用 NextToken 与 MaxResults 完成分页查询操作。

1

PageSize

integer

说明

该参数即将下线,推荐您使用 NextToken 与 MaxResults 完成分页查询操作。

10

MaxResults

integer

分页查询时每页的最大条目数。

最大值为 50。

默认值为 10。

10

NextToken

string

查询凭证(Token),取值为上一次 API 调用返回的 NextToken 参数值。

AAAAAdDWBF2

InvocationStatus

string

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

  • Pending:系统正在校验或下发文件。存在至少一台实例的文件下发状态为 Pending,则总执行状态为 Pending。

  • Running:正在实例上下发文件。存在至少一台实例的文件下发状态为 Running,则总执行状态为 Running。

  • Success:下发成功。各个实例上的文件下发状态均为 Success,则总执行状态为 Success。

  • Failed:下发失败。各个实例上的文件下发状态均为 Failed,则总执行状态为 Failed。

  • PartialFailed:部分实例文件下发成功且部分实例下发失败。各个实例的文件下发状态均为 Success 或 Failed,则总执行状态为 PartialFailed。

Success

Tag

array<object>

标签列表。

object

标签列表。

Key

string

文件下发的标签键。N 的取值范围为 1~20。一旦传入该值,则不允许为空字符串。

使用一个标签过滤资源,查询到该标签下的资源数量不能超过 1000 个。使用多个标签过滤资源,查询到同时绑定了多个标签的资源数量不能超过 1000 个。如果资源数量超过 1000 个,您需要使用 ListTagResources 接口进行查询。

最多支持 64 个字符,不能以aliyunacs:开头,不能包含http://https://

TestKey

Value

string

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

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

TestValue

返回参数

名称

类型

描述

示例值

object

PageSize

integer

每页行数。

10

RequestId

string

请求 ID。

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

PageNumber

integer

查询结果的当前页码。

1

TotalCount

integer

脚本总个数。

2

NextToken

string

本次调用返回的查询凭证值。

AAAAAdDWBF2

Invocations

object

Invocation

array<object>

文件下发记录。

array<object>

CreationTime

string

文件下发任务创建时间。

2019-12-20T06:15:54Z

InvocationStatus

string

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

  • Pending:系统正在校验或下发文件。存在至少一台实例的文件下发状态为 Pending,则总执行状态为 Pending。

  • Running:正在实例上下发文件。存在至少一台实例的文件下发状态为 Running,则总执行状态为 Running。

  • Success:各个实例上的文件下发状态均为 Success,则总执行状态为 Success。

  • Failed:各个实例上的文件下发状态均为 Failed,则总执行状态为 Failed。实例上的文件下发状态一项或多项为以下状态时,返回值均为 Failed 状态:
    • 指定文件参数有误,校验失败(Invalid)。

    • 向实例下发文件失败(Aborted)。

    • 文件在实例内创建失败(Failed)。

    • 下发文件超时(Timeout)。

    • 下发文件时发生异常无法继续(Error)。

  • PartialFailed:部分实例文件下发成功且部分实例下发失败。各个实例的文件下发状态均为 Success 或 Failed,则总执行状态为 PartialFailed。

Success

ContentType

string

文件内容类型。可能值:

  • PlainText:普通文本。

  • Base64:Base64 编码。

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

执行 ID。

f-hz0jdfwd9f****

Name

string

文件名称。

test.txt

Content

string

文件内容。

#!/bin/bash echo "Current User is :" echo $(ps | grep "$$" | awk '{print $2}')

Overwrite

string

是否允许覆盖。

false

InvokeInstances

object

InvokeInstance

array<object>

下发文件目标实例集类型。

object

CreationTime

string

文件下发任务的创建时间。

2019-12-20T06:15:54Z

StartTime

string

下发任务在实例中开始执行的时间。

2019-12-20T06:15:54Z

InvocationStatus

string

单台实例下发任务的状态,可能值:

  • Pending:系统正在校验或下发文件。

  • Invalid:指定文件参数有误,校验失败。

  • Running:正在实例上下发文件。

  • Aborted:向实例下发文件失败。

  • Success:文件下发完成。

  • Failed:文件在实例内创建失败。

  • Error:下发文件时发生异常无法继续。

  • Timeout:下发文件超时。

Success

FinishTime

string

下发任务的结束时间。

2019-12-20T06:15:54Z

UpdateTime

string

任务状态的更新时间。

2019-12-20T06:15:54Z

ErrorInfo

string

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

  • 空:文件下发正常。

  • 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:文件权限设置不合法。

the instance is not running when create task

ErrorCode

string

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

  • 空:文件下发正常。

  • InstanceNotExists:指定的实例不存在或已释放。

  • InstanceReleased:下发文件期间,该实例被释放。

  • InstanceNotRunning:创建下发文件任务时,该实例不在运行中。

  • AccountNotExists:指定的账号不存在。

  • ClientNotRunning:云助手 Agent 未运行。

  • ClientNotResponse:云助手 Agent 无响应。

  • ClientIsUpgrading:云助手 Agent 正在升级中。

  • ClientNeedUpgrade:云助手 Agent 需要升级。

  • DeliveryTimeout:发送文件超时。

  • FileCreateFail:文件创建失败。

  • FileAlreadyExists:相同路径下存在同名文件。

  • FileContentInvalid:文件内容不合法。

  • FileNameInvalid:文件名不合法。

  • FilePathInvalid:文件路径不合法。

  • FileAuthorityInvalid:文件权限不合法。

  • UserGroupNotExists:发送文件时指定的用户组不存在。

InstanceNotExists

InstanceId

string

实例 ID。

i-uf614fhehhz****

Tags

object

Tag

array<object>

文件下发的标签信息。

object

文件下发的标签信息。

TagKey

string

文件下发的标签键。

owner

TagValue

string

文件下发的标签值。

zhangsan

示例

正常返回示例

JSON格式

{
  "PageSize": 10,
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "PageNumber": 1,
  "TotalCount": 2,
  "NextToken": "AAAAAdDWBF2",
  "Invocations": {
    "Invocation": [
      {
        "CreationTime": "2019-12-20T06:15:54Z",
        "InvocationStatus": "Success",
        "ContentType": "PlainText",
        "TargetDir": "/home/user",
        "FileOwner": "test",
        "Description": "This is a test file.",
        "VmCount": 1,
        "FileMode": "777",
        "FileGroup": "test",
        "InvokeId": "f-hz0jdfwd9f****",
        "Name": "test.txt",
        "Content": "#!/bin/bash  echo \"Current User is :\"  echo $(ps | grep \"$$\" | awk '{print $2}')",
        "Overwrite": "false",
        "InvokeInstances": {
          "InvokeInstance": [
            {
              "CreationTime": "2019-12-20T06:15:54Z",
              "StartTime": "2019-12-20T06:15:54Z",
              "InvocationStatus": "Success",
              "FinishTime": "2019-12-20T06:15:54Z",
              "UpdateTime": "2019-12-20T06:15:54Z",
              "ErrorInfo": "the instance is not running when create task",
              "ErrorCode": "InstanceNotExists",
              "InstanceId": "i-uf614fhehhz****"
            }
          ]
        },
        "Tags": {
          "Tag": [
            {
              "TagKey": "owner",
              "TagValue": "zhangsan"
            }
          ]
        }
      }
    ]
  }
}

错误码

HTTP status code

错误码

错误信息

描述

400 RegionId.ApiNotSupported The api is not supported in this region. 指定地域下不支持调用 API。请检查 RegionId 参数取值是否正确。
400 NumberExceed.Tags The Tags parameter number is exceed. 标签个数超过最大限制。
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.
400 InvalidParam.PageSize The specified parameter is invalid.
400 InvalidParameter.NextToken The specified parameter NextToken is not valid. 指定的参数NextToken不合法。
400 InvalidParameter.MaxResults The specified parameter MaxResults is not valid. 指定的参数MaxResults不合法。
500 InternalError.Dispatch An error occurred when you dispatched the request. 发送请求时发生错误,请稍后重试。
403 Operation.Forbidden The operation is not permitted. 该操作是不被允许的。
404 InvalidRegionId.NotFound The RegionId provided does not exist in our records. 地域信息错误

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

变更历史

更多信息,参考变更详情