03-28-2020 11:16 AM - edited 03-28-2020 11:17 AM
Through the AXL Java API, does anyone know how to assign existing users to an existing role?
03-29-2020 01:20 AM
03-30-2020 10:41 AM
Thanks, I had looked at those. I just ended up doing a SQL update. The code is below in case it helps anyone.
ExecuteSQLUpdateReq sqlUpdateReq = new ExecuteSQLUpdateReq(); ExecuteSQLUpdateRes SQLUpdate; String update = "insert into enduserdirgroupmap(pkid, fkenduser, fkdirgroup) values(newId(), '%s', '%s')"; /** * fkenduser = pkid of user * fkdirgroup = pkid of group /** sqlUpdateReq.setSql(String.format(update, fkenduser, fkdirgroup)); try { SQLUpdate = axlPort.executeSQLUpdate(sqlUpdateReq); } catch (Exception e) { e.printStackTrace(); }
05-07-2020 12:41 AM
I am no fan of doing this by SQL Updates because there you can have pretty strange behavior.
If you use AXL the Interface checks it everything is ok before processing your request.
I always recommend to read the AXL documentation and maybe use a get response to see the XML Layout which is working
04-08-2020 06:35 AM
Roles are held in User Access Control Groups. You can manage the membership of these Access Control Groups with AXL via <updateUserGroup>, for example to add user 'dstaudt' to the 'Standard CCM Read Only' Access Control Group (which has 3 roles):
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/12.5"> <soapenv:Header/> <soapenv:Body> <ns:updateUserGroup sequence="1"> <name>Standard CCM Read Only</name> <addMembers> <member> <userId>dstaudt</userId> </member> </addMembers> </ns:updateUserGroup> </soapenv:Body> </soapenv:Envelope>
I don't have a Java sample of that particular operation, however this repo has a few that hopefully can get you started in the right direction: https://github.com/CiscoDevNet/axl-java-samples
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