共用方式為


Nodes - Disable Node Scheduling

在指定的計算節點上停用任務排程。
只有當運算節點目前的排程狀態已啟用時,才能關閉任務排程。

POST {endpoint}/pools/{poolId}/nodes/{nodeId}/disablescheduling?api-version=2025-06-01
POST {endpoint}/pools/{poolId}/nodes/{nodeId}/disablescheduling?api-version=2025-06-01&timeOut={timeOut}

URI 參數

名稱 位於 必要 類型 Description
endpoint
path True

string (uri)

Batch 帳戶端點 (例如:https://batchaccount.eastus2.batch.azure.com)。

nodeId
path True

string

你想停用任務排程的計算節點的 ID。

poolId
path True

string

包含計算節點的集區識別碼。

api-version
query True

string

minLength: 1

要用於這項作業的 API 版本。

timeOut
query

integer (int32)

伺服器可以花費數秒處理要求的時間上限。 預設值為 30 秒。 若值大於30,則會使用預設值。」

要求標頭

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

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

要求本文

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

名稱 類型 Description
nodeDisableSchedulingOption

BatchNodeDisableSchedulingOption

在關閉計算節點的任務排程時,目前執行任務該怎麼辦? 預設值為重新排入佇列。

回應

名稱 類型 Description
200 OK

要求已成功。

標題

  • DataServiceId: string
  • 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

範例

Node disable scheduling

範例要求

POST {endpoint}/pools/poolId/nodes/tvm-1695681911_1-20161122t193202z/disablescheduling?api-version=2025-06-01


範例回覆

定義

名稱 Description
BatchError

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

BatchErrorDetail

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

BatchErrorMessage

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

BatchNodeDisableSchedulingOption

BatchNodeDisableSchedulingOption 枚舉

BatchNodeDisableSchedulingOptions

在 Azure Batch 計算節點上停用排程的參數。

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

訊息的文字。

BatchNodeDisableSchedulingOption

BatchNodeDisableSchedulingOption 枚舉

Description
requeue

終止執行中的工作進程並重新排入佇列。 任務可在其他計算節點上再次執行,或當該計算節點重新啟用任務排程時。 任務結束後立即進入離線狀態。

terminate

終止執行中的工作。 工作將會以 failureInfo 完成,指出它們已終止,而且不會再次執行。 任務結束後立即進入離線狀態。

taskcompletion

允許目前正在執行的工作完成。 在等候時排程沒有新的工作。 當所有任務完成後,進入離線狀態。

BatchNodeDisableSchedulingOptions

在 Azure Batch 計算節點上停用排程的參數。

名稱 類型 Description
nodeDisableSchedulingOption

BatchNodeDisableSchedulingOption

在關閉計算節點的任務排程時,目前執行任務該怎麼辦? 預設值為重新排入佇列。