Showing posts with label axl. Show all posts
Showing posts with label axl. Show all posts

Friday, August 24, 2012

Cisco AXL stuff in C# snip 2

Adding a user group to a user sounded fairly easy...took a bit of digging in the ambiguous Item..fields.You need to add user or get use before adding usergroup, not possible in same operation as add user.

                    UpdateUserGroupReq _uug_req = new UpdateUserGroupReq();
                    _uug_req.Item = "Standard CCM End Users";
                    _uug_req.ItemElementName = ItemChoiceType63.name;
                    XUserGroupMember _xugm = new XUserGroupMember();
                    UpdateUserGroupReqAddMembers _xugam = new UpdateUserGroupReqAddMembers();
                    _xugm.uuid = _sres.@return;//This is the return from addUser
                    _xugm.Item = _xuser.userid;
                    _xugam.member = new XUserGroupMember[] { _xugm };
                    _uug_req.Items = new UpdateUserGroupReqAddMembers[] { _xugam };
                    _uug_req.ItemsElementName = new ItemsChoiceType6[] { ItemsChoiceType6.addMembers };
                    _sres = _proxy.updateUserGroup(_uug_req);

Some Cisco AXL stuff in C# Snip 1.

Referring to Cisco Unified Configuration Manager.
First off, this stuff is damned hard to find out any documentation for the API's, very few examples around, developer forums pretty bare of any answers to a multitude of questions.

This was about the most helpful page that I found on the internet to start me off on the right footing.
http://ciscoaxlguy.wordpress.com/
Problem was for me, my client was on V7.1, so a few things were not working and needed investigation. So all of my snippets will be related to V7.1, Cisco seems to break a lot between releases.

To get Extension mobility objects in to the device profile I needed to query the database directly.

                     ExecuteSQLQueryReq _eSql_req = new ExecuteSQLQueryReq();
                     ExecuteSQLQueryRes _eSql_res;
                    _eSql_req.sql = "select name,pkid from telecasterservice";
                    _eSql_res = _proxy.executeSQLQuery(_eSql_req);

Don't believe the documentation that tells you that the underlying indicator to find an Unnassigned DN from the route plan report is the 'isCallable' flag. This flag relates to the UI interface 'Active' checkbox on the line details. Unfortunately this flag does not get updated if the associated device  is deleted and the line not, which is quite often the case.
The report must actually do the following sql query:-
select dnorpattern from numplan n inner join typepatternusage as tpu on n.tkpatternusage=tpu.enum left outer join devicenumplanmap as dmap on n.pkid = dmap.fknumplan where tpu.name='Device' and dmap.fknumplan is null and dnorpattern like...
So basically trying to find an unassociated device.