Share via


File - List From Compute Node

列出指定計算節點上 [工作] 目錄中的所有檔案。

GET {batchUrl}/pools/{poolId}/nodes/{nodeId}/files?api-version=2023-11-01.18.0
GET {batchUrl}/pools/{poolId}/nodes/{nodeId}/files?$filter={$filter}&recursive={recursive}&maxresults={maxresults}&timeout={timeout}&api-version=2023-11-01.18.0

URI 參數

名稱 位於 必要 類型 Description
batchUrl
path True

string

所有 Azure Batch 服務要求的基底 URL。

nodeId
path True

string

您要列出其檔案的計算節點識別碼。

poolId
path True

string

包含計算節點的集區識別碼。

api-version
query True

string

用戶端 API 版本。

$filter
query

string

OData $filter 子句。 如需建構此篩選的詳細資訊,請參閱 https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-compute-node-files

maxresults
query

integer

int32

回應中要傳回的項目數目上限。 最多可以傳回 1000 個檔案。

recursive
query

boolean

是否列出目錄的子系。

timeout
query

integer

int32

伺服器可以花費在數秒內處理要求的時間上限。 預設值為 30 秒。

要求標頭

Media Types: "application/json; odata=minimalmetadata"

名稱 必要 類型 Description
client-request-id

string

uuid

呼叫端產生的要求身分識別,格式為不含大括弧的 GUID,例如 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0。

return-client-request-id

boolean

伺服器是否應該在回應中傳回 client-request-id。

ocp-date

string

date-time-rfc1123

發出要求的時間。 用戶端連結庫通常會將此設定為目前的系統時鐘時間;如果您直接呼叫 REST API,請明確設定它。

回應

名稱 類型 Description
200 OK

NodeFileListResult

包含檔案清單的回應。

Headers

  • client-request-id: string
  • request-id: string
  • ETag: string
  • Last-Modified: string
Other Status Codes

BatchError

Batch 服務的錯誤。

安全性

azure_auth

Microsoft Entra OAuth 2.0 驗證碼流程

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名稱 Description
user_impersonation 模擬用戶帳戶

Authorization

Type: apiKey
In: header

範例

File list from node

Sample Request

GET account.region.batch.azure.com/pools/poolId/nodes/tvm-1695681911_1-20161122t193202z/files?recursive=False&api-version=2023-11-01.18.0


Sample Response

{
  "value": [
    {
      "name": "shared",
      "url": "https://account.region.batch.azure.com/pools/poolId/nodes/tvm-2167304207_2-20140919t215614z/files/shared",
      "isDirectory": true
    },
    {
      "name": "startup\\ProcessEnv.cmd",
      "url": "https://account.region.batch.azure.com/pools/poolId/nodes/tvm-2167304207_2-20140919t215614z/files/startup\\ProcessEnv.cmd",
      "isDirectory": false,
      "properties": {
        "creationTime": "2014-09-19T21:56:17.679195Z",
        "lastModified": "2014-09-19T21:56:17.679195Z",
        "contentLength": 1813,
        "contentType": "application/octet-stream"
      }
    },
    {
      "name": "startup\\stderr.txt",
      "url": "https://account.region.batch.azure.com/pools/poolId/nodes/tvm-2167304207_2-20140919t215614z/files/startup\\stderr.txt",
      "isDirectory": false,
      "properties": {
        "creationTime": "2014-09-19T21:56:17.5590855Z",
        "lastModified": "2014-09-19T21:56:17.5590855Z",
        "contentLength": 0,
        "contentType": "application/octet-stream"
      }
    }
  ]
}

定義

名稱 Description
BatchError

從 Azure Batch 服務收到的錯誤回應。

BatchErrorDetail

Azure Batch 錯誤回應中包含的其他信息專案。

ErrorMessage

在 Azure Batch 錯誤回應中收到的錯誤訊息。

FileProperties

計算節點上檔案的屬性。

NodeFile

計算節點上檔案或目錄的相關信息。

NodeFileListResult

列出計算節點上的檔案,或與計算節點上工作相關聯的檔案的結果。

BatchError

從 Azure Batch 服務收到的錯誤回應。

名稱 類型 Description
code

string

錯誤的識別碼。 程式碼不變,且要以程式設計方式使用。

message

ErrorMessage

描述錯誤的訊息,適用於在使用者介面中顯示。

values

BatchErrorDetail[]

索引鍵/值組的集合,其中包含錯誤的其他詳細數據。

BatchErrorDetail

Azure Batch 錯誤回應中包含的其他信息專案。

名稱 類型 Description
key

string

指定 Value 屬性意義的識別碼。

value

string

錯誤回應中包含的其他資訊。

ErrorMessage

在 Azure Batch 錯誤回應中收到的錯誤訊息。

名稱 類型 Description
lang

string

錯誤訊息的語言代碼

value

string

訊息的文字。

FileProperties

計算節點上檔案的屬性。

名稱 類型 Description
contentLength

integer

檔案的長度。

contentType

string

檔案的內容類型。

creationTime

string

檔案建立時間。
Linux 計算節點上的檔案不會傳回建立時間。

fileMode

string

八進位格式的檔案模式屬性。
檔案模式只會針對 Linux 計算節點上的檔案傳回。

lastModified

string

上次修改檔案的時間。

NodeFile

計算節點上檔案或目錄的相關信息。

名稱 類型 Description
isDirectory

boolean

物件是否代表目錄。

name

string

檔案路徑。

properties

FileProperties

檔案屬性。

url

string

檔案的 URL。

NodeFileListResult

列出計算節點上的檔案,或與計算節點上工作相關聯的檔案的結果。

名稱 類型 Description
odata.nextLink

string

要取得下一組結果的URL。

value

NodeFile[]

檔案清單。