共用方式為


Pools - List Pool Usage Metrics

針對指定的帳戶,列出集區針對個別時間間隔匯總的使用計量。
如果您未指定包含 poolId 的$filter子句,回應會包含帳戶中所有存在於傳回匯總間隔時間範圍內的集區。 如果您未指定$filter子句,包括 startTime 或 endTime,這些篩選會預設為目前可用之最後一個匯總間隔的開始和結束時間;也就是說,只會傳回最後一個匯總間隔。

GET {endpoint}/poolusagemetrics?api-version=2025-06-01
GET {endpoint}/poolusagemetrics?api-version=2025-06-01&timeOut={timeOut}&maxresults={maxresults}&startTime={startTime}&endtime={endtime}&$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-account-usage-metrics

endtime
query

string (date-time)

這是包含指標的最後時間點。 這必須比目前時間早至少兩小時。 若未指定,則預設為目前可用最後一次聚合區間的結束時間。

maxresults
query

integer (int32)

minimum: 1
maximum: 1000

回應中要傳回的項目數目上限。 最多可提交1000份申請。

startTime
query

string (date-time)

最早納入度量的時間點。 這必須比目前時間早至少兩個半小時。 若未指定,則預設為目前可用最後一次聚合區間的開始時間。

timeOut
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

BatchPoolListUsageMetricsResult

要求已成功。

標題

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

BatchError

未預期的錯誤回應。

安全性

OAuth2Auth

類型: oauth2
Flow: implicit
授權 URL: https://login.microsoftonline.com/common/oauth2/v2.0/authorize

範圍

名稱 Description
https://batch.core.windows.net//.default

範例

Pool list usage metrics

範例要求

GET {endpoint}/poolusagemetrics?api-version=2025-06-01


範例回覆

{
  "value": [
    {
      "startTime": "2013-04-01T00:00:00Z",
      "endTime": "2013-04-01T00:30:00Z",
      "poolId": "p1",
      "vmSize": "a1",
      "totalCoreHours": 39.384838
    },
    {
      "startTime": "2013-04-01T00:30:00Z",
      "endTime": "2013-04-01T01:00:00Z",
      "poolId": "p2",
      "vmSize": "a8",
      "totalCoreHours": 3039.384838
    }
  ]
}

定義

名稱 Description
BatchError

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

BatchErrorDetail

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

BatchErrorMessage

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

BatchPoolListUsageMetricsResult

列出帳戶使用計量的結果。

BatchPoolUsageMetrics

跨匯總間隔的集區使用計量。

BatchError

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

名稱 類型 Description
code

string

錯誤的識別碼。 程序代碼是不變的,而且是要以程序設計方式取用。

message

BatchErrorMessage

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

values

BatchErrorDetail[]

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

BatchErrorDetail

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

名稱 類型 Description
key

string

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

value

string

錯誤回應隨附的其他資訊。

BatchErrorMessage

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

名稱 類型 Description
lang

string

錯誤訊息的語言代碼。

value

string

訊息的文字。

BatchPoolListUsageMetricsResult

列出帳戶使用計量的結果。

名稱 類型 Description
odata.nextLink

string (uri)

取得下一組結果的 URL。

value

BatchPoolUsageMetrics[]

池使用量數據。

BatchPoolUsageMetrics

跨匯總間隔的集區使用計量。

名稱 類型 Description
endTime

string (date-time)

本條目涵蓋的聚合區間結束時間。

poolId

string

本條目中彙整的指標池的ID。

startTime

string (date-time)

本條目涵蓋的聚合區間開始時間。

totalCoreHours

number (float)

此彙整期間池中所使用的總核心時數。

vmSize

string

集區中的虛擬機大小。 池中所有虛擬機大小相同。 如需集區中虛擬機可用大小的相關信息,請參閱在 Azure Batch 集區中為計算節點選擇 VM 大小(https://learn.microsoft.com/azure/batch/batch-pool-vm-sizes)。