cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

Adding a python module for XIQ-SE scripting and workflows

Adding a python module for XIQ-SE scripting and workflows

Jave
Contributor

Hi,

Trying to access a distant SQL database from a workflow, I'm unable to import relevant python module. Is this natively possible or should I installed additionnal python module ? And if yes, how ? Older post talk about former XMC, but seems not to be effective in XIQ-SE.

Regards.

Jave

2 ACCEPTED SOLUTIONS

Robert_Haynes
Extreme Employee

Officially I do not think there is a means to import modules in either Python or Jython as used by XMC/XIQ-SE.

XMC/XIQ-SE includes python2.7/python3 command line interpreters but primarily uses Jython - a Java-based python interpreter for its GUI-based Python script executions.

While it's likely possible to tweak the system to use pip, etc to import modules for either I do not think formally this is supported.

 

To add formal support would be a product enhancement / feature request.

View solution in original post

Zdeněk_Pala
Extreme Employee

You may consider using the build-in driver. more details in the XIQ-SE licensing calculation workflow:

from com.ziclix.python.sql import zxJDBC

try:
    cnxn = zxJDBC.connect(url,emc_vars["dbUser"], emc_vars["dbPassword"], driver)
    mycursor = cnxn.cursor()
    mycursor.close()
    cnxn.close()
except:
    status = emc_results.Status;
    emc_results.setStatus( status.ERROR )
    emc_results.put("workflowMessage","MySQL Database access issue, check the password in Variables!")
    wf_error("MySQL Database access issue, check the password in Variables!")
else:
    wf_info("MySQL Database access OK.")
Regards Zdeněk Pala

View solution in original post

5 REPLIES 5

See https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/xmc-and-python-install-addition...as this is a group provided script that essentially uses PIP within Jython to import modules. Modules must be Python 2.7 compatible.

... this is of course not GTAC supported

GTM-P2G8KFN