SslConfiguration 类

表示用于 AksCompute 的 SSL 配置对象。

继承
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。

注解

若要配置 SSL,请指定 leaf_domain_label 参数或参数 cnamecertkey

用于指定 SSL 配置的典型模式是使用 AksCompute 类的 attach_configurationprovisioning_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 机器学习保护 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 表示形式。

返回类型

例外