你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Account - List Pool Node Counts
获取按池分组的每个状态中的计算节点数。 请注意,返回的数字可能并不总是最新的。 如果需要确切的节点计数,请使用列表查询。
GET {batchUrl}/nodecounts?api-version=2024-07-01.20.0
GET {batchUrl}/nodecounts?$filter={$filter}&maxresults={maxresults}&timeout={timeout}&api-version=2024-07-01.20.0
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
batch
|
path | True |
string |
所有 Azure Batch 服务请求的基本 URL。 |
api-version
|
query | True |
string |
客户端 API 版本。 |
$filter
|
query |
string |
OData $filter 子句。 有关构造此筛选器的详细信息,请参阅 https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch。 |
|
maxresults
|
query |
integer int32 |
响应中要返回的最大项数。 |
|
timeout
|
query |
integer int32 |
服务器处理请求的最长时间(以秒为单位)。 默认值为 30 秒。 如果该值大于 30,则改用默认值。 |
请求头
Media Types: "application/json; odata=minimalmetadata"
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
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,请显式设置它。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
响应包含每个计算节点状态中的计算节点数,按池分组。 标头
|
|
Other Status Codes |
Batch 服务中的错误。 |
安全性
azure_auth
Microsoft Entra OAuth 2.0 身份验证代码流
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
名称 | 说明 |
---|---|
user_impersonation | 模拟用户帐户 |
Authorization
类型:
apiKey
在:
header
示例
NodeCountsPayload
示例请求
GET account.region.batch.azure.com/nodecounts?api-version=2024-07-01.20.0
示例响应
{
"value": [
{
"poolId": "pool1",
"dedicated": {
"creating": 0,
"deallocated": 0,
"deallocating": 0,
"idle": 0,
"leavingPool": 0,
"offline": 0,
"preempted": 0,
"rebooting": 0,
"reimaging": 0,
"running": 0,
"starting": 0,
"startTaskFailed": 0,
"unknown": 0,
"unusable": 0,
"waitingForStartTask": 0,
"upgradingOS": 0,
"total": 0
},
"lowPriority": {
"creating": 0,
"deallocated": 0,
"deallocating": 0,
"idle": 0,
"leavingPool": 0,
"offline": 0,
"preempted": 0,
"rebooting": 0,
"reimaging": 0,
"running": 2,
"starting": 1,
"startTaskFailed": 0,
"unknown": 0,
"unusable": 0,
"waitingForStartTask": 0,
"upgradingOS": 0,
"total": 3
}
},
{
"poolId": "pool2",
"dedicated": {
"creating": 0,
"deallocated": 0,
"deallocating": 0,
"idle": 1,
"leavingPool": 0,
"offline": 3,
"preempted": 0,
"rebooting": 0,
"reimaging": 0,
"running": 0,
"starting": 0,
"startTaskFailed": 0,
"unknown": 0,
"unusable": 0,
"waitingForStartTask": 0,
"upgradingOS": 0,
"total": 4
},
"lowPriority": {
"creating": 0,
"deallocated": 0,
"deallocating": 0,
"idle": 0,
"leavingPool": 0,
"offline": 0,
"preempted": 0,
"rebooting": 0,
"reimaging": 0,
"running": 0,
"starting": 0,
"startTaskFailed": 0,
"unknown": 0,
"unusable": 0,
"waitingForStartTask": 0,
"upgradingOS": 0,
"total": 0
}
},
{
"poolId": "pool3",
"dedicated": {
"creating": 0,
"deallocated": 0,
"deallocating": 0,
"idle": 5,
"leavingPool": 0,
"offline": 0,
"preempted": 0,
"rebooting": 0,
"reimaging": 4,
"running": 0,
"starting": 0,
"startTaskFailed": 0,
"unknown": 0,
"unusable": 0,
"waitingForStartTask": 0,
"upgradingOS": 0,
"total": 9
},
"lowPriority": {
"creating": 7,
"deallocated": 0,
"deallocating": 0,
"idle": 0,
"leavingPool": 0,
"offline": 0,
"preempted": 0,
"rebooting": 0,
"reimaging": 0,
"running": 4,
"starting": 0,
"startTaskFailed": 0,
"unknown": 0,
"unusable": 0,
"waitingForStartTask": 0,
"upgradingOS": 0,
"total": 11
}
}
]
}
定义
名称 | 说明 |
---|---|
Batch |
从 Azure Batch 服务收到的错误响应。 |
Batch |
Azure Batch 错误响应中包含的附加信息项。 |
Error |
Azure Batch 错误响应中收到的错误消息。 |
Node |
每个计算节点状态中的计算节点数。 |
Pool |
池处于每个状态的计算节点数。 |
Pool |
列出帐户中的计算节点计数的结果。 |
BatchError
从 Azure Batch 服务收到的错误响应。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
错误的标识符。 代码是固定的,旨在以编程方式使用。 |
message |
描述错误的消息,旨在适合在用户界面中显示。 |
|
values |
包含有关错误的更多详细信息的键值对的集合。 |
BatchErrorDetail
Azure Batch 错误响应中包含的附加信息项。
名称 | 类型 | 说明 |
---|---|---|
key |
string |
指定 Value 属性含义的标识符。 |
value |
string |
错误响应附带的其他信息。 |
ErrorMessage
Azure Batch 错误响应中收到的错误消息。
名称 | 类型 | 说明 |
---|---|---|
lang |
string |
错误消息的语言代码 |
value |
string |
消息的文本。 |
NodeCounts
每个计算节点状态中的计算节点数。
名称 | 类型 | 说明 |
---|---|---|
creating |
integer |
正在创建状态的计算节点数。 |
deallocated |
integer |
处于已解除分配状态的计算节点数。 |
deallocating |
integer |
处于解除分配状态的计算节点数。 |
idle |
integer |
处于空闲状态的计算节点数。 |
leavingPool |
integer |
处于 leavingPool 状态的计算节点数。 |
offline |
integer |
处于脱机状态的计算节点数。 |
preempted |
integer |
处于抢占状态的计算节点数。 |
rebooting |
integer |
处于重新启动状态的计算节点计数。 |
reimaging |
integer |
重新映像状态的计算节点数。 |
running |
integer |
处于运行状态的计算节点数。 |
startTaskFailed |
integer |
startTaskFailed 状态中的计算节点数。 |
starting |
integer |
处于开始状态的计算节点数。 |
total |
integer |
计算节点总数。 |
unknown |
integer |
处于未知状态的计算节点数。 |
unusable |
integer |
处于不可用状态的计算节点数。 |
upgradingOS |
integer |
正在升级OS 状态的计算节点数。 |
waitingForStartTask |
integer |
处于 waitingForStartTask 状态的计算节点数。 |
PoolNodeCounts
池处于每个状态的计算节点数。
名称 | 类型 | 说明 |
---|---|---|
dedicated |
每个状态中的专用计算节点数。 |
|
lowPriority |
每个状态下的现成/低优先级计算节点数。 |
|
poolId |
string |
池的 ID。 |
PoolNodeCountsListResult
列出帐户中的计算节点计数的结果。
名称 | 类型 | 说明 |
---|---|---|
odata.nextLink |
string |
用于获取下一组结果的 URL。 |
value |
按池列出的计算节点计数列表。 |