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 to which the ruleset applies. The -odrname parameter is required only if we modify an ODR. (String, optional)
- -nodename
- Name of the node on which the ODR resides. The -nodename parameter is required only if we modify an ODR. (String, optional)
- -clustername
- Name of the cluster to which the ruleset applies. The -clusterName parameter is required only if we modify an ODR cluster. (String, optional)
Batch mode example usage
- Use Jacl:
$AdminTask createRuleset {-odrname odr -nodename node1 -rulesetName myRuleset -rulesetType HTTP -defaultContinue True}
- Use Jython string:
AdminTask.createRuleset ('-odrname odr -nodename node1 -rulesetName myRuleset -rulesetType HTTP -defaultContinue True')
Interactive mode example usage
- Use Jacl:
$AdminTask createRuleset {-interactive}
- Use 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 to which the ruleset applies. The -odrname parameter is required only if we modify an ODR. (String, optional)
- -nodename
- Name of the node on which the ODR resides. The -nodename parameter is required only if we modify an ODR. (String, optional)
- -clustername
- Name of the cluster to which the ruleset applies. The -clusterName parameter is required only if we modify an ODR cluster. (String, optional)
Batch mode example usage
- Use Jacl:
$AdminTask listRuleset {-odrname odr -nodename node1 -rulesetName myRuleset}
- Use Jython string:
AdminTask.listRuleset ('-odrname odr -nodename node1 -rulesetName myRuleset')
Interactive mode example usage
- Use Jacl:
$AdminTask listRuleset {-interactive}
- Use 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
- Positive integer value representing the priority of the rule. Zero is the highest priority. (String, required)
- -expression
- Rule expression. Enclose the value in double quotes. (String, required)
Optional parameters:
- -odrname
- Name of the on demand router to which the ruleset applies. The -odrname parameter is required only if we modify an ODR. (String, optional)
- -nodename
- Name of the node on which the ODR resides. The -nodename parameter is required only if we modify an ODR. (String, optional)
- -clustername
- Name of the cluster to which the ruleset applies. The -clusterName parameter is required only if we modify an ODR cluster. (String, optional)
Batch mode example usage
- Use Jacl:
$AdminTask addRuleToRuleset {-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule -rulePriority 0 -expression "vhost = vhostA"}
- Use Jython string:
AdminTask.addRuleToRuleset('-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule -rulePriority 0 -expression "vhost = \'vhostA\'"')
Interactive mode example usage
- Use Jacl:
$AdminTask addRuleToRuleset {-interactive}
- Use 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 to which the ruleset applies. The -odrname parameter is required only if we modify an ODR. (String, optional)
- -nodename
- Name of the node on which the ODR resides. The -nodename parameter is required only if we modify an ODR. (String, optional)
- -clustername
- Name of the cluster to which the ruleset applies. The -clusterName parameter is required only if we modify an ODR cluster. (String, optional)
Batch mode example usage
- Use Jacl:
$AdminTask removeRuleFromRuleset {-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule}
- Use Jython string:
AdminTask.removeRuleFromRuleset('-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule')
Interactive mode example usage
- Use Jacl:
$AdminTask removeRulefromRuleset {-interactive}
- Use 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
- 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 to which the ruleset applies. The -odrname parameter is required only if we modify an ODR. (String, optional)
- -nodename
- Name of the node on which the ODR resides. The -nodename parameter is required only if we modify an ODR. (String, optional)
- -clustername
- Name of the cluster to which the ruleset applies. The -clusterName parameter is required only if we modify an ODR cluster. (String, optional)
Batch mode example usage
- Use Jacl:
$AdminTask changeRulePriority {-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule -rulePriority 1}
- Use Jython string:
AdminTask.changeRulePriority('-odrname odr-nodename node1 -rulesetName myRuleset -ruleName myRule -rulePriority 1')
Interactive mode example usage
- Use Jacl:
$AdminTask changeRulePriority {-interactive}
- Use 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 to which the ruleset applies. The -odrname parameter is required only if we modify an ODR. (String, optional)
- -nodename
- Name of the node on which the ODR resides. The -nodename parameter is required only if we modify an ODR. (String, optional)
- -clustername
- Name of the cluster to which the ruleset applies. The -clusterName parameter is required only if we modify an ODR cluster. (String, optional)
Batch mode example usage
- Use Jacl:
$AdminTask changeRuleExpression {-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule -expression "vhost = vhostB"}
- Use Jython string:
AdminTask.changeRuleExpression('-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule -expression "vhost = \'vhostB\'"')
Interactive mode example usage
- Use Jacl:
$AdminTask changeRuleExpression {-interactive}
- Use 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 to which the ruleset applies. The -odrname parameter is required only if we modify an ODR. (String, optional)
- -nodename
- Name of the node on which the ODR resides. The -nodename parameter is required only if we modify an ODR. (String, optional)
- -clustername
- Name of the cluster to which the ruleset applies. The -clusterName parameter is required only if we modify an ODR cluster. (String, optional)
Batch mode example usage
- Use Jacl:
$AdminTask addActionToRule {-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule -actionName myAction -actionType log -actionValue "MyCustom.log %r %T %z %Z" -actionContinue true}
- Use 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 example usage
- Use Jacl:
$AdminTask addActionToRule {-interactive}
- Use 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 to which the ruleset applies. The -odrname parameter is required only if we modify an ODR. (String, optional)
- -nodename
- Name of the node on which the ODR resides. The -nodename parameter is required only if we modify an ODR. (String, optional)
- -clustername
- Name of the cluster to which the ruleset applies. The -clusterName parameter is required only if we modify an ODR cluster. (String, optional)
Batch mode example usage
- Use Jacl:
$AdminTask removeActionFromRule {-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule -actionName myAction}
- Use Jython string:
AdminTask.removeActionFromRule('-odrname odr -nodename node1 -rulesetName myRuleset -ruleName myRule -actionName myAction')
Interactive mode example usage
- Use Jacl:
$AdminTask removeActionFromRule {-interactive}
- Use 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 to which the ruleset applies. The -odrname parameter is required only if we modify an ODR. (String, optional)
- -nodename
- Name of the node on which the ODR resides. The -nodename parameter is required only if we modify an ODR. (String, optional)
- -clustername
- Name of the cluster to which the ruleset applies. The -clusterName parameter is required only if we modify an ODR cluster. (String, optional)
Batch mode example usage
- Use Jacl:
$AdminTask addDefaultAction {-odrname odr -nodename node1 -rulesetName myRuleset -actionName defAction -actionType log -actionValue "default.log %a %d %D" -actionContinue True}
- Use Jython string:
AdminTask.addDefaultAction('-odrname odr -nodename node1 -rulesetName myRuleset -actionName defAction -actionType log -actionValue "default.log %a %d %D" -actionContinue True')
Interactive mode example usage
- Use Jacl:
$AdminTask addDefaultAction {-interactive}
- Use 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 to which the ruleset applies. The -odrname parameter is required only if we modify an ODR. (String, optional)
- -nodename
- Name of the node on which the ODR resides. The -nodename parameter is required only if we modify an ODR. (String, optional)
- -clustername
- Name of the cluster to which the ruleset applies. The -clusterName parameter is required only if we modify an ODR cluster. (String, optional)
Batch mode example usage
- Use Jacl:
$AdminTask removeDefaultAction {-odrname odr -nodename node1 -rulesetName myRuleset -actionName defAction}
- Use Jython string:
AdminTask.removeDefaultAction('-odrname odr -nodename node1 -rulesetName myRuleset -actionName defAction')
Interactive mode example usage
- Use Jacl:
$AdminTask removeDefaultAction {-interactive}
- Use Jython string:
AdminTask.removeDefaultAction ('[-interactive]')
Related:
Rules support Rule-based request classification Overview of request flow prioritization Intelligent Management: routing and service policies