Components 编辑

The Components construct in a StyleBook is considered as the most important section in the StyleBook. In this section, you define the configuration objects that have to be created. Using this construct, you can build one or multiple configuration objects of the same type.

The components construct can use the input provided in the parameters section to adapt the configuration generated by the StyleBook. This is an optional section, although most StyleBooks have a components section.

The following table describes the main attributes of a component.

AttributeDescription
nameThe name of the component. You can specify an alphanumeric name. The name must begin with an alphabet, and can include additional alphabets, numbers, hyphen (-), or underscore (_).
descriptionA description of the role of this component in the StyleBook.
typeThe type determines what properties this component provides. Components have two kind of types: Built-in type: This type is provided by the system and you do not have to define it, for example, the NITRO entity types “lbvserver” or “servicegroup.” When a component has a built-in type attribute, it creates a configuration object of that type on the Citrix ADC. For example, if a component refers to the built-in type “lbvserver,” this component creates a load balancing virtual server on the Citrix ADC instance that is the target of the configuration. Composite type: This type refers to an existing StyleBook that you created and imported into Citrix ADM. When a component has a composite type attribute, it creates all the configuration objects, which are specified in the referenced StyleBook, on the Citrix ADC instance that is the target of the configuration. This enables you to combine multiple StyleBooks where each StyleBook creates a part of the final configuration. For more information about composite StyleBooks, see Create a Composite StyleBook.
propertiesThe sub-attributes that can be used for a component type attribute. The properties that are valid for a component are dictated by its type. For a built-in type, these are the properties or attributes of the corresponding Nitro object. For a component whose type is another StyleBook, that is, a composite type, the properties correspond to the parameters defined in that StyleBook.
  

Example:


components:
   -
     name: my-lbvserver-comp
     type: ns::lbvserver
     properties:
         name: $parameters.name
         servicetype: HTTP
         ipv46: $parameters.ip
         port: 80
         lbmethod: $parameters.lb-alg
<!--NeedCopy-->

In this example, you have defined a component called my-lbvserver-comp. This component is of type ns::lbvserver (a built-in type), where “ns” is the prefix that refers to the namespace  netscaler.nitro.config and version 10.5 that you had specified in the import-stylebooks section, and “lbvserver” is a NITRO resource in this namespace.

The properties in this section include four mandatory and one optional attribute (lbmethod) of the “lbvserver” resource and allows you to specify values for these attributes. In this example, you are specifying static values for servicetype and port while the name, ipv46, and lbmethod properties get their values from the input parameters. You refer to the parameter names defined in the parameters section by using $parameters.<name> notation, for example, $parameters.ip.

Note

You have to use lower case for the attribute names of NITRO resource types (its component properties). Otherwise, the import of a StyleBook will fail.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:86 次

字数:4328

最后编辑:6年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文