Pool - Evaluate Auto Scale
取得評估集區上自動調整公式的結果。
此 API 主要是用來驗證自動調整公式,因為它只會傳回結果,而不需要將公式套用至集區。 集區必須啟用自動調整,才能評估公式。
POST {batchUrl}/pools/{poolId}/evaluateautoscale?api-version=2023-11-01.18.0
POST {batchUrl}/pools/{poolId}/evaluateautoscale?timeout={timeout}&api-version=2023-11-01.18.0
URI 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
batch
|
path | True |
string |
所有 Azure Batch 服務要求的基底 URL。 |
pool
|
path | True |
string |
要評估自動調整公式的集區標識碼。 |
api-version
|
query | True |
string |
用戶端 API 版本。 |
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,請明確設定它。 |
要求本文
Media Types: "application/json; odata=minimalmetadata"
名稱 | 必要 | 類型 | Description |
---|---|---|---|
autoScaleFormula | True |
string |
集區中所需計算節點數目的公式。 |
回應
名稱 | 類型 | Description |
---|---|---|
200 OK |
包含自動調整評估結果的回應。 Headers
|
|
Other Status Codes |
Batch 服務的錯誤。 |
安全性
azure_auth
Microsoft Entra OAuth 2.0 驗證碼流程
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名稱 | Description |
---|---|
user_impersonation | 模擬您的用戶帳戶 |
Authorization
Type:
apiKey
In:
header
範例
Pool evaluate autoscale
Sample Request
POST account.region.batch.azure.com/pools/poolId/evaluateautoscale?api-version=2023-11-01.18.0
{
"autoScaleFormula": "$TargetDedicated=1"
}
Sample Response
{
"timestamp": "2016-11-22T19:39:28.5246331Z",
"results": "$TargetDedicated=1;$NodeDeallocationOption=requeue"
}
定義
名稱 | Description |
---|---|
Auto |
集區自動調整公式執行的結果和錯誤。 |
Auto |
執行或評估集區自動調整公式時發生的錯誤。 |
Batch |
從 Azure Batch 服務收到的錯誤回應。 |
Batch |
Azure Batch 錯誤回應中包含的其他信息專案。 |
Error |
在 Azure Batch 錯誤回應中收到的錯誤訊息。 |
Name |
表示名稱/值組。 |
Pool |
評估集區上自動調整公式的選項。 |
AutoScaleRun
集區自動調整公式執行的結果和錯誤。
名稱 | 類型 | Description |
---|---|---|
error |
如果評估失敗,則評估集區上自動調整公式時所遇到的錯誤詳細數據。 |
|
results |
string |
自動調整公式評估中使用的所有變數最終值。 |
timestamp |
string |
上次評估自動調整公式的時間。 |
AutoScaleRunError
執行或評估集區自動調整公式時發生的錯誤。
名稱 | 類型 | Description |
---|---|---|
code |
string |
自動調整錯誤的識別碼。 程式碼不變,且要以程式設計方式使用。 |
message |
string |
描述自動調整錯誤的訊息,適用於在使用者介面中顯示。 |
values |
與自動調整錯誤相關的其他錯誤詳細數據清單。 |
BatchError
從 Azure Batch 服務收到的錯誤回應。
名稱 | 類型 | Description |
---|---|---|
code |
string |
錯誤的識別碼。 程式碼不變,且要以程式設計方式使用。 |
message |
描述錯誤的訊息,適用於在使用者介面中顯示。 |
|
values |
索引鍵/值組的集合,其中包含錯誤的其他詳細數據。 |
BatchErrorDetail
Azure Batch 錯誤回應中包含的其他信息專案。
名稱 | 類型 | Description |
---|---|---|
key |
string |
指定 Value 屬性意義的識別碼。 |
value |
string |
錯誤回應中包含的其他資訊。 |
ErrorMessage
在 Azure Batch 錯誤回應中收到的錯誤訊息。
名稱 | 類型 | Description |
---|---|---|
lang |
string |
錯誤訊息的語言代碼 |
value |
string |
訊息的文字。 |
NameValuePair
表示名稱/值組。
名稱 | 類型 | Description |
---|---|---|
name |
string |
name-value 配對中的名稱。 |
value |
string |
name-value 配對中的值。 |
PoolEvaluateAutoScaleParameter
評估集區上自動調整公式的選項。
名稱 | 類型 | Description |
---|---|---|
autoScaleFormula |
string |
集區中所需計算節點數目的公式。 |