cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
730
Views
0
Helpful
0
Replies

application to execute the AXL executeSQLUpdate method - UPDATE devicehlogdynamic set hlog

Hi - can someone assist with suggestion how to pass multiple devices name that is stored in a  list or dict into the UPDATE devicehlogdynamic set hlog field?

my current code snippet looks like this:

def hlogUpdate():
device = dictOfDeviceState.items()


for key, value in device:

soaprequest = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/11.5"><soapenv:Header/><soapenv:Body><ns:executeSQLUpdate sequence="?"><sql>UPDATE devicehlogdynamic set hlog="f" WHERE fkdevice=(SELECT pkid FROM device WHERE device.name in (' + str(key) + '))</sql></ns:executeSQLUpdate></soapenv:Body></soapenv:Envelope>'

soapheaders = {'Content-type': 'text/xml', 'SOAPAction': 'CUCM:DB ver=11.5'}

AXLRequest = requests.post('https://{callManager}:8443/axl/', data=soaprequest, headers=soapheaders, verify=False,
auth=(userName, password))

root = ET.fromstring(AXLRequest.text)
# #
hlogUpdate()

 

0 Replies 0