SslConfiguration 类
表示用于 AksCompute 的 SSL 配置对象。
初始化 SslConfiguration 对象。
构造函数
SslConfiguration(status=None, cert=None, key=None, cname=None, leaf_domain_label=None, overwrite_existing_domain=False, renew=False)
参数
| 名称 | 说明 |
|---|---|
|
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 机器学习保护 Web 服务。
方法
| deserialize |
将 JSON 对象转换为 SslConfiguration 对象。 |
| serialize |
将此 SslConfiguration 对象转换为 JSON 序列化字典。 |
deserialize
将 JSON 对象转换为 SslConfiguration 对象。
static deserialize(object_dict)
参数
| 名称 | 说明 |
|---|---|
|
object_dict
必需
|
要转换为 SslConfiguration 对象的 JSON 对象。 |
返回
| 类型 | 说明 |
|---|---|
|
提供的 JSON 对象的 SslConfiguration 表示形式。 |
例外
| 类型 | 说明 |
|---|---|