Parameter conditions
parameters-conditions to define a parameter condition in the definition.
-
target: Specify the target parameter to which you want to apply an action. You can specify multiple target parameters. -
action: Specify what action to take on the target parameters. Parameter conditions support the following actions: -
condition: Optional, specify a condition to apply an action for the specified target parameters. If you do not specify a condition, the action is directly applied on the target parameters. -
value: Set the values for the target parameters attribute depending on the action.
'augment-allowed-values'
augment-allowed-values, the target parameter appears as a drop-down menu in the GUI. The drop-down menu is set with the values defined in the value attribute of the StyleBook definition.
parameters-conditions:
-
target: $parameters.rewritepolicy.action
action: augment-allowed-values
value: $parameters.rewriteaction
'show' or 'hide'
show and the specified condition returns True, the target parameter appears on the GUI.
hide and the specified condition returns True, the target parameter disappears from the GUI.
parameters-conditions:
-
target: $parameters.security-settings.cert-details
action: show
condition: $parameters.protocol in ["SSL", "SSL-BRIDGE"]
security-settings parameter. When a user selects SSL or SSL-Bridge protocols, the certificate details appear.
'set-default'
set-default and the specified condition returns True, the target parameter's value is set to the default value.
parameters-conditions:
-
target: $parameters.port
action: set-default
condition: $parameters.protocol == "SSL"
value: 443
-
target: $parameters.port
action: set-default
condition: $parameters.protocol != "SSL"
value: 80
parameters-conditions:
-
target: $parameters.port
action: set-default
value: if-then-else($parameters.protocol == "SSL", 443, 80)
443. For other protocols, the default port value is set to 80. Example 1 and 2 gives you the same result.
'set-required'
set-required and the specified condition returns True, the target parameter becomes a required field to create a config pack.
parameters-conditions:
-
target: $parameters.security-settings.cert-details
action: set-required
condition: $parameters.protocol in ["SSL", "SSL-BRIDGE"]
security-settings parameter. When a user selects SSL or SSL-Bridge protocols, the certificate details become a required field to create a config pack.
'set-allowed-values'
set-allowed-values and the specified condition returns True, the target parameter allows you to select only specified values.
parameters-conditions:
-
target: $parameters.app-name
action: set-allowed-values
value:
- "SSL"
condition: $parameters.lb-virtual-port == 443
443 as a load-balancer virtual port, the application's name allows only SSL option.
'set-label'
set-label and the specified condition returns True, the target parameter's label changes to the specified text.
parameters-conditions:
-
target: $parameters.app-name
action: set-label
value: if-then-else($parameters.lb-service-type == "TCP", "TCPApp","UDPApp")
'set-description'
set-description and the specified condition returns True, the target parameter's description changes to the specified text. This description appears in the tool tip of a target parameter.
parameters-conditions:
-
target: $parameters.app-name
action: set-description
value: if-then-else($parameters.lb-service-type == "TCP", "Select a TCP application name","Select a UDP application name")
Select a TCP application name. If the user selects a different option, the application's description displays Select a UDP application name.
'collapse-pane' or 'expand-pane'
collapse-pane and the specified condition returns True, the target parameter's pane collapses in the GUI.
expand-pane and the specified condition returns True, the target parameter's pane expands in the GUI.
parameters-conditions:
-
target: $parameters.security-settings.cert-details
action: expand-pane
condition: $parameters.protocol in ["SSL", "SSL-BRIDGE"]
security-settings parameter. When a user selects SSL or SSL-Bridge protocols, the certificate details pane expands on the GUI.
'set-pattern'
set-pattern and the specified condition returns True, the target parameter field is set to the specified pattern.
parameters-conditions:
-
target: $parameters.app-name
action: set-pattern
value: "[a-z]+"
Nested parameter conditions
parameters-conditions:
-
repeat: $parameters.lbvservers
repeat-item: lbvserver
parameters-conditions:
-
target: $lbvserver.port
action: set-allowed-values
condition: $lbvserver.protocol == "HTTPS"
value: $parameters.ssl-ports