Forum Discussion
Joel_42834
May 17, 2014Nimbostratus
iCall Script Argument Passing
How does an iCall script access arguments that have been passed to it from a periodic handler?
- May 17, 2014
Okay, so let's say you have a periodic handler defined with arguments. Example:
sys icall handler periodic testlogger { arguments { { name test value blah } { name foo value bar } } interval 30 script testlogger }
To access those arguments within your script, you'd use the EVENT::context command inside a foreach loop. Something like this:
sys icall script /Common/testlogger { app-service none definition { foreach var { test foo } { set $var $EVENT::context($var) } tmsh::log "testing: ${test} - ${foo}" } description none events none }
Kevin_Stewart
May 17, 2014Employee
Okay, so let's say you have a periodic handler defined with arguments. Example:
sys icall handler periodic testlogger {
arguments {
{
name test
value blah
}
{
name foo
value bar
}
}
interval 30
script testlogger
}
To access those arguments within your script, you'd use the EVENT::context command inside a foreach loop. Something like this:
sys icall script /Common/testlogger {
app-service none
definition {
foreach var { test foo } {
set $var $EVENT::context($var)
}
tmsh::log "testing: ${test} - ${foo}"
}
description none
events none
}
- JRahmJul 01, 2024Admin
and written up in article format here:
Passing Arguments to iCall Scripts
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects