你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Account - List Pool Node Counts

获取每个状态中按池分组的计算节点数。 请注意,返回的数字可能并不总是最新的。 如果需要确切的节点计数,请使用列表查询。

GET {batchUrl}/nodecounts?api-version=2023-11-01.18.0
GET {batchUrl}/nodecounts?$filter={$filter}&maxresults={maxresults}&timeout={timeout}&api-version=2023-11-01.18.0

URI 参数

名称 必需 类型 说明
batchUrl
path True

string

所有Azure Batch服务请求的基 URL。

api-version
query True

string

客户端 API 版本。

$filter
query

string

OData $filter 子句。 有关构造此筛选器的详细信息,请参阅 https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch

maxresults
query

integer

int32

响应中要返回的最大项数。

timeout
query

integer

int32

服务器可以花费处理请求的最长时间(以秒为单位)。 默认为 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

PoolNodeCountsListResult

响应包含每个计算节点状态中的计算节点数,按池分组。

Headers

  • client-request-id: string
  • request-id: 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

名称 说明
user_impersonation 模拟用户帐户

Authorization

Type: apiKey
In: header

示例

NodeCountsPayload

Sample Request

GET account.region.batch.azure.com/nodecounts?api-version=2023-11-01.18.0


Sample Response

{
  "value": [
    {
      "poolId": "pool1",
      "dedicated": {
        "creating": 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,
        "total": 0
      },
      "lowPriority": {
        "creating": 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,
        "total": 3
      }
    },
    {
      "poolId": "pool2",
      "dedicated": {
        "creating": 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,
        "total": 4
      },
      "lowPriority": {
        "creating": 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,
        "total": 0
      }
    },
    {
      "poolId": "pool3",
      "dedicated": {
        "creating": 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,
        "total": 9
      },
      "lowPriority": {
        "creating": 7,
        "idle": 0,
        "leavingPool": 0,
        "offline": 0,
        "preempted": 0,
        "rebooting": 0,
        "reimaging": 0,
        "running": 4,
        "starting": 0,
        "startTaskFailed": 0,
        "unknown": 0,
        "unusable": 0,
        "waitingForStartTask": 0,
        "total": 11
      }
    }
  ]
}

定义

名称 说明
BatchError

从Azure Batch服务收到的错误响应。

BatchErrorDetail

Azure Batch错误响应中包含的其他信息项。

ErrorMessage

Azure Batch错误响应中收到的错误消息。

NodeCounts

每个计算节点状态中的计算节点数。

PoolNodeCounts

池处于每个状态的计算节点数。

PoolNodeCountsListResult

在帐户中列出计算节点计数的结果。

BatchError

从Azure Batch服务收到的错误响应。

名称 类型 说明
code

string

错误的标识符。 代码是固定的,旨在以编程方式使用。

message

ErrorMessage

描述错误的消息,该消息适用于在用户界面中显示。

values

BatchErrorDetail[]

包含有关错误的其他详细信息的键值对的集合。

BatchErrorDetail

Azure Batch错误响应中包含的其他信息项。

名称 类型 说明
key

string

指定 Value 属性含义的标识符。

value

string

错误响应附带的其他信息。

ErrorMessage

Azure Batch错误响应中收到的错误消息。

名称 类型 说明
lang

string

错误消息的语言代码

value

string

消息的文本。

NodeCounts

每个计算节点状态中的计算节点数。

名称 类型 说明
creating

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

处于不可用状态的计算节点数。

waitingForStartTask

integer

处于 waitingForStartTask 状态的计算节点数。

PoolNodeCounts

池处于每个状态的计算节点数。

名称 类型 说明
dedicated

NodeCounts

每个状态的专用计算节点数。

lowPriority

NodeCounts

处于每个状态的现成/低优先级计算节点数。

poolId

string

池的 ID。

PoolNodeCountsListResult

在帐户中列出计算节点计数的结果。

名称 类型 说明
odata.nextLink

string

用于获取下一组结果的 URL。

value

PoolNodeCounts[]

按池列出的计算节点计数。