Import and use custom StyleBooks
After you have built your StyleBook, you have to import it to Citrix Application Delivery Management (ADM) to use it. Citrix ADM allows you to import a single StyleBook in YAML form or multiple StyleBook YAML files as a bundle in a .zip, .tgz, or .gz form. The Citrix ADM system validates your StyleBooks on import. The Stylebook is now ready to be used for creating configurations.
Citrix ADM also has a built-in YAML editor that you can use to compose the StyleBook YAML contents. The YAML editor allows you to validate your YAML constructs from Citrix ADM GUI itself. You do not need to use a separate tool for these validation checks. The content is validated against YAML standards and any deviation is highlighted. You can then correct the content and attempt to import the StyleBook into Citrix ADM. The built-in YAML editor provides two advantages while writing your own StyleBook.
- Color coded. The editor displays the StyleBook content parsed as per YAML guidelines, and the color coding helps you to differentiate easily between the keys and the values defined in YAML content.
- YAML validation. The content is validated for any YAML errors as you type in and any deviation is immediately highlighted. This allows you to write text that conforms to YAML guidelines even before you import the StyleBook in Citrix ADM.
Currently, the editor validates the content according to YAML guidelines. It does not validate for code correctness and typographical errors.
To use your StyleBook
In Citrix ADM, navigate to Applications > Configuration > StyleBooks, and then click Import New StyleBook.
Click one of the three options available for you to import the StyleBook.
File - select the required file or the bundle of files from your local storage.
In this example, import the “lb-vserver.yaml” StyleBook that you had created in StyleBook to Create a Load Balancing Virtual Server.
Bundle - Citrix ADM allows you to import multiple StyleBooks in YAML format. You can import more than one YAML StyleBook file that are compressed in a zip (.zip) format or tarball (.tgz, .gz) format.
Raw - Compose the content of your StyleBook in the YAML editor.
While composing StyleBook, make sure you have knowledge of the following:
- NITRO API
For more information about how to write your own StyleBooks, see How to Create Your Own StyleBooks.
You can also copy and paste the content from a StyleBook YAML file to validate the content.
Citrix ADM now validates your StyleBook for all syntactic and semantic errors according to the StyleBook grammar. Your StyleBook is not imported into Citrix ADM if there are any errors. If there are no errors the StyleBook is successfully imported and is now listed on the StyleBooks page. You can identify the StyleBook by the display name that you had defined in the header section of the StyleBook.
If you are importing a bundle of files, Citrix ADM decompresses the zipped folder and validates all the StyleBooks. The bundle is not imported even if one StyleBook file fails the validation test.
For more information on StyleBook grammar and syntax of the different constructs and attributes, see StyleBook Grammar.
To create configurations from this StyleBook, click Create Configuration link. The StyleBook opens as a user interface page on which you can enter the values for all the parameters defined in this StyleBook.
Specify the required values for the parameters. In the example below, you can see that application name and the load balancer IP address fields are displayed as mandatory fields and can accept user values. The LB Algorithm has only two values that you can choose from and by default, ROUNDROBIN is selected.
Under Target Instances, click and select the IP address of the Citrix ADC instance where you want to run the configuration. You can also deploy the configuration on more than one Citrix ADC, by specifying as many target instances as needed.
If you want to have a look at the Citrix ADC (Nitro) configuration objects that would be created on your Citrix ADC before actually creating the configuration, click Dry Run. If your configuration is valid, the configuration objects that would be created on the basis of the values you have provided are displayed. In this example, only one object of type lbvserver is created by this example StyleBook. This lbvserver was the only component that was defined in this basic example StyleBook. You can later click Create to actually create the configuration on the selected Citrix ADC instances.
Once the creation completed, the new ConfigPack is listed on the Configurations page.
You can also click the refresh icon to add recently discovered Citrix ADC instances in Citrix ADM to the available list of instances in this window.
Search custom StyleBooks
Citrix ADM now allows you to search for StyleBooks based on their type. That is, you can now search for either default StyleBooks or custom StyleBooks. This option is especially helpful when you have to search for your user-defined StyleBooks amidst a large number of default StyleBooks.
To search for custom StyleBooks
- In Citrix ADM, navigate to Applications > Configurations > StyleBooks.
- Click the search icon at the top right side.
- In the search bar that appears, select Type from the first list, and select Custom from the next list of options.
- Citrix ADM displays only the user-defined StyleBooks.