Related Documentation
- ACX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- sysctl() Function (jcs and slax Namespaces)
- EX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- sysctl() Function (jcs and slax Namespaces)
- M Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- sysctl() Function (jcs and slax Namespaces)
- MX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- sysctl() Function (jcs and slax Namespaces)
- PTX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- sysctl() Function (jcs and slax Namespaces)
- SRX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- sysctl() Function (jcs and slax Namespaces)
- T Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- sysctl() Function (jcs and slax Namespaces)
dampen() Function (jcs and slax Namespaces)
Namespaces
SLAX Syntax
XSLT Syntax
Release Information
Function introduced in Junos OS Release 9.4.
Support for the slax namespace http://xml.libslax.org/slax added in Junos OS Release 12.2.
Description
Prevent the same operation from being repeatedly
executed within a script. The dampen() function
returns false if the number of calls to
the jcs:dampen() function exceeds a max number of calls in the time
interval interval.
Otherwise the function returns true. The
function parameters include an arbitrary string that is used to distinguish
different calls to the jcs:dampen() function.
This tag is stored in the /var/run directory on the device.
The prefix associated with the namespace URI should be defined in the prefix-to-namespace mapping in the style sheet.
Parameters
interval | — | Time interval, in minutes. |
max | — | Maximum number of calls to the jcs:dampen() function with a given tag allowed before the function returns false. This limit is based on the number of calls within a specified time interval. |
tag-string | — | Arbitrary string used to distinguish different calls to the jcs:dampen() function. |
Return Value
result | — | Boolean value based on the number of calls to jcs:dampen() with a given tag and within a specified time. If the number of calls for a given tag exceeds max, the return value is false. If the number of calls is less than max, the return value is true. |
Usage Examples
In the following example, if the jcs:dampen() function with the tag 'mytag1' is called less than three times in a 10-minute interval, the function returns true. If the function is called more than three times within 10 minutes, the function returns false.
if (jcs:dampen('mytag1', 3, 10)) {
/* Code for situations when jcs:dampen() with */
/* the tag 'mytag1' is called less than three times */
/* within 10 minutes */
} else {
/* Code for situations when jcs:dampen() with */
/* the tag 'mytag1' exceeds the three call maximum */
/* limit within 10 minutes */
}Related Documentation
- ACX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- sysctl() Function (jcs and slax Namespaces)
- EX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- sysctl() Function (jcs and slax Namespaces)
- M Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- sysctl() Function (jcs and slax Namespaces)
- MX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- sysctl() Function (jcs and slax Namespaces)
- PTX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- sysctl() Function (jcs and slax Namespaces)
- SRX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- sysctl() Function (jcs and slax Namespaces)
- T Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- sysctl() Function (jcs and slax Namespaces)