SslConfiguration 類別
表示與 AksCompute 搭配使用的 SSL 組態物件。
初始化 SslConfiguration 物件。
建構函式
SslConfiguration(status=None, cert=None, key=None, cname=None, leaf_domain_label=None, overwrite_existing_domain=False, renew=False)
參數
| 名稱 | Description |
|---|---|
|
status
|
指出 SSL 驗證已啟用、停用或自動驗證。 預設值: None
|
|
cert
|
要用於 SSL 驗證的憑證字串。 如果提供,您也必須提供 預設值: None
|
|
key
|
要用於 SSL 驗證的金鑰字串。 如果提供,您也必須提供 預設值: None
|
|
cname
|
要用於 SSL 驗證的 CNAME。 如果提供,您也必須提供 預設值: None
|
|
leaf_domain_label
|
要用於自動產生憑證的分葉網域標籤。 預設值: None
|
|
overwrite_existing_domain
|
指出是否要覆寫現有的分葉網域標籤。 預設值為 False。 預設值: False
|
|
renew
|
指出是否 預設值: False
|
|
status
必要
|
指出 SSL 驗證已啟用、停用或自動驗證。 |
|
cert
必要
|
要用於 SSL 驗證的憑證字串。 如果提供,您也必須提供 |
|
key
必要
|
要用於 SSL 驗證的金鑰字串。 如果提供,您也必須提供 |
|
cname
必要
|
要用於 SSL 驗證的 CNAME。 如果提供,您也必須提供 |
|
leaf_domain_label
必要
|
要用於自動產生憑證的分葉網域標籤。 |
|
overwrite_existing_domain
必要
|
指出是否要覆寫現有的分葉網域標籤。 預設值為 False。 |
|
renew
必要
|
指出是否 |
備註
若要設定 SSL,請指定 leaf_domain_label 參數或參數 cname、 cert和 key。
指定 SSL 組態的一般模式是使用 attach_configuration 類別的 provisioning_configuration 或 AksCompute 方法來取得組態物件。 然後,使用 enable_ssl 傳回組態物件的方法。 例如,針對附加組態,請使用 enable_ssl 方法。
# Load workspace configuration from the config.json file.
from azureml.core import Workspace
ws = Workspace.from_config()
# Use the default configuration, but you can also provide parameters to customize.
from azureml.core.compute import AksCompute
prov_config = AksCompute.provisioning_configuration()
attach_config = AksCompute.attach_configuration(resource_group=ws.resource_group,
cluster_name="dev-cluster")
# Enable ssl.
prov_config.enable_ssl(leaf_domain_label = "contoso")
attach_config.enable_ssl(leaf_domain_label = "contoso")
如需啟用 AKS SSL 的詳細資訊,請參閱 使用 SSL 透過 Azure Machine Learning 保護 Web 服務。
方法
| deserialize |
將 JSON 物件轉換成 SslConfiguration 物件。 |
| serialize |
將此 SslConfiguration 物件轉換成 JSON 串行化字典。 |
deserialize
將 JSON 物件轉換成 SslConfiguration 物件。
static deserialize(object_dict)
參數
| 名稱 | Description |
|---|---|
|
object_dict
必要
|
要轉換成 SslConfiguration 物件的 JSON 物件。 |
傳回
| 類型 | Description |
|---|---|
|
所提供 JSON 物件的 SslConfiguration 表示法。 |
例外狀況
| 類型 | Description |
|---|---|
serialize
將此 SslConfiguration 物件轉換成 JSON 串行化字典。
serialize()
傳回
| 類型 | Description |
|---|---|
|
這個 SslConfiguration 物件的 JSON 表示法。 |