Question
· Jun 13

Python interaction with Config.config class not returning gmheap size

I am trying to extract GMHeap, Locksiz values form Config.config using python (imported irisnative for Python) but the below python progam is not returning any value. Please suggest if i am doing any mistake - 

Also, plese suggest how i can set values for GMHeap and Locksiz to a different value through Python.

 

 

import irisnative

hostname = "127.0.0.1"
port = 1972
namespace = "%SYS" #change the namespace based on situation
username = "_SYSTEM"
password = "xxxxxxxx"
connection = irisnative.createConnection(hostname, port, namespace, username, password)
dbnative = irisnative.createIris(connection)

gmheap_size=dbnative.classMethodValue("Config.config", "gmheap")
print(gmheap_size)

connection.close()

Discussion (15)2
Log in or sign up to continue

Hi,

I tried updating the python script like below -

import irisnative

hostname = "127.0.0.1"
port = 1972
namespace = "%SYS" #change the namespace based on situation
username = "_SYSTEM"
password = "xxxxxxxx"
connection = irisnative.createConnection(hostname, port, namespace, username, password)
dbnative = irisnative.createIris(connection)

cfg=dbnative.classMethodValue('Config.config', 'Open')
print(cfg.get('gmheap'))

connection.close()

and i am getting the below error when i attempting to run python -

    print(cfg.get('gmheap'))
AttributeError: 'str' object has no attribute 'get'

i tried methog gmheapGet() for the property gmheap but i am not getting any output. This Config.config is persistent class and SQL table. is that is the reason 'classmethovalue' not working? the same code worked for getting %system.config.sharedmemoryheap.recommendedsize. 

The best place to get the appropriate version of the Native API wheel is from the dev/python directory of an IRIS installation (you may be able to do a client-only install). I'm not aware of a separate distribution of the wheel yet. You can get the pure Python 3.2.0 wheel from any platform, including a community container. For 4.x.x, you should find the IRIS kit corresponding to your client platform. If you're still having trouble getting the software, contact the WRC.

Can you tell me what documentation directed you to this old wheel? That almost certainly shouldn't be there.

The problem is if i get the gmheap from IRIS Terminal the log output is in Unicode-UTF format and it is cautins trouble while reading from Ansible. Actually we are working on some automation kind of work to install and configure IRIS. So, we are using Ansible and PS/Python to interact with Windows OS and IRIS to set/modify Windows/IRIS related configurations and do some additional tasks based on the values that we get from Windows OS/IRIS. But what ever values we get from IRIS through terminal comes in Unicode UTF8 format and ansible is not recognizing the format for us (may be we need to explore in Ansible). But, do we have any method where we can ask terminal to give the output in normal text format.