Pools - List Pool Node Counts
取得依集區分組之每個狀態的計算節點數目。 請注意,傳回的數位不一定是最新的。 如果您需要確切的節點計數,請使用清單查詢。
GET {endpoint}/nodecounts?api-version=2025-06-01
GET {endpoint}/nodecounts?api-version=2025-06-01&timeOut={timeOut}&maxresults={maxresults}&$filter={$filter}
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
endpoint
|
path | True |
string (uri) |
Batch 帳戶端點 (例如:https://batchaccount.eastus2.batch.azure.com)。 |
|
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-support-images。 |
|
|
maxresults
|
query |
integer (int32) minimum: 1maximum: 1000 |
回應中要傳回的項目數目上限。 最多可提交1000份申請。 |
|
|
time
|
query |
integer (int32) |
伺服器可以花費數秒處理要求的時間上限。 預設值為 30 秒。 若值大於30,則會使用預設值。」 |
要求標頭
| 名稱 | 必要 | 類型 | Description |
|---|---|---|---|
| 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,請明確設定它。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
要求已成功。 標題
|
|
| Other Status Codes |
未預期的錯誤回應。 |
安全性
OAuth2Auth
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
範圍
| 名稱 | Description |
|---|---|
| https://batch.core.windows.net//.default |
範例
NodeCountsPayload
範例要求
GET {endpoint}/nodecounts?api-version=2025-06-01
範例回覆
{
"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
}
}
]
}
定義
| 名稱 | Description |
|---|---|
|
Batch |
從 Azure Batch 服務收到的錯誤回應。 |
|
Batch |
Azure Batch 錯誤回應中包含的其他信息專案。 |
|
Batch |
Azure Batch 錯誤回應中收到的錯誤訊息。 |
|
Batch |
每個計算節點狀態的計算節點數目。 |
|
Batch |
集區每個狀態的計算節點數目。 |
|
Batch |
列出帳戶中計算節點計數的結果。 |
BatchError
從 Azure Batch 服務收到的錯誤回應。
| 名稱 | 類型 | Description |
|---|---|---|
| code |
string |
錯誤的識別碼。 程序代碼是不變的,而且是要以程序設計方式取用。 |
| message |
描述錯誤的訊息,適用於在使用者介面中顯示。 |
|
| values |
索引鍵/值組的集合,其中包含錯誤的其他詳細數據。 |
BatchErrorDetail
Azure Batch 錯誤回應中包含的其他信息專案。
| 名稱 | 類型 | Description |
|---|---|---|
| key |
string |
指定 Value 屬性意義的識別碼。 |
| value |
string |
錯誤回應隨附的其他資訊。 |
BatchErrorMessage
Azure Batch 錯誤回應中收到的錯誤訊息。
| 名稱 | 類型 | Description |
|---|---|---|
| lang |
string |
錯誤訊息的語言代碼。 |
| value |
string |
訊息的文字。 |
BatchNodeCounts
每個計算節點狀態的計算節點數目。
| 名稱 | 類型 | Description |
|---|---|---|
| creating |
integer (int32) |
建立狀態下的計算節點數量。 |
| deallocated |
integer (int32) |
處於已解除配置狀態的計算節點數量。 |
| deallocating |
integer (int32) |
處於釋放狀態的計算節點數量。 |
| idle |
integer (int32) |
閒置狀態下計算節點的數量。 |
| leavingPool |
integer (int32) |
處於 reavingPool 狀態的計算節點數量。 |
| offline |
integer (int32) |
離線狀態下的運算節點數量。 |
| preempted |
integer (int32) |
佔據式運算節點的數量。 |
| rebooting |
integer (int32) |
重新啟動狀態下的計算節點數量。 |
| reimaging |
integer (int32) |
重映像狀態下的計算節點數量。 |
| running |
integer (int32) |
運算節點數為運行狀態。 |
| startTaskFailed |
integer (int32) |
startTaskFailed 狀態下的計算節點數量。 |
| starting |
integer (int32) |
起始狀態下的計算節點數量。 |
| total |
integer (int32) |
計算節點的總數。 |
| unknown |
integer (int32) |
未知狀態的計算節點數量。 |
| unusable |
integer (int32) |
計算節點數為無法使用的狀態。 |
| upgradingOS |
integer (int32) |
升級作業系統狀態下的運算節點數量。 |
| waitingForStartTask |
integer (int32) |
等待ForStartTask狀態下的計算節點數量。 |
BatchPoolNodeCounts
集區每個狀態的計算節點數目。
| 名稱 | 類型 | Description |
|---|---|---|
| dedicated |
每個狀態中專用運算節點的數量。 |
|
| lowPriority |
每個狀態中 Spot/Low priority 運算節點的數量。 |
|
| poolId |
string |
泳池的識別碼。 |
BatchPoolNodeCountsListResult
列出帳戶中計算節點計數的結果。
| 名稱 | 類型 | Description |
|---|---|---|
| odata.nextLink |
string (uri) |
取得下一組結果的 URL。 |
| value |
依池數計算節點的清單。 |