2 Replies Latest reply on Aug 4, 2016 12:40 AM by Prashant Kumbhare

    RESTful Web Request - Page size Limitation

    Prashant Kumbhare

      I am trying to fetch all servers in bladelogic using RESTful webservices with blcli. I am using following command for it.

       

      blcli_execute get "/query?BQUERY=SELECT name, _SNOW_OWNER, _DOMAIN, ENV, OS, LOCATION, FQ_HOST, _SUB_APPLICATION  FROM \"SystemObject/Server\""

       

      We have got 3107 servers in total in bladelogic however this query only fetches 3000 servers.

       

      It seems to me that there is a default page size of 3000 in case maxResults parameter is not mentioned.

       

      I get rest of the servers if I execute following query:

       

      blcli_execute get "/query?firstResult=3000&maxresults=200&BQUERY=SELECT name, _SNOW_OWNER, _DOMAIN, ENV, OS, LOCATION, FQ_HOST, _SUB_APPLICATION  FROM \"SystemObject/Server\""

       

      However when I try to increase the value of page size using following query it still gives me 3000 results.

       

      blcli_execute get "/query?maxresults=4000&BQUERY=SELECT name, _SNOW_OWNER, _DOMAIN, ENV, OS, LOCATION, FQ_HOST, _SUB_APPLICATION  FROM \"SystemObject/Server\""

       

      I need all the servers to be returned using a single query. Is there any option which I can use to fetch this or anyone can suggest any workaround?

        • 1. Re: RESTful Web Request - Page size Limitation
          Bill Robinson

          I think you found there’s a blasadmin setting for this right and 3000 is the max?

           

          Is there a reason you can’t use multiple queries to get the results in a loop?  otherwise think about what happens in your env.  you set it to 3500 because you have 3200 servers.  someone adds 500 servers – how do you know that you aren’t getting the full list ?  imo it makes more sense to always query for the next ‘page’ of results until there are no more.

          • 2. Re: RESTful Web Request - Page size Limitation
            Prashant Kumbhare

            Hi Bill, Thanks for you reply.

             

            You are right, there is a setting for max page size. ie. Paging MaxPageSize.

            got to know about this after, I raised a BMC support case. This parameter is set to 3000 in our environment.

            Yes a better option is to keep the setting same and iterate through pages. I am going to implement the same in our code.