Application Delivery Management

Import StyleBooks

This is the second section of your StyleBook and lets you declare which other StyleBook you want to refer to from your current StyleBook. This enables you to import and reuse other StyleBooks instead of rebuilding the same configuration in your own StyleBook. This is a mandatory section.

You must declare the namespace and version number of the StyleBook(s) that you want to refer to in your current StyleBook. Every StyleBook must refer to the netscaler.nitro.config namespace if it uses any of the NITRO configuration objects directly. This namespace contains all the NetScaler NITRO types, such as lbvserver service or monitor. StyleBooks for NetScaler versions 10.5 and later are supported, which means that you can use your StyleBook to create and run configurations on any NetScaler instance running release 10.5 or later.

The prefix attribute used in the import-stylebooks section is a shorthand to refer to the combination of namespace and version. For example, the “ns” prefix can be used to refer to the namespace netscaler.nitro.config with version 10.5. In the later sections of your StyleBook, instead of using the namespace and version each time you want to refer to a StyleBook with this namespace and version, you can simply use the prefix string chosen together with the name of the StyleBook to uniquely identify it.

Example:


     import-stylebooks:
      -
        namespace: netscaler.nitro.config
        version: "10.5"
        prefix: ns
     -
      namespace: com.acme.stylebooks
       version: "0.1"
       prefix: stlb
<!--NeedCopy-->

In the above example, the first prefix defined is called ns and refers to the namespace netscaler.nitro.config and version 10.5. The second prefix that is defined is called stlb, and refers to the namespace com.acme.stylebooks and version 0.1.

After you define a prefix, everytime you want to refer to a type or a StyleBook that belongs to a certain namespace and version, you can use the notation <namespace-shorthand>::<type-name>. For example, ns::lbvserver refers to the type lbvserver that is defined in the namespace netscaler.nitro.config, version 10.5.

Similarly, if you want to refer to a StyleBook with version “0.1” in the com.acme.stylebooks namespace , you can use the notation stlb::<stylebook-name>.

Note

By convention, the prefix “ns” is used to refer to the NITRO namespace of NetScaler.

Import StyleBooks

In this article