SslConfiguration 類別

表示要與 AksCompute 搭配使用的 SSL 組態物件。

初始化 SslConfiguration 物件。

繼承
builtins.object
SslConfiguration

建構函式

SslConfiguration(status=None, cert=None, key=None, cname=None, leaf_domain_label=None, overwrite_existing_domain=False, renew=False)

參數

status
str
預設值: None

指出 SSL 驗證是否已啟用、停用或自動驗證。

cert
str
預設值: None

用於 SSL 驗證的憑證字串。 如果提供,您也必須提供 cnamekey PEM 檔案

key
str
預設值: None

要用於 SSL 驗證的金鑰字串。 如果提供,您也必須提供 cnamecert PEM 檔案

cname
str
預設值: None

用於 SSL 驗證的 CNAME。 如果提供,您也必須提供 certkey PEM 檔案。

leaf_domain_label
str
預設值: None

要用於自動產生憑證的分葉網域標籤。

overwrite_existing_domain
bool
預設值: False

指出是否要覆寫現有的分葉網域標籤。 預設值是 False。

renew
bool
預設值: False

指出是否 leaf_domain_label 重新整理自動產生的憑證。 如果提供,則必須自動設定現有的 SSL 組態。預設值為 False。

status
str
必要

指出 SSL 驗證是否已啟用、停用或自動驗證。

cert
str
必要

用於 SSL 驗證的憑證字串。 如果提供,您也必須提供 cnamekey PEM 檔案

key
str
必要

要用於 SSL 驗證的金鑰字串。 如果提供,您也必須提供 cnamecert PEM 檔案

cname
str
必要

用於 SSL 驗證的 CNAME。 如果提供,您也必須提供 certkey PEM 檔案。

leaf_domain_label
str
必要

要用於自動產生憑證的分葉網域標籤。

overwrite_existing_domain
bool
必要

指出是否要覆寫現有的分葉網域標籤。 預設值是 False。

renew
bool
必要

指出是否 leaf_domain_label 重新整理自動產生的憑證。 如果提供,則必須自動設定現有的 SSL 組態。預設值為 False。

備註

若要設定 SSL,請指定 leaf_domain_label 參數或參數 cnamecertkey

指定 SSL 組態的一般模式是使用 attach_configuration 類別的 AksComputeprovisioning_configuration 方法來取得組態物件。 然後,使用 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)

參數

object_dict
dict
必要

要轉換成 SslConfiguration 物件的 JSON 物件。

傳回

所提供 JSON 物件的 SslConfiguration 標記法。

傳回類型

例外狀況

serialize

將此 SslConfiguration 物件轉換成 JSON 序列化字典。

serialize()

傳回

這個 SslConfiguration 物件的 JSON 表示。

傳回類型

例外狀況