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!
依赖关系检测
StyleBook 中的组件可以引用同一 StyleBook 中其他组件的属性或部分。组件本身是完整的块,它们编写的顺序可能与执行顺序不同。StyleBook 编译器会检查组件的编写顺序,然后按逻辑顺序执行它们。
示例:
components:
-
name: lbvserver-comp
type: ns::lbvserver
properties:
name: mylb
ipv46: 10.102.190.15
port: 80
servicetype: HTTP
-
name: lb-sg-binding-comp
type: ns::lbvserver_servicegroup_binding
condition: $parameters.create-binding
properties:
name: $components.lbvserver-comp.properties.name
servicegroupname: $components.sg-comp.properties.servicegroupname
-
name: sg-comp
type: ns::servicegroup
properties:
servicegroupname: mysg
servicetype: HTTP
<!--NeedCopy-->
在上述示例中,定义了三个组件:lbvserver-comp、lb-sg-binding-comp 和 sg-comp。执行此 StyleBook 时,首先创建 lbvserver-comp。lb-sg-binding-comp 引用 lbvserver-comp 属性,但尽管它是 StyleBook 中定义的第二个组件,却不能紧接着创建。这是因为 lb-sg-binding-comp 还依赖于尚未创建的 sg-comp。因此,编译器会重新排序组件,以便在创建组件时解析其依赖关系,并执行此重新排序的组件列表。上述 StyleBook 的执行顺序是:lbvserver-comp、sg-comp 和 lb-sg-binding-comp。
因此,StyleBook 的作者无需担心组件的正确顺序。组件可以以任何顺序出现。编译器会根据组件之间的相互引用方式计算组件的正确执行顺序。请注意,这种依赖关系检测和重新排序也适用于替换和输出部分。
循环依赖关系
由于一个组件可能引用另一个组件,因此 StyleBook 的定义中可能会引入依赖关系循环。例如,如果组件 A 引用组件 B 中定义的属性,而组件 B 又引用组件 A 中定义的属性。这种依赖关系称为循环依赖关系。循环依赖关系无法自动解决。StyleBook 的作者应手动更正 StyleBook 定义以消除此类循环依赖关系。如果存在循环依赖关系,编译器将能够识别并报告。
以下示例显示了组件的循环依赖关系:
components:
-
name: lbvserver-comp
type: ns::lbvserver
properties:
name: $components.lb-sg-binding-comp.properties.name
ipv46: 10.102.190.15
port: 80
servicetype: HTTP
-
name: lb-sg-binding-comp
type: ns::lbvserver_servicegroup_binding
condition: $parameters.create-binding
properties:
name: mylb
servicegroupname: $components.sg-comp.properties.servicegroupname
-
name: sg-comp
type: ns::servicegroup
properties:
servicegroupname: mysg
servicetype: $components.lbvserver-comp.properties.servicetype
<!--NeedCopy-->
在上述示例中,有三个组件:lbvserver-comp、lb-sg-binding-comp 和 sg-comp。lbvserver-comp 依赖于 lb-sg-binding-comp,lb-sg-binding-comp 依赖于 sg-comp,sg-comp 依赖于 lbvserver-comp。这里,这些组件之间形成了依赖关系循环,无法自动解决。因此,此 StyleBook 无法执行。StyleBook 编译器会检测到这一点,并阻止 StyleBook 导入到 NetScaler® ADM 中。
共享
共享
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.