Product Documentation

Parameters

May 24, 2018

This section lets you define all the parameters that you require in your StyleBook to create a configuration. It describes the input that your StyleBook takes. Although this is an optional section, most StyleBooks might need one. You can consider the parameters section to define the questions you want users to answer when they use the StyleBook to create a configuration on a NetScaler instance.

When you import your StyleBook into NetScaler MAS and use it to create a configuration, the GUI uses this section of the StyleBook to display a form that takes input for values of the parameters you have defined.

The following table describes the attributes that you need to specify for each parameter in this section:

Attribute Description Mandatory
name

The name of the parameter you want to define. You can specify an alphanumeric name. The name must begin with an alphabet, and can include additional alphabets, numbers, hyphen (-), or underscore (_).

Note that when writing a StyleBook, you can use this "name" attribute to refer to the parameter in other sections by using the notation $parameters.<name>.

Yes
label A string that is displayed in the NetScaler MAS GUI as the name of this parameter. No
description A help string that describes what the parameter is used for. The NetScaler MAS GUI displays this text when the user clicks the help icon for this parameter. No
type

The type of value these parameters can take. Parameters can be of any of the following built-in types:

  • string: An array of characters. If a length is not specified, the string value can take any number of characters. However, you can limit the length of a string type by using the attributes min-length and max-length.

  • number: An integer number. You can specify the minimum and maximum number that this type can take by using the attributes min-value and max-value.

  • boolean: Can be either true or false. Also, note that all the literals are considered by YAML as booleans (for example, Yes or No).

  • ipaddress: A string that represents a valid IPv4 or IPv6 address.

  • tcp-port: A number between 0 and 65535 that represents a TCP or UDP port.

  • password: Represents an opaque/secret string value. When NetScaler MAS GUI displays a value for this parameter, it is shown as asterisks (*****).

  • certfile: Represents a certificate file. This allows you to upload the files directly from your local system when you are creating a StyleBook configuration using the NetScaler MAS GUI. The uploaded certificate file is stored in the directory /var/mps/tenants/<tenant_path>/ns_ssl_certs in NetScaler MAS. The certificate file will be added to the list of certificates managed by NetScaler MAS.

  • keyfile: Represents a certificate key file. This allows you to upload the file directly from your local system when you are creating a StyleBook configuration using the NetScaler MAS GUI. The uploaded certificate file is stored in the directory /var/mps/tenants/<tenant_path>/ns_ssl_keys in NetScaler MAS. The certificate key file will be added to the list of certificate keys managed by NetScaler MAS.

  • file: Represents a file.

  • object: This type is used when you want to group several related parameters under a parent element. You have to specify the parent parameter the type as "object". A parameter of type "object" can have a nested "parameters" section to describe the parameters it contains.

  • Another StyleBook: When you use this type of parameter, then this parameter expects its value to be in the form of the parameters defined in the StyleBook denoting its type.

A parameter can also have a type that is a list of any of the types listed above, by adding "[]" to the end of the type. For example, if the type attribute is string[], this parameter takes a list of strings as input. You can provide one, two, or several strings for this parameter when creating a configuration from this StyleBook.

Yes
key

Specify true or false to indicate if this parameter is a key parameter for the StyleBook. A StyleBook can have only one parameter defined as the "key" parameter.

When you create different configurations from the same StyleBook (on the same or different NetScaler instances), each configuration has a different/unique value for this parameter.

Default value is false.

No
required

Specify true or false to indicate whether a parameter is mandatory or optional. If it is set to true, the parameter is mandatory and the user has to provide a value for this parameter when creating configurations. The NetScaler MAS GUI forces the user to provide a valid value for this parameter.

Default value is false.

No
allowed-values

Use this attribute to define a list of valid values for a parameter, when the type is set to "string." When creating a configuration from the NetScaler MAS GUI, the user is prompted to select a parameter value from this list.

Example 1:

   name: ipaddress

   type: string

   allowed-values:

        - SOURCEIP

        - DESTIP

        - NONE

Example 2:

     name: TCP Port

     type: tcp-port

     allowed-values:    

         - 80

         - 81

         - 8080

 Example 3: (list of tcp-ports, where each element of the list can only have values specified in allowed-values)

    name: tcpports

    type: tcp-port[]

    allowed-values:

       -80

       -81

       -8080

       -8081

No
default

Use this attribute to assign a default value to an optional parameter. While creating a configuration, if a user does not specify a value, the default value is used.

When creating the configuration from the NetScaler MAS GUI, if a user does not provide a value for a parameter that does not have a default value, then no value is set for that parameter.

Example 1:

   name: timeout

   type: number

   default: 20

Example 2 (where, the default value of the parameter is a list of values):

   name: protocols

   type: string[]

   default:

          -  TCP

          -  UDP

          -  IP

Example 3:

      name: timeout

      type: number

      default: 20

Example 4:

     name: tcpport

     type: tcp-port

     default: 20 

No
pattern

Use this attribute to define a pattern (regular expression) for the valid values of this parameter, when the type of the parameter is "string."

Example:

    name: appname

    type: string

    pattern: "[a-z]+"

No
min-value

Use this attribute to define the minimum value for parameters of type "number" or "tcp-port." 

Example:

   name: audio-port

   type: tcp-port

   min-value: 5000

The min-value of numbers can be negative, but the min-value for tcp-port should not be negative.

No
max-value

Use this attribute to define the maximum value for parameters of type "number" or "tcp-port." The maximum value should be greater than the minimum value, if defined.

Example:

   name: audio-port

   type: tcp-port

   min-value: 5000

   max-value: 15000

No
min-length

Use this attribute to define the minimum length of values accepted for a parameter of type "string." Minimum length of the characters defined as values should be greater or equal to zero.

Example:

   name: appname

   type: string

   min-length: 3

No
max-length

Use this attribute to define the maximum length of values accepted for a parameter of type "string." Maximum length of the values should be greater or equal to the length of the characters defined in min-length.

Example:

   name: appname

   type: string

   max-length: 64

No
min-items

Use this attribute to define the minimum number of items in a parameter that is a list. The minimum number of items should be greater or equal to zero.

Example:

   name: server-ips

   type: ipaddress[]

   min-items: 2

No
max-items

Use this attribute to define the maximum number of items in a parameter that is a list. The maximum number of items should be greater than the minimum number of items if defined.

Example:

   name: server-ips

   type: ipaddress[]

   min-items: 2

   max-items: 250

No
gui Use this attribute to customize the layout of the parameter of type "object" in the NetScaler MAS GUI. No
columns This is a sub-attribute of the gui attribute. Use this to define the number of columns to display in the NetScaler MAS GUI. No
updatable This is a sub-attribute of the gui attribute. Use this to specify whether the parameter can be updated after the configuration is created. If the value is set to false, the parameter field is greyed out when you update the configuration. No
collapse_pane

This is a sub-attribute of the gui attribute. Use this to specify whether the pane defining the layout of this object parameter is collapsible. If the value is set to true, the user can expand or collapse the child parameters under this parent parameter.

Example:

     gui:

        collapse_pane: true

        columns: 2

        updatable: false

No


Example of a complete parameters section:

parameters:

       -

          name: name

          label: Name

          description: Name of the application

          type: string

          required: true

       -

          name: ip

          label: IP Address

          description: The virtual IP address used for this application

          type: ipaddress

          required: true

      -

          name: svc-servers

          label: Servers

          type: object[]

          required: true

          parameters:

                   -

                      name: svc-ip

                      label: Server IP

                      description: The IP address of the server

                      type: ipaddress

                      required: true

                   -

                      name: svc-port

                      label: Server Port

                      description: The TCP port of the server

                      type: tcp-port

                      default: 80

      -

          name: lb-alg

          label: LoadBalancing Algorithm

          type: string

          allowed-values:

                - ROUNDROBIN

                - LEASTCONNECTION

          default: ROUNDROBIN

      -

          name: enable-healthcheck

          label: Enable HealthCheck?

          type: boolean

          default: true

The following is an example that defines all the attributes of a list and the values explained in earlier sections:

          name: features-list

          type: string[]

          min-length: 1

          max-length: 3

          min-items: 1

          max-items: 3

          pattern: "[A-Z]+"

          allowed-values:

             - SP

             - LB

             - CS

          default:

             - LB