Accessing Platform APIs from Python

(imported topic written by SystemAdmin)

Environment: 64 bit machine, windows 2008 server

I tried to run the perl example from https://www.ibm.com/developerworks/mydeveloperworks/wikis/home?lang=en#/wiki/Tivoli%20Endpoint%20Manager/page/Platform%20API%20Examples

TakeActionFromFixlet.pl .

It ran fine but with Perl 32 bit.

I ported the complete example to python

BESAPI.py

import win32com.client

def new(apitype):

besobject = win32com.client.Dispatch(“BESAPI.”+apitype)

return besobject

def FixletMessage(*values):

siteID, fixletID, username, password = values

fixlet = new( “FixletMessage” );

fixlet.Load( siteID, fixletID, username, password );

return fixlet;

TakeActionFromFixlet.py

inside that I am invoking the function

fixlet = BESAPI.FixletMessage(siteid, fixletId, username, password);

now the problem is the site id - it’s value is 32299640702.

1)Installed python 64 bit and pywin32 64 bit - Gives class unregistered error

2)Installed python 32 bit with pywin32 bit . No class unregistered error. But complains about

Traceback (most recent call last):

File “C:\TakeActionFromFixlet.py”, line 72, in

print takeAction(ll(32299640702).value, 35, Constants.tem_login_user, Constants.tem_login_password

File “C:\TakeActionFromFixlet.py”, line 65, in takeAction

fixlet,actionXml = getFixletAction(site, fixletId, username, password)

File “C:\TakeActionFromFixlet.py”, line 10, in getFixletAction

fixlet = BESAPI.FixletMessage(site, fixletId, username, password);

File “C:\BESAPI.py”, line 27, in FixletMessage

fixlet.Load( siteID, fixletID, username, password );

File “”, line 3, in Load

OverflowError: Python int too large to convert to C long

Has any one tried the python. I am learning python and don’t want to jump on perl at this point.