Note The EEM Python package is available only within the EEM Python script (The package can be registered with EEM, and has the EEM event specification in the first line of the script.) and not in the standard Python script (which is run using the Python script name). The Python package includes the following application programming interfaces (APIs): • Action APIs—Perform EEM actions and have default parameters. • CLI-execution APIs—Run IOS commands, and return the output. The following are the list of CLI-execution APIs:
• eem_cli_open() • eem_cli_exec() • eem_cli_read() • eem_cli_read_line() • eem_cli_run() • eem_cli_run_interactive() • eem_cli_read_pattern() • eem_cli_write() • eem_cli_close() • Environment variables-accessing APIs—Get the list of built-in or user-defined variables. The following are the environment variables-accessing APIs: • eem_event_reqinfo ()-Returns the built-in variables list. • eem_user_variables()-Returns the current value of an argument. Python-Supported EEM Actions The Python package (is available only within the EEM script, and not available for the standard Python script) supports the following EEM actions:
• Syslog message printing • Send SNMP traps • Reload the box • Switchover to the standby device • Run a policy • Track Object read • Track Object Set • Cisco Networking Services event generation Shells and Scripting Python-Supported EEM Actions Programmability Configuration Guide, Cisco IOS XE 17.16.x 144