Ruleset administrative tasks
Use the ruleset commands to add, remove, or modify rules and actions of the ruleset.xml file without using the administrative console.
Use the following commands to create ruleset lists, and add or remove rules and actions from the ruleset:
- createRuleset
- listRuleset
- addRuleToRuleset
- removeRuleFromRuleset
- changeRulePriority
- changeRuleExpression
- addActionToRule
- removeActionFromRule
- addDefaultAction
- removeDefaultAction
createRuleset
The createRuleset command creates a ruleset list.
Required parameters
- -rulesetName
- Name of the ruleset. (String, required)
- -rulesetType
- Protocol type to associate with the ruleset. The only valid types are HTTP and SOAP. (String, required)
- -defaultContinue
- Setting for the default continue flag value. Specify True or False. (Boolean, required)
Optional parameters
- -odrname
- Name of the on demand router (ODR) to which the ruleset applies. The -odrname parameter is required only if you modify an ODR. (String, optional)
- -nodename
- Name of the node on which the ODR resides. The -nodename parameter is required only if you modify an ODR. (String, optional)
- -clustername
- Name of the cluster to which the ruleset applies. The -clusterName parameter is required only if you modify an ODR cluster. (String, optional)
Batch mode example
- Jacl:
$AdminTask createRuleset {-odrname odr -nodename node1 -rulesetName myRuleset -rulesetType HTTP -defaultContinue True}
- Jython string...
AdminTask.createRuleset ('-odrname odr -nodename node1 -rulesetName myRuleset -rulesetType HTTP -defaultContinue True')
Interactive mode
- Jacl:
$AdminTask createRuleset {-interactive}
- Jython string...
AdminTask.createRuleset ('[-interactive]')
listRuleset
The listRuleset command lists ruleset rules and actions.
Required parameters
- -rulesetName
- Name of the ruleset. (String, required)
Optional parameters
- -odrname
- Name of the on demand router (ODR) to which the ruleset applies. The -odrname parameter is required only if you modify an ODR. (String, optional)
- -nodename
- Name of the node on which the ODR resides. The -nodename parameter is required only if you modify an ODR. (String, optional)
- -clustername
- Name of the cluster to which the ruleset applies. The -clusterName parameter is required only if you modify an ODR cluster. (String, optional)
Batch mode example
- Jacl:
$AdminTask listRuleset {-odrname odr -nodename node1 -rulesetName myRuleset}
- Jython string...
AdminTask.listRuleset ('-odrname odr -nodename node1 -rulesetName myRuleset')
Interactive mode
- Jacl:
$AdminTask listRuleset {-interactive}
- Jython string...
AdminTask.listRuleset ('[-interactive]')
addRuleToRuleset
The addRuleToRuleset command adds a rule to the ruleset.
Required parameters
- -rulesetName
- Name of the ruleset. (String, required)
- -ruleName
- Name of the rule. The -ruleName parameter must be unique within the ruleset. (String, required)
- -rulePriority
- Specifies a positive integer value representing the priority of the rule. Zero is the highest priority. (String, required)
- -expression
- Rule expression. We must enclose the value in double quotes. (String, required)
Optional parameters
- -odrname
- Name of the on demand router (ODR) to which the ruleset applies. The -odrname parameter is required only if you modify an ODR. (String, optional)
- -nodename
- Name of the node on which the ODR resides. The -nodename parameter is required only if you modify an ODR. (String, optional)
- -clustername
- Name of the cluster to which the ruleset applies. The -clusterName parameter is required only if you modify an ODR cluster. (String, optional)
Batch mode example
- Jacl:
$AdminTask addRuleToRuleset {-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule -rulePriority 0 -expression "vhost = vhostA"}
- Jython string...
AdminTask.addRuleToRuleset('-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule -rulePriority 0 -expression "vhost = \'vhostA\'"')
Interactive mode
- Jacl:
$AdminTask addRuleToRuleset {-interactive}
- Jython string...
AdminTask.addRuleToRuleset ('[-interactive]')
removeRuleFromRuleset
The removeRuleFromRuleset command removes a rule from the ruleset.
Required parameters
- -rulesetName
- Name of the ruleset. (String, required)
- -ruleName
- Name of the rule to remove. (String, required)
Optional parameters
- -odrname
- Name of the on demand router (ODR) to which the ruleset applies. The -odrname parameter is required only if you modify an ODR. (String, optional)
- -nodename
- Name of the node on which the ODR resides. The -nodename parameter is required only if you modify an ODR. (String, optional)
- -clustername
- Name of the cluster to which the ruleset applies. The -clusterName parameter is required only if you modify an ODR cluster. (String, optional)
Batch mode example
- Jacl:
$AdminTask removeRuleFromRuleset {-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule}
- Jython string...
AdminTask.removeRuleFromRuleset('-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule')
Interactive mode
- Jacl:
$AdminTask removeRulefromRuleset {-interactive}
- Jython string...
AdminTask.removeRulefromRuleset ('[-interactive]')
changeRulePriority
The changeRulePriority command modifies the priority of a rule.
Required parameters
- -rulesetName
- Name of the ruleset. (String, required)
- -ruleName
- Name of the rule to modify. (String, required)
- -rulePriority
- Specifies a positive integer value representing the priority of the rule. Zero is the highest priority. (String, required)
Optional parameters
- -odrname
- Name of the on demand router (ODR) to which the ruleset applies. The -odrname parameter is required only if you modify an ODR. (String, optional)
- -nodename
- Name of the node on which the ODR resides. The -nodename parameter is required only if you modify an ODR. (String, optional)
- -clustername
- Name of the cluster to which the ruleset applies. The -clusterName parameter is required only if you modify an ODR cluster. (String, optional)
Batch mode example
- Jacl:
$AdminTask changeRulePriority {-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule -rulePriority 1}
- Jython string...
AdminTask.changeRulePriority('-odrname odr-nodename node1 -rulesetName myRuleset -ruleName myRule -rulePriority 1')
Interactive mode
- Jacl:
$AdminTask changeRulePriority {-interactive}
- Jython string...
AdminTask.changeRulePriority ('[-interactive]')
changeRuleExpression
The changeRuleExpression command modifies a rule expression.
Required parameters
- -rulesetName
- Name of the ruleset. (String, required)
- -ruleName
- Name of the rule to modify. (String, required)
- -expression
- New rule expression. (String, required)
Optional parameters
- -odrname
- Name of the on demand router (ODR) to which the ruleset applies. The -odrname parameter is required only if you modify an ODR. (String, optional)
- -nodename
- Name of the node on which the ODR resides. The -nodename parameter is required only if you modify an ODR. (String, optional)
- -clustername
- Name of the cluster to which the ruleset applies. The -clusterName parameter is required only if you modify an ODR cluster. (String, optional)
Batch mode example
- Jacl:
$AdminTask changeRuleExpression {-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule -expression "vhost = vhostB"}
- Jython string...
AdminTask.changeRuleExpression('-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule -expression "vhost = \'vhostB\'"')
Interactive mode
- Jacl:
$AdminTask changeRuleExpression {-interactive}
- Jython string...
AdminTask.changeRuleExpression ('[-interactive]')
addActionToRule
The addActionToRule command adds an action to a rule.
Required parameters
- -rulesetName
- Name of the ruleset. (String, required)
- -ruleName
- Name of the rule. The -ruleName parameter must be unique within the ruleset. (String, required)
- -actionName
- Name of the action. The -actionName parameter must be unique within the ruleset. (String, required)
- -actionType
- Type of action to associate with the rule. (String, required)
- -actionValue
- Action value, such as the format of the log file, to use. (String, required)
- -actionContinue
- Setting for the action continue flag value. Specify True or False. (Boolean, required)
Optional parameters
- -odrname
- Name of the on demand router (ODR) to which the ruleset applies. The -odrname parameter is required only if you modify an ODR. (String, optional)
- -nodename
- Name of the node on which the ODR resides. The -nodename parameter is required only if you modify an ODR. (String, optional)
- -clustername
- Name of the cluster to which the ruleset applies. The -clusterName parameter is required only if you modify an ODR cluster. (String, optional)
Batch mode example
- Jacl:
$AdminTask addActionToRule {-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule -actionName myAction -actionType log -actionValue "MyCustom.log %r %T %z %Z" -actionContinue true}
- Jython string...
AdminTask.addActionToRule('-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule -actionName myAction -actionType log -actionValue "MyCustom.log %r %T %z %Z" -actionContinue true')
Interactive mode
- Jacl:
$AdminTask addActionToRule {-interactive}
- Jython string...
AdminTask.addActionToRule ('[-interactive]')
removeActionFromRule
The removeActionFromRule command removes an action from a rule.
Required parameters
- -rulesetName
- Name of the ruleset. (String, required)
- -ruleName
- Name of the rule containing the action. (String, required)
- -actionName
- Name of the action to remove. (String, required)
Optional parameters
- -odrname
- Name of the on demand router (ODR) to which the ruleset applies. The -odrname parameter is required only if you modify an ODR. (String, optional)
- -nodename
- Name of the node on which the ODR resides. The -nodename parameter is required only if you modify an ODR. (String, optional)
- -clustername
- Name of the cluster to which the ruleset applies. The -clusterName parameter is required only if you modify an ODR cluster. (String, optional)
Batch mode example
- Jacl:
$AdminTask removeActionFromRule {-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule -actionName myAction}
- Jython string...
AdminTask.removeActionFromRule('-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule -actionName myAction')
Interactive mode
- Jacl:
$AdminTask removeActionFromRule {-interactive}
- Jython string...
AdminTask.removeActionFromRule ('[-interactive]')
addDefaultAction
The addDefaultAction command adds a default action to a ruleset.
Required parameters
- -rulesetName
- Name of the ruleset. (String, required)
- -actionName
- Name of the action. The -actionName parameter must be unique within the ruleset. (String, required)
- -actionType
- Type of action to associate with the rule. (String, required)
- -actionValue
- Action value, such as the format of the log file, to use. (String, required)
- -actionContinue
- Setting for the action continue flag value. Specify True or False. (Boolean, required)
Optional parameters
- -odrname
- Name of the on demand router (ODR) to which the ruleset applies. The -odrname parameter is required only if you modify an ODR. (String, optional)
- -nodename
- Name of the node on which the ODR resides. The -nodename parameter is required only if you modify an ODR. (String, optional)
- -clustername
- Name of the cluster to which the ruleset applies. The -clusterName parameter is required only if you modify an ODR cluster. (String, optional)
Batch mode example
- Jacl:
$AdminTask addDefaultAction {-odrname odr -nodename node1 -rulesetName myRuleset -actionName defAction -actionType log -actionValue "default.log %a %d %D" -actionContinue True}
- Jython string...
AdminTask.addDefaultAction('-odrname odr -nodename node1 -rulesetName myRuleset -actionName defAction -actionType log -actionValue "default.log %a %d %D" -actionContinue True')
Interactive mode
- Jacl:
$AdminTask addDefaultAction {-interactive}
- Jython string...
AdminTask.addDefaultAction ('[-interactive]')
removeDefaultAction
The removeDefaultAction command removes a default action from a ruleset.
Required parameters
- -rulesetName
- Name of the ruleset. (String, required)
- -actionName
- Name of the action to remove. (String, required)
Optional parameters
- -odrname
- Name of the on demand router (ODR) to which the ruleset applies. The -odrname parameter is required only if you modify an ODR. (String, optional)
- -nodename
- Name of the node on which the ODR resides. The -nodename parameter is required only if you modify an ODR. (String, optional)
- -clustername
- Name of the cluster to which the ruleset applies. The -clusterName parameter is required only if you modify an ODR cluster. (String, optional)
Batch mode example
- Jacl:
$AdminTask removeDefaultAction {-odrname odr -nodename node1 -rulesetName myRuleset -actionName defAction}
- Jython string...
AdminTask.removeDefaultAction('-odrname odr -nodename node1 -rulesetName myRuleset -actionName defAction')
Interactive mode
- Jacl:
$AdminTask removeDefaultAction {-interactive}
- Jython string...
AdminTask.removeDefaultAction ('[-interactive]')
Related concepts
Rules support Rule-based request classification Overview of request flow prioritization
Intelligent Management: routing and service policies