共用方式為


Pool - List Usage Metrics

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

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

URI 參數

名稱 位於 必要 類型 Description
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#list-account-usage-metrics

endtime
query

string

date-time

要包含計量的最近時間。 這必須在目前時間之前至少兩小時。 如果未指定,則預設為目前可用最後一個匯總間隔的結束時間。

maxresults
query

integer

int32

回應中要傳回的項目數目上限。 最多會傳回 1000 個結果。

starttime
query

string

date-time

要包含計量的最早時間。 這必須在目前時間之前至少兩到半小時。 如果未指定,則預設為目前可用之最後一個匯總間隔的開始時間。

timeout
query

integer

int32

伺服器可以花費在處理要求的最大時間,以秒為單位。 預設值為 30 秒。

要求標頭

Media Types: "application/json; odata=minimalmetadata"

名稱 必要 類型 Description
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,請明確設定它。

回應

名稱 類型 Description
200 OK

PoolListUsageMetricsResult

包含集區使用量詳細數據清單的回應。

標題

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

BatchError

Batch 服務的錯誤。

安全性

azure_auth

Microsoft Entra OAuth 2.0 驗證碼流程

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

範圍

名稱 Description
user_impersonation 模擬您的用戶帳戶

Authorization

類型: apiKey
位於: header

範例

Pool list usage metrics

範例要求

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


範例回覆

{
  "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 錯誤回應中包含的其他信息專案。

ErrorMessage

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

PoolListUsageMetricsResult

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

PoolUsageMetrics

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

BatchError

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

名稱 類型 Description
code

string

錯誤的識別碼。 程式碼不變,且要以程式設計方式使用。

message

ErrorMessage

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

values

BatchErrorDetail[]

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

BatchErrorDetail

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

名稱 類型 Description
key

string

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

value

string

錯誤回應中包含的其他資訊。

ErrorMessage

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

名稱 類型 Description
lang

string

錯誤訊息的語言代碼

value

string

訊息的文字。

PoolListUsageMetricsResult

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

名稱 類型 Description
odata.nextLink

string

要取得下一組結果的URL。

value

PoolUsageMetrics[]

集區使用計量數據。

PoolUsageMetrics

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

名稱 類型 Description
endTime

string

這個專案所涵蓋匯總間隔的結束時間。

poolId

string

集區的標識碼,其計量會在此專案中匯總。

startTime

string

這個專案所涵蓋匯總間隔的開始時間。

totalCoreHours

number

在此匯總間隔期間集區中使用的總核心時數。

vmSize

string

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