02-01-2022 09:09 AM
Hi - I'm trying to 'blank' out both the 'sshUserId' and 'sshPwd' fields using the updatePhone method but this only works on the former (sshUserId) and not with sshPwd.
Using Python 3.7.x - here's my snippet:
resp = service.updatePhone(name = 'SEP12345678901112', sshUserId='', sshPwd='')
Can anyone confirm if this should work? Much appreciated!
Solved! Go to Solution.
02-24-2022 08:56 PM
I also can't seem to clear the sshpassword field via <updatePhone> - this would likely be a defect.
I think I was successfully able to use <executeSqlUpdate> as a workaround, hope it helps:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/14.0"> <soapenv:Header/> <soapenv:Body> <ns:executeSQLUpdate sequence="1"> <sql>UPDATE device SET (sshuserid, sshpassword) = ("", "") WHERE name="SEP886100000000"</sql> </ns:executeSQLUpdate> </soapenv:Body> </soapenv:Envelope>
Note, it wouldn't let me set the fields to NULL, but it seems an empty string is acceptable.
02-01-2022 02:59 PM
For a database an empty string is not logically equivalent to a no/Null value.
Can you try setting the sshUserId/sshPwd keys to 'xsd.Nil' (you'll first need to import zeep.xsd?)
This sample demonstrates the usage: https://github.com/CiscoDevNet/axl-python-zeep-samples/blob/master/axl_list_Sip_Trunk.py
02-01-2022 05:53 PM
Hi David - thanks for your response. after importing zeep.xsd, I attempted the following:
resp1 = service.updatePhone(name='SEP12345678901112', sshUserId=xsd.Nil, sshPwd=xsd.Nil)
But this failed to update the fields correctly. Is there a step that I'm missing?
02-24-2022 08:56 PM
I also can't seem to clear the sshpassword field via <updatePhone> - this would likely be a defect.
I think I was successfully able to use <executeSqlUpdate> as a workaround, hope it helps:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/14.0"> <soapenv:Header/> <soapenv:Body> <ns:executeSQLUpdate sequence="1"> <sql>UPDATE device SET (sshuserid, sshpassword) = ("", "") WHERE name="SEP886100000000"</sql> </ns:executeSQLUpdate> </soapenv:Body> </soapenv:Envelope>
Note, it wouldn't let me set the fields to NULL, but it seems an empty string is acceptable.
02-24-2022 09:14 PM
FYI this defect has been opened for tracking: CSCwb05685 - Unable to clear Secure Shell Password using <updatePhone>
03-01-2022 06:00 AM
Hi David, SQLUpdate method works and I can used that as a workaround - thank you. I appreciate you opening the defect!
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: