List devices and their IP Address

Version 1
    This document was generated from CDN thread

    Created by: Francisco Espana on 20-04-2009 03:24:46 PM
    Hi,
     
       I am using Visual Studio 2008 and C# .Net to develop a simple application. I need to get a list of all devices of type 7975 and its IP addresses (So I can then send an HTTP POST request). I can list all the existant 7675's but I'm struggling getting their correspondent IP addresses.
     
    Any sugestions on how to archive this?
     
    Thanks

    Subject: RE: List devices and their IP Address
    Replied by: Francisco Espana on 04-05-2009 11:08:58 PM
    I did it.
     
    Thanks

    Subject: RE: List devices and their IP Address
    Replied by: Walid Azab on 05-05-2009 03:06:20 PM
    HI Francisco ,
     
    I have been trying to do the same thing in .NET as well. Actually I need to change a phone partition based on it's extension.
    Can you help tell me how you did it. Also if you can help tell me how to reach the above I 'd be very thankfull. Here is my code
    up until now:
     
     private void button1_Click(object sender, EventArgs e)
            {
                  
                AXLAPIService oAXL = new AXLAPIService("10.2.2.2", "ccmadministrator", "password123");

                ListDeviceByNameAndClassReq phoneByName = new ListDeviceByNameAndClassReq();
                phoneByName.searchString = "SEP*";
                ListDeviceResDevice[] phones = oAXL.listDeviceByNameAndClass(phoneByName).@return;

                foreach (ListDeviceResDevice phone in phones)
                {

                    lstResult.Items.Add(phone.uuid);
                    lstResult.Items.Add(phone.name);
                }


            }
     
    No AXL error but I always end up with empty returned result.

     
    Another Method is but this gives an AXL Error:
     
    {
        GetPhoneReq req = new GetPhoneReq();
       
        req.ItemElementName = ItemChoiceType29.phoneName;
        req.Item = "SEP0019D2C92685";
       
        GetPhoneRes res = new GetPhoneRes();
       
        try {
            GetPhoneResReturn Phone = oAXL.getPhone(req).@return;
            Console.WriteLine(Phone.device.description);
        }
        catch (Exception ex) {
            Statustext.Text = ex.Message;
        }
    }


     

    Subject: RE: List devices and their IP Address
    Replied by: Jonathan Withers on 27-05-2009 10:56:57 AM
    Hi Francisco,
     
    How did you do it? I'm trying to do the same thing, I can get the details for the device but cannot find where in the rather large database to obtain the IP Address?
     
    Many thanks
     
    Jon

    Subject: RE: List devices and their IP Address
    Replied by: David Staudt on 27-05-2009 03:14:02 PM
    For real time info like IP address and registration status, use the Serviceability SOAP API - in this case RisPort: http://developer.cisco.com/web/sxml/home
     
    There are a couple of how-to samples in the wiki: http://developer.cisco.com/web/sxml/wikidocs

    Subject: RE: List devices and their IP Address
    Replied by: Francisco Espana on 27-05-2009 03:29:55 PM
    Hi,
     
       I first did an AXL request for the devices I wanted to get the IP address, then I used RisPort, and passed that list as a parameter (CmSelectionCriteria) to get the IP address information. The link David shared explains it well.
     
       When using RisPort Serviceability SOAP API just be aware that you will only be able to get IP addresses of registered phones (therefore you will probably want to status set to "Registered" ) and that each request is limited to 200 devices.
     
       Let me know if you need any additional information.
     
    Francisco

    Subject: RE: List devices and their IP Address
    Replied by: Jonathan Withers on 28-05-2009 09:46:50 AM
    Thank you for your help.
     
    I have got this working. My only slight issue is that i'm having to connect using my full administrator account.
     
    Does anybody know what permissions i would need to give an Application User to do RisPort requests?
     
    Many thanks
     
    Jon

    Subject: RE: List devices and their IP Address
    Replied by: David Staudt on 28-05-2009 02:26:42 PM
    The role needed is 'Standard AXL API Access'.  By default, there is no user group with _only_ this permission, so you may want to create one. 

    Subject: RE: List devices and their IP Address
    Replied by: Jonathan Withers on 03-06-2009 10:20:52 AM
    The role needed is 'Standard AXL API Access'.  By default, there is no user group with _only_ this permission, so you may want to create one. 

    Thanks for the help, i have tried with 'Standard AXL API Access' but this role does not have enough permissions. I wounder if our CM has been changed to remove this!
     
    I'll keep digging and let you know.

    Subject: RE: List devices and their IP Address
    Replied by: David Staudt on 03-06-2009 05:24:25 PM
    Looks like RisPort requires the following minimum Roles (tested on my CM7.0(1) lab
     
    - Standard CCM Admin Users (access to web services)
    - Standard SERVICEABILITY Read Only (access to the RisPort API)
     

    Subject: RE: List devices and their IP Address
    Replied by: Jonathan Withers on 04-06-2009 07:08:41 AM
    Thank you.
     
    I will try adding the standard serviceabilitity and see if that works
     
     

    Subject: RE: List devices and their IP Address
    Replied by: Claus Pedersen on 07-12-2010 08:38:22 AM
    I did it.
     
    Thanks

     
    Hi
     
    Do you mind sharing the code it self, no reason reinventing the wheel ?
     
    Kindest regards