ComputeInstance 類別

計算實例資源。

繼承
azure.ai.ml.entities._compute.compute.Compute
ComputeInstance

建構函式

ComputeInstance(*, name: str, description: str | None = None, size: str | None = None, tags: dict | None = None, ssh_public_access_enabled: bool | None = None, create_on_behalf_of: AssignedUserConfiguration | None = None, network_settings: NetworkSettings | None = None, ssh_settings: ComputeInstanceSshSettings | None = None, schedules: ComputeSchedules | None = None, identity: IdentityConfiguration | None = None, idle_time_before_shutdown: str | None = None, idle_time_before_shutdown_minutes: int | None = None, setup_scripts: SetupScripts | None = None, enable_node_public_ip: bool = True, custom_applications: List[CustomApplications] | None = None, **kwargs)

參數

name
str
必要

計算的名稱。

location
Optional[str]
必要

資源位置。

description
Optional[str]
必要

資源的描述。

size
Optional[str]
必要

計算大小。

tags
Optional[dict[str, str]]
必要

一組標記。 包含定義為索引鍵/值組的資源標記。

create_on_behalf_of
Optional[AssignedUserConfiguration]
必要

代表其他使用者建立資源的組態。 預設為 [無]。

network_settings
Optional[NetworkSettings]
必要

計算實例的網路設定。

ssh_settings
Optional[ComputeInstanceSshSettings]
必要

計算實例的 SSH 設定。

ssh_public_access_enabled
Optional[bool]
必要

公用 SSH 埠的狀態。 預設為 [無]。 可能的值包括:

  • False - 表示公用 SSH 埠已關閉叢集的所有節點上。

  • True - 表示叢集的所有節點上都已開啟公用 SSH 埠。

  • 無 -指出已定義 VNet 時,叢集的所有節點上都會關閉公用 SSH 埠。

    else 是開啟所有公用節點。 它只能在叢集建立期間預設,在建立之後會是 True 或 False。

schedules
Optional[ComputeSchedules]
必要

計算實例排程。 預設為 [無]。

identity
IdentityConfiguration
必要

與計算叢集相關聯的身分識別。

idle_time_before_shutdown
Optional[str]
必要

已取代。 請改用 idle_time_before_shutdown_minutes 參數。 在使用者定義閒置期間之後停止計算實例。 時間是以ISO8601格式定義。 最小值為 15 分鐘,最大值為 3 天。

idle_time_before_shutdown_minutes
Optional[int]
必要

在使用者定義閒置期間幾分鐘後停止計算實例。 最小值為 15 分鐘,最大值為 3 天。

enable_node_public_ip
Optional[bool]
必要

啟用或停用節點公用 IP 位址布建。 預設值為 True。 可能的值包括:

  • True - 表示計算節點會布建公用 IP。

  • False - 表示計算節點會有私人端點,且沒有公用 IP。

setup_scripts
Optional[SetupScripts]
必要

要執行以設定叢集的自訂腳本詳細資料。

custom_applications
Optional[List[CustomApplications]]
必要

計算實例的自訂應用程式和其端點清單。

Keyword-Only Parameters

name
必要
description
必要
size
必要
tags
必要
ssh_public_access_enabled
必要
create_on_behalf_of
必要
network_settings
必要
ssh_settings
必要
schedules
必要
identity
必要
idle_time_before_shutdown
必要
idle_time_before_shutdown_minutes
必要
setup_scripts
必要
enable_node_public_ip
預設值: True
custom_applications
必要

範例

建立 ComputeInstance 物件。


   from azure.ai.ml.entities import ComputeInstance

   ci = ComputeInstance(
       name=ci_name,
       size="Standard_DS2_v2",
   )
   ml_client.compute.begin_create_or_update(ci)

變數

state

資源的狀態。

last_operation

最後一個作業。

applications

與計算實例相關聯的應用程式。

方法

dump

以 yaml 格式將計算內容傾印到檔案中。

dump

以 yaml 格式將計算內容傾印到檔案中。

dump(dest: str | PathLike | IO, **kwargs) -> None

參數

dest
Union[<xref:PathLike>, str, IO[AnyStr]]
必要

接收此計算內容的目的地。 必須是本機檔案的路徑,或是已開啟的檔案資料流程。 如果 dest 是檔案路徑,則會建立新的檔案,並在檔案存在時引發例外狀況。 如果 dest 是開啟的檔案,檔案將直接寫入,如果檔案無法寫入,則會引發例外狀況。'

屬性

base_path

資源的基底路徑。

傳回

資源的基底路徑。

傳回類型

str

created_on

計算資源建立時間戳記。

傳回

計算資源建立時間戳記。

傳回類型

creation_context

資源的建立內容。

傳回

資源的建立中繼資料。

傳回類型

id

資源識別碼。

傳回

資源的全域識別碼,Azure Resource Manager (ARM) 識別碼。

傳回類型

last_operation

最後一個作業。

傳回

最後一個作業。

傳回類型

str

os_image_metadata

此計算實例之作業系統映射的相關中繼資料。

傳回

作業系統映射中繼資料。

傳回類型

provisioning_errors

計算資源布建錯誤。

傳回

計算資源布建錯誤。

傳回類型

provisioning_state

計算資源的布建狀態。

傳回

計算資源的布建狀態。

傳回類型

services

計算實例的服務。

傳回

計算實例的服務。

傳回類型

state

計算的狀態。

傳回

計算的狀態。

傳回類型

str

type

計算類型。

傳回

計算類型。

傳回類型