全部產品
Search
文件中心

Elastic Compute Service:DescribeSendFileResults

更新時間:Jun 26, 2026

呼叫 DescribeSendFileResults 查詢雲端助手下發檔案列表及狀態。

介面說明

介面說明:

  • 當您下發檔案後,不代表檔案一定成功下發。您需要透過介面返回值查看實際下發結果,並以實際輸出結果為準。

  • 您可以查詢最近 30 天的執行資訊,執行資訊的保留上限為 1 萬條。

  • 分頁查詢首頁時,僅需設定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****

InvokeId

string

ECS 執行個體所在的地域 ID。您可以呼叫 DescribeRegions 查看最新的阿里雲地域列表。

f-hz0jdfwd9f****

Name

string

執行 ID。

test.txt

InstanceId

string

檔案名稱。傳入該參數後,將查詢該名稱檔案的所有下發記錄。

i-hz0jdfwd9f****

PageNumber

integer

執行個體 ID。傳入該參數後,將查詢該執行個體所有的檔案下發記錄。

1

PageSize

integer

說明

該參數即將下線,建議您使用 NextToken 與 MaxResults 完成分頁查詢操作。

10

MaxResults

integer

說明

該參數即將下線,建議您使用 NextToken 與 MaxResults 完成分頁查詢操作。

10

NextToken

string

分頁查詢時每頁的最大條目數。

最大值為 50。

預設值為 10。

AAAAAdDWBF2

InvocationStatus

string

查詢憑證(Token),取值為上一次 API 呼叫返回的 NextToken 參數值。

Success

Tag

array<object>

檔案的總下發狀態。總狀態取決於本次下發的全部執行個體的共同執行狀態,取值範圍:

  • Pending:系統正在校驗或下發檔案。存在至少一台執行個體的檔案下發狀態為 Pending,則總執行狀態為 Pending。

  • Running:正在執行個體上下發檔案。存在至少一台執行個體的檔案下發狀態為 Running,則總執行狀態為 Running。

  • Success:下發成功。各個執行個體上的檔案下發狀態均為 Success,則總執行狀態為 Success。

  • Failed:下發失敗。各個執行個體上的檔案下發狀態均為 Failed,則總執行狀態為 Failed。

  • PartialFailed:部分執行個體檔案下發成功且部分執行個體下發失敗。各個執行個體的檔案下發狀態均為 Success 或 Failed,則總執行狀態為 PartialFailed。

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.
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.
400 InvalidParameter.MaxResults The specified parameter MaxResults is not valid.
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.

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情