Software Development Kit (SDK) and API Discussions

setQuery withQuery example needed

MMONTEN01

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
{

...

 

1 ACCEPTED SOLUTION

ckeith

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.

View solution in original post

6 REPLIES 6

richard_payne

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

ckeith

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.

View solution in original post

richard_payne

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

 

-rdp

ckeith

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

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 =(

MMONTEN01

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.

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public