This content has been machine translated dynamically.
Dieser Inhalt ist eine maschinelle Übersetzung, die dynamisch erstellt wurde. (Haftungsausschluss)
Cet article a été traduit automatiquement de manière dynamique. (Clause de non responsabilité)
Este artículo lo ha traducido una máquina de forma dinámica. (Aviso legal)
此内容已经过机器动态翻译。 放弃
このコンテンツは動的に機械翻訳されています。免責事項
이 콘텐츠는 동적으로 기계 번역되었습니다. 책임 부인
Este texto foi traduzido automaticamente. (Aviso legal)
Questo contenuto è stato tradotto dinamicamente con traduzione automatica.(Esclusione di responsabilità))
This article has been machine translated.
Dieser Artikel wurde maschinell übersetzt. (Haftungsausschluss)
Ce article a été traduit automatiquement. (Clause de non responsabilité)
Este artículo ha sido traducido automáticamente. (Aviso legal)
この記事は機械翻訳されています.免責事項
이 기사는 기계 번역되었습니다.책임 부인
Este artigo foi traduzido automaticamente.(Aviso legal)
这篇文章已经过机器翻译.放弃
Questo articolo è stato tradotto automaticamente.(Esclusione di responsabilità))
Translation failed!
条件构造
您可以使用条件构造使组件具有条件性。条件构造的值是一个布尔表达式,其评估结果为 true 或 false。如果条件为 true,则使用该组件来构建其配置对象。如果条件为 false,则跳过该组件,并且不会通过它创建任何配置对象。布尔表达式通常基于参数值。
示例:
components:
-
name: servicegroup-comp
type: ns::servicegroup
condition: $parameters.svc-server-ips
properties:
name: $parameters.name + "-svcgrp"
servicetype: HTTP
<!--NeedCopy-->
在此示例中,如果用户为可选参数 svc-server-ips 指定了值,则 StyleBook 引擎将处理组件 servicegroup-comp。如果条件为 false,即用户未向此参数提供值,则此参数将分配一个空值并评估为 false,StyleBook 引擎将忽略此组件的存在,并且不会创建任何服务组。
请注意,布尔表达式可以基于 StyleBook 中支持的任何有效表达式(例如,是否存在另一个组件,或者参数是否具有特定值)。
以下示例在条件评估为 true 时构建 NITRO 类型 ns::systemfile 的配置对象。
示例:
components
-
name: pem_key_files
type: ns::systemfile
condition: "$components.der-certificate-files-comp or $components.pem-certificate-files-comp"
properties:
filecontent: $certificate.keyfile.contents
fileencoding: "BASE64"
filelocation: "/nsconfig/ssl"
filename: $certificate.keyfile.filename
<!--NeedCopy-->
在此示例中,条件是一个复杂的“或”表达式,您希望仅当 StyleBook 中的其他两个组件已处理(未跳过)时,才由 StyleBook 创建此配置对象,从而在组件之间创建依赖关系。
共享
共享
This Preview product documentation is Cloud Software Group Confidential.
You agree to hold this documentation confidential pursuant to the terms of your Cloud Software Group Beta/Tech Preview Agreement.
The development, release and timing of any features or functionality described in the Preview documentation remains at our sole discretion and are subject to change without notice or consultation.
The documentation is for informational purposes only and is not a commitment, promise or legal obligation to deliver any material, code or functionality and should not be relied upon in making Cloud Software Group product purchase decisions.
If you do not agree, select I DO NOT AGREE to exit.