Subscribe
Accepted Solution

setQuery withQuery example needed

Hi, 

I am looking for an example of implementing a query to reduce the returned resultset.

When executing the below code, I get: "com.netapp.nmsdk.ApiExecutionException: Extra input: query"

 

...

StorageDiskGetIterRequest diskIterReq = new StorageDiskGetIterRequest ();
StorageDiskInfo sdiQuery = new StorageDiskInfo();
sdiQuery.setDiskName("4d.24.15");
diskIterReq.setQuery(sdiQuery);


Iterator<StorageDiskInfo> stoDiskIter = runner.iterate(diskIterReq, 10);

while(stoDiskIter.hasNext()) // ApiExecutionException thrown here
{

...

 

Re: setQuery withQuery example needed

Can't help, but I'd agree that an example would be valuable. I've tried the same (with the Perl binding) and regardless of what I put into that query it always returns everything (and this is against Cmode which is supposed to support the queries).

 

--rdp

Re: setQuery withQuery example needed

If you are pointing to a 7-Mode system, then that is the expected behavior since the query options isn't supported with 7-Mode systems.

Re: setQuery withQuery example needed

Understood...but I've tried against a cMode machine and it returned the entire dataset.

 

-rdp

Re: setQuery withQuery example needed

Yes, I saw that, but the original posted didn't mention what version of DOT he was using.

Re: setQuery withQuery example needed

I got some help on this and turns out I missed the documenation at the top of the StorageDiskGetIterRequest class.  Since I am running 7-mode, querying is not available for it.

 

Disk enumeration ZAPI. Get disk information about one or more disks, from the Storage Subsystem. Currently only the Data ONTAP Cluster-Mode iterator APIs support filtering of output, to constrain the disks that are included in the return list, and/or what information is returned about each disk. The zapiDefault is to return all information about all disks in the cluster. That list may be reduced using the 'query' input element. For example, the return list may include only (1) Disks visible to a particular cluster node "nodeA", e.g., "query.diskPaths.disk-name=nodeA:*" (2) A particular disk visible to a particular node, e.g., "query.diskPaths.node=nodeA:6a.01". (3) A disk with a particular unique id, e.g., "query.disk-uid=20000000:87A9652B:00000000:00000000:00000000:00000000:00000000:00000000:00000000:00000000" (4) Disks with a name that matches a certain wildcard pattern, e.g., "query.diskPaths.disk-name=6a*". (5) Disks assigned to a particular node. e.g., "query.diskOwnershipInfo.home-node-id=1252487" or "query.diskOwnershipInfo.home-node-name=nodeA". (6) Some subset of disks in the cluster or visible to a particular node in the cluster. If 'desiredAttributes' is included, then only those data specified by in 'desiredAttributes' are returned for each disk. For the Data ONTAP 7-Mode API, since filtering based upon 'query' and 'desiredAttributes' is not yet supported, the behavior is currently to return all available information about all disks visible to the local node. If there is badly formed input or an invalid input value is specified, then EINVALIDINPUTERROR is returned. If there is some internal error which prevents processing of this request, then EINTERNALERROR is returned.

Re: setQuery withQuery example needed

Hi,

 

Did you actually manage to run 'storage-disk-get-iter' with 'query' enabed with Perl library? I'm trying to fetch just 'broken' disks with no luck =(