날짜: 12-08-2019 06:30 PM
Hi Guys,
I want to activate the home cluster and associate end device on the end user menu. I managed to get it working using Postman. Below are the code.
<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:updateUser>
<userid>TST User100</userid>
<associatedDevices>
<device>CSFTESTADD</device>
</associatedDevices>
<homeCluster>true</homeCluster>
<imAndPresenceEnable>true</imAndPresenceEnable>
</ns:updateUser>
</soapenv:Body>
</soapenv:Envelope>
But when I tried to 'translate' it to Python using the code below, it got "TypeError: Choice elements only work with keyword arguments" error notification.
해결되었습니다! 솔루션으로 이동.
날짜: 12-09-2019 03:51 PM
The data for the updateUser() method is not a single object, but consists of multiple values/objects passed in as individual parameters (in the case where you have the option of using one key or another - such as 'userid' vs. 'uuid' - you must use the actual key name:)
# Create an associated devices object
devices = {
'device': []
}
devices['device'].append( 'CSFTESTPHONE' )
# Execute the updateUser request
try:
resp = service.updateUser(
userid = 'testEndUser',
associatedDevices = devices,
homeCluster = True,
imAndPresenceEnable = True
)
See the sample available here: https://github.com/CiscoDevNet/axl-python-zeep-samples/blob/master/axl_add_update_User.py
날짜: 12-09-2019 03:51 PM
The data for the updateUser() method is not a single object, but consists of multiple values/objects passed in as individual parameters (in the case where you have the option of using one key or another - such as 'userid' vs. 'uuid' - you must use the actual key name:)
# Create an associated devices object
devices = {
'device': []
}
devices['device'].append( 'CSFTESTPHONE' )
# Execute the updateUser request
try:
resp = service.updateUser(
userid = 'testEndUser',
associatedDevices = devices,
homeCluster = True,
imAndPresenceEnable = True
)
See the sample available here: https://github.com/CiscoDevNet/axl-python-zeep-samples/blob/master/axl_add_update_User.py
날짜: 12-09-2019 06:27 PM
Hi dstaudt,
That works like a charm. I did not realize the device had to be processed separately. Thank you for the help.
새로운 아이디어를 발견하고 저장하세요. 전문가 답변, 단계별 가이드, 최근 주제 등 다양한 내용을 확인해 보세요.
처음이신가요? 아래 팁들을 확인해 보세요. 시스코 커뮤니티 사용하기 새 멤버 가이드