Forum Discussion
iCall Script Argument Passing
How does an iCall script access arguments that have been passed to it from a periodic handler?
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_StewartEmployee
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 }
- JRahmAdmin
and written up in article format here:
Passing Arguments to iCall Scripts
Recent Discussions
Related Content
* 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