Subscribe
Accepted Solution

WFA REST API test Finder only returns 100 results

If I test a finder through the designer interface I can get a list of all vfilers, volumes, qtrees across all of the arrays depending on what finder I select. However, if I try to do the same tests via the REST API I only get the first 100.

Looking at the wfa_finders.log I can see the log output one below the other and the only difference is the number of rows returned - for the API it's always 100! We plan to use the lists of vfilers, volumes, qtrees etc to validate user requests and build appropriate parameter lists for our provisioning workflows. Without a complete list, we are unable to do what we planned. Any suggestion? Or is there a setting somewhere I can use to increase the number of items returned?

Using the designer interface:-

23:19:41,463 DEBUG [com.netapp.wfa.finders.execution.impl.FindersExecutorImpl] (http-executor-threads - 25) ========================================================================================

23:19:41,463 DEBUG [com.netapp.wfa.finders.execution.impl.FindersExecutorImpl] (http-executor-threads - 25) Executing finder 'Finder{id=322, name='List all vfilers', dictionaryEntry=vFiler}', parameters '{}'

23:19:41,463 DEBUG [com.netapp.wfa.finders.execution.impl.FindersExecutorImpl] (http-executor-threads - 25) Executing local filter 'Get All vfilers', parameters '{}', query 'SELECT

    vfiler.name AS 'name',

    array.ip AS 'array.ip'

FROM

    storage.vfiler AS vfiler

JOIN

    storage.array AS array

        ON vfiler.array_id = array.id

WHERE

    vfiler.name <> 'vfiler0'

    and UCASE(vfiler.name) NOT LIKE 'PH_%''

23:19:41,479 DEBUG [com.netapp.wfa.finders.execution.impl.FindersExecutorImpl] (http-executor-threads - 25) Local filter 'Get All vfilers' successfully executed, rows affected '272'

23:19:41,479 DEBUG [com.netapp.wfa.finders.execution.impl.FindersExecutorImpl] (http-executor-threads - 25) Finder 'List all vfilers' successfully executed, rows returned '272'

23:19:41,479 DEBUG [com.netapp.wfa.finders.execution.impl.FindersExecutorImpl] (http-executor-threads - 25) ========================================================================================

Using the REST API:-

Query : http://MyTestWFAServer/rest/finders/705450e3-8eac-403c-a1a5-55317174f57b/test

Log:-

23:20:56,750 DEBUG [com.netapp.wfa.finders.execution.impl.FindersExecutorImpl] (http-executor-threads - 25) ========================================================================================

23:20:56,750 DEBUG [com.netapp.wfa.finders.execution.impl.FindersExecutorImpl] (http-executor-threads - 25) Executing finder 'Finder{id=322, name='List all vfilers', dictionaryEntry=vFiler}', parameters '{}'

23:20:56,765 DEBUG [com.netapp.wfa.finders.execution.impl.FindersExecutorImpl] (http-executor-threads - 25) Executing local filter 'Get All vfilers', parameters '{}', query 'SELECT

    vfiler.name AS 'name',

    array.ip AS 'array.ip'

FROM

    storage.vfiler AS vfiler

JOIN

    storage.array AS array

        ON vfiler.array_id = array.id

WHERE

    vfiler.name <> 'vfiler0'

    and UCASE(vfiler.name) NOT LIKE 'PH_%''

23:20:56,765 DEBUG [com.netapp.wfa.finders.execution.impl.FindersExecutorImpl] (http-executor-threads - 25) Local filter 'Get All vfilers' successfully executed, rows affected '272'

23:20:56,781 DEBUG [com.netapp.wfa.finders.execution.impl.FindersExecutorImpl] (http-executor-threads - 25) Finder 'List all vfilers' successfully executed, rows returned '100'

23:20:56,781 DEBUG [com.netapp.wfa.finders.execution.impl.FindersExecutorImpl] (http-executor-threads - 25) ========================================================================================

Re: WFA REST API test Finder only returns 100 results

Hi Simon,

By default, the REST API to test finders/filters return 100 results in WFA 2.x versions. Could you use a HTTP header parameter "limit" to increase it to a reasonable value.

In an upcoming release, the default value has been increased.

Thanks,

Shailaja

Re: WFA REST API test Finder only returns 100 results

Worked like a charm, thanks Shailaja!

Re: WFA REST API test Finder only returns 100 results

Could you give me the steps on how to pass that parameter?  looks like the current default is 1000 now but we need more.  Thanks

Re: WFA REST API test Finder only returns 100 results

Hello James,

 

This parameter is the HTTP header which is sent along with the HTTP get request. How to send it depends on your client. If your client is a powershell code the following will work for you.

 

====

$headers = @{}

$headers['limit']='2000'

$cd=Get-Credentials

 

#An example filter test with a parameter being passed

$uri="http://localhost/rest/filters/f19a3191-4593-44f1-9f66-28b31041323f/test?IP=10.0"

 

$data=Invoke-RestMethod -Uri $uri -Credential $cd -Headers $headers

 

#Count the no. of rows returned

$data.filterTestResults.rows.row.Count

 

=====

 

1000 is the default, now you can increase or even decrease this value by using the this Header limit.

 

sinhaa

 

 

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.