12-17-2016 06:52 AM
I'm beginner python and cucm-axl. I need to update line on CUCM version 10.0.
I can list line show directory number from CUCM but not can update line.
from suds.client import Client
cmserver = 'cucm-host'
cmport = '8443'
wsdl = 'file:///C:/Users/Tity/PycharmProjects/begin01/axlsqltoolkit/schema/current/AXLAPI.wsdl'
location = 'https://' + cmserver + ':' + cmport + '/axl/'
username = 'administrator'
password = 'password'
client = Client(wsdl, location=location, username=username, password=password)
print ('\nDirectory Number')
result_line = client.service.listLine({'pattern': '3%'}, {'pattern': '', 'routePartitionName': '', 'associatedDevices': ''})
for i in result_line['return']['line']:
print (str(i['pattern']), str(i['routePartitionName']))
resp = client.service.updateLine(
pattern='3001',
routePartitionName={'value' : "P_Internal", '_uuid' : "{0DA76261-2A84-B998-1BE7-9BD00FFC2E51}"},
newPattern='3014')
=====================ERROR========================
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://www.cisco.com/AXL/API/10.0">
<SOAP-ENV:Header/>
<ns1:Body>
<ns0:updateLine>
<newPattern>3014</newPattern>
</ns0:updateLine>
</ns1:Body>
</SOAP-ENV:Envelope>
Traceback (most recent call last):
File "C:\Users\Tity\AppData\Local\Programs\Python\Python35\lib\site-packages\suds\transport\http.py", line 78, in send
fp = self.u2open(u2request)
File "C:\Users\Tity\AppData\Local\Programs\Python\Python35\lib\site-packages\suds\transport\http.py", line 119, in u2open
return url.open(u2request, timeout=tm)
File "C:\Users\Tity\AppData\Local\Programs\Python\Python35\lib\urllib\request.py", line 472, in open
response = meth(req, response)
File "C:\Users\Tity\AppData\Local\Programs\Python\Python35\lib\urllib\request.py", line 582, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Users\Tity\AppData\Local\Programs\Python\Python35\lib\urllib\request.py", line 510, in error
return self._call_chain(*args)
File "C:\Users\Tity\AppData\Local\Programs\Python\Python35\lib\urllib\request.py", line 444, in _call_chain
result = func(*args)
File "C:\Users\Tity\AppData\Local\Programs\Python\Python35\lib\urllib\request.py", line 590, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 500: Internal Server Error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Tity\AppData\Local\Programs\Python\Python35\lib\site-packages\suds\client.py", line 652, in send
reply = transport.send(request)
File "C:\Users\Tity\AppData\Local\Programs\Python\Python35\lib\site-packages\suds\transport\http.py", line 178, in send
return HttpTransport.send(self, request)
File "C:\Users\Tity\AppData\Local\Programs\Python\Python35\lib\site-packages\suds\transport\http.py", line 86, in send
raise TransportError(e.msg, e.code, e.fp)
suds.transport.TransportError: Internal Server Error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/Tity/PycharmProjects/begin01/CUCM_UpdateLine.py", line 31, in <module>
newPattern='3014')
File "C:\Users\Tity\AppData\Local\Programs\Python\Python35\lib\site-packages\suds\client.py", line 559, in __call__
return client.invoke(args, kwargs)
File "C:\Users\Tity\AppData\Local\Programs\Python\Python35\lib\site-packages\suds\client.py", line 618, in invoke
result = self.send(soapenv)
File "C:\Users\Tity\AppData\Local\Programs\Python\Python35\lib\site-packages\suds\client.py", line 664, in send
result = self.failed(binding, e)
File "C:\Users\Tity\AppData\Local\Programs\Python\Python35\lib\site-packages\suds\client.py", line 720, in failed
r, p = binding.get_fault(reply)
File "C:\Users\Tity\AppData\Local\Programs\Python\Python35\lib\site-packages\suds\bindings\binding.py", line 267, in get_fault
raise WebFault(p, faultroot)
suds.WebFault: b"Server raised fault: 'Directory Number not found'"
12-22-2016 08:48 AM
Hi,
"Server raised fault: 'Directory Number not found'"
Would you add 'uuid' of the line you wanted to update
with pattern - routePartitionName pairs that you have already put in request,
and try again?
Ahmet OZKESEK.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide