Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

iCall Script Argument Passing

How does an iCall script access arguments that have been passed to it from a periodic handler?

1
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

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
}
0