Nodes - List Node Files
列出指定计算节点任务目录中的所有文件。
GET {endpoint}/pools/{poolId}/nodes/{nodeId}/files?api-version=2025-06-01
GET {endpoint}/pools/{poolId}/nodes/{nodeId}/files?api-version=2025-06-01&timeOut={timeOut}&maxresults={maxresults}&$filter={$filter}&recursive={recursive}
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
endpoint
|
path | True |
string (uri) |
Batch 帐户终结点(例如:https://batchaccount.eastus2.batch.azure.com)。 |
|
node
|
path | True |
string |
你想列出的计算节点文件的ID。 |
|
pool
|
path | True |
string |
包含计算节点的池的 ID。 |
|
api-version
|
query | True |
string minLength: 1 |
要用于此操作的 API 版本。 |
|
$filter
|
query |
string |
OData $filter 子句。 关于构造该滤波器的更多信息,请参见 https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-compute-node-files。 |
|
|
maxresults
|
query |
integer (int32) minimum: 1maximum: 1000 |
响应中要返回的最大项数。 最多可提交1000份申请。 |
|
|
recursive
|
query |
boolean |
是否列出目录的子女。 |
|
|
time
|
query |
integer (int32) |
服务器处理请求的最长时间(以秒为单位)。 默认为 30 秒。 如果值大于30,则使用默认值。” |
请求头
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| client-request-id |
string |
调用方生成的请求标识,采用不带大括号的 GUID 形式,例如 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0。 |
|
| return-client-request-id |
boolean |
服务器是否应在响应中返回 client-request-id。 |
|
| ocp-date |
string (date-time-rfc7231) |
发出请求的时间。 客户端库通常将此设置为当前的系统时钟时间;如果直接调用 REST API,请显式设置它。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
请求已成功。 标头
|
|
| Other Status Codes |
意外错误响应。 |
安全性
OAuth2Auth
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
作用域
| 名称 | 说明 |
|---|---|
| https://batch.core.windows.net//.default |
示例
File list from node
示例请求
GET {endpoint}/pools/poolId/nodes/tvm-1695681911_1-20161122t193202z/files?api-version=2025-06-01&recursive=False
示例响应
{
"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": "2025-09-19T21:56:17.679195Z",
"lastModified": "2025-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": "2025-09-19T21:56:17.5590855Z",
"lastModified": "2025-09-19T21:56:17.5590855Z",
"contentLength": "0",
"contentType": "application/octet-stream"
}
}
]
}
定义
| 名称 | 说明 |
|---|---|
|
Batch |
从 Azure Batch 服务收到的错误响应。 |
|
Batch |
Azure Batch 错误响应中包含的附加信息项。 |
|
Batch |
Azure Batch 错误响应中收到的错误消息。 |
|
Batch |
有关计算节点上的文件或目录的信息。 |
|
Batch |
列出计算节点上的文件或与计算节点上的任务关联的文件的结果。 |
|
File |
计算节点上文件的属性。 |
BatchError
从 Azure Batch 服务收到的错误响应。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
错误的标识符。 代码是固定的,旨在以编程方式使用。 |
| message |
描述错误的消息,旨在适合在用户界面中显示。 |
|
| values |
包含有关错误的更多详细信息的键值对的集合。 |
BatchErrorDetail
Azure Batch 错误响应中包含的附加信息项。
| 名称 | 类型 | 说明 |
|---|---|---|
| key |
string |
指定 Value 属性含义的标识符。 |
| value |
string |
错误响应附带的其他信息。 |
BatchErrorMessage
Azure Batch 错误响应中收到的错误消息。
| 名称 | 类型 | 说明 |
|---|---|---|
| lang |
string |
错误消息的语言代码。 |
| value |
string |
消息的文本。 |
BatchNodeFile
有关计算节点上的文件或目录的信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| isDirectory |
boolean |
该对象是否代表一个目录。 |
| name |
string |
文件路径。 |
| properties |
文件属性。 |
|
| url |
string (uri) |
文件的 URL。 |
BatchNodeFileListResult
列出计算节点上的文件或与计算节点上的任务关联的文件的结果。
| 名称 | 类型 | 说明 |
|---|---|---|
| odata.nextLink |
string (uri) |
用于获取下一组结果的 URL。 |
| value |
文件清单。 |
FileProperties
计算节点上文件的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| contentLength |
string (int64) |
档案的长度。 |
| contentType |
string |
文件的内容类型。 |
| creationTime |
string (date-time) |
文件创建时间。 Linux 计算节点上的文件不会返回创建时间。 |
| fileMode |
string |
文件模式属性的八进制格式。 文件模式仅在Linux计算节点上返回文件。 |
| lastModified |
string (date-time) |
文件最后修改的时间。 |