I am accessing an Intersystems cache 2017.1.xx instance through a python process to get various attributes about the database in able to monitor the database.
One of the items I want to monitor is license usage. I wrote a objectscript script in a Terminal window to access license usage by user:
s Rset=##class(%ResultSet).%New("%SYSTEM.License.UserListAll")
s r=Rset.Execute()
s ncol=Rset.GetColumnCount()
While (Rset.Next()) {f i=1:1:ncol w !,Rset.GetData(i)}
But, I have been unable to determine how to convert this script into a Python equivalent. I am using the intersys.pythonbind3 import for connecting and accessing the cache instance. I have been able to create python functions that accessing most everything else in the instance but this one piece of data I can not figure out how to translate it to Python (3.7).
hdl = self.db.run_class_method("%SQL.Statement","%New",[]) resState = None pasState = "call %SYSTEM.License_UserListAll" list=[resState, pasState] pStat = hdl.run_obj_method("%ExecDirect",list) print(f'pStat = {pStat}') print(pStat.run_obj_method("%Display",[]))
I am sure this still is not correct but thought it was worth a try – Kevin McGinn Mar 23 '22 at 18:21