CUCM 6.13 - How to do Data Throttling w/ listUserByName

Version 1
    This document was generated from CDN thread

    Created by: Keith Lunn on 30-07-2009 01:21:35 PM
    Hello Folks!
    The API Release Notes for 6.13 discuss data throttling but unfortunately they only provide examples for using it with the executeSQLquery API.
     select SKIP <SkipCount> First <StepSize> * from endusers;
     
    How is it used with the "list" APIs such as listUserByName?
     
    strSoapPayload += " <SOAP-ENV:Body>";
    strSoapPayload += " <ns:listUserByName sequence=\"" + intAXLSeqNum + "\">";
    strSoapPayload += " <firstname>*</firstname>"; // first name
    strSoapPayload += " <lastname>*</lastname>"; // last name
    strSoapPayload += " <searchLimit></searchLimit>"; //max number of users to be displayed
    strSoapPayload += " </ns:listUserByName>";
    strSoapPayload += " </SOAP-ENV:Body>";

    Subject: RE: CUCM 6.13 - How to do Data Throttling w/ listUserByName
    Replied by: David Staudt on 30-07-2009 07:55:04 PM
    For now, you may need to break up your list query into manageable blocks, for example listUseByName with <lastName>a%</lastName> and then another request with <lastName>b%</lastName> etc.  It looks like this query is case insensitive, so a% returns both 'adams' and 'Adams'.  Tested on CM7.0(1)
     
    Additional skip/first type paging mechanisms are roadmapped for AXL list queries in a future release.

    Subject: RE: CUCM 6.13 - How to do Data Throttling w/ listUserByName
    Replied by: Keith Lunn on 30-07-2009 11:16:06 PM
    Hi David. Wow - that is direct contradiction to the 6.13 API Release notes. I'll open a TAC case on this and see what TAC says - sounds like it's going to be another Bug Report on AXL documentation.
    Yes, the listUserByName API is case insensitive - I definitely tested that and had to break it into 26 queries for a program I wrote against a 4.13 server - what a pain!!

    Will report back w/ TAC results.
    Thanks!!

    Subject: RE: CUCM 6.13 - How to do Data Throttling w/ listUserByName
    Replied by: Keith Lunn on 28-08-2009 05:56:33 PM
    IN CUCM 6.13, you CAN do data throttling w/ "List" APIs such as listUserByName.
    There is a "trick" as revealed in running AXL traces in DEBUG mode - if you do not inlcude the <searchLimit>0</searchLimit> tag in your AXL request, the searchLimit default of 500 will be used and will override your <first> and <skip> tags.
    This is the proper way to use it with list APIs:
    i.e.
    strSoapPayload = "<SOAP-ENV:Envelope";
    strSoapPayload += " xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"";
    strSoapPayload += " xmlns:axlns=\"http://www.cisco.com/AXL/API/6.1\">";
    strSoapPayload += " <SOAP-ENV:Header/>";
    strSoapPayload += " <SOAP-ENV:Body>";
    strSoapPayload += " <axlns:listUserByName sequence=\"" + intAXLSeqNum + "\">";
    strSoapPayload += " <firstname>*</firstname>"; // first name
    strSoapPayload += " <lastname>*</lastname>"; // last name
    strSoapPayload += " <skip>" + intSkip + "</skip>"; // num of recs to skip
    strSoapPayload += " <first>" + intThrottle + "</first>"; // num of recs to extract
    strSoapPayload += " <searchLimit>0</searchLimit>"; //need to make first and skip tags work

    strSoapPayload += " </axlns:listUserByName>";
    strSoapPayload += " </SOAP-ENV:Body>";
    strSoapPayload += " </SOAP-ENV:Envelope>";
    This code would be executed in a loop manner until it returns less records than intThrottle (the amount of records you are fetching for the cycle).