Software Development Kit (SDK) and API Discussions
Software Development Kit (SDK) and API Discussions
I want to get list of all volumes of storage system. I am using Netapp manageability sdk 5.1- java bindings. I tried to run VolList.java from sample code provided, but unable to get list of volumes.
Ho do I get list of all available volumes on my storage system?
Solved! See The Solution
Only the classes named with *IterStart are iterator APIs. LunListInfo is a regular API, so you'd use the ApiRunner.run() method.
LunListInfoRequest lunListReq = new LunListInfoRequest();
LunListInfoResponse lunListResp = runner.run(lunListReq);
for (LunInfo lun : lunListResp.getLuns()) {
System.out.println("Lun: " + lun.getPath());
}
Check out the other sample code examples which show how to use some other APIs, including ApiRunner.run().
-Ben
I just tested the VolList.java sample code and it worked fine. Can you post the error message you're getting?
-Ben
Thanks Ben. Actually I got mistake in my program itself.
I am able to get information about volume. Now I want to get information about LUN, DISK and Aggregates. How can I get this information?
What are possible properties I can get using this?
Please review the API documentation. APIs are divided into categories like Volume, LUN, disk, and aggregate. For example you should find AggrList, DiskList, etc. The API documentation will inform you about the parameters. API documentation can be downloaded from http://developer.netapp.com.
Regards,
- Rick -
I want to know what kind of request(which class) do I need to send to get above information?
The classes in the Java bindings map by name to the API names that are listed in the documentation that Rick pointed you to. For example, if you look at the APIs listed in the lun category, you'll find the lun-list-info API, which gets information on LUNs. You invoke this API using the LunListInfoRequest class in the Java bindings.
So again, please download the API documentation from https://communities.netapp.com/community/interfaces_and_tools/developer/apidoc and refer to it to find the APIs you need. Let us know if you get stuck.
-Ben
Thanks Ben. I did it exactly as you told.
But I want to print the result. I tried to use iterator to iterate but not succeed .
Here is a code:
LunListInfoRequest lunreq = new LunListInfoRequest();
System.out.println("luninfo is .. " + lunreq);
Iterator<LunInfo> lunInfoIter = apirunner.iterate(lunreq,10);
In this code I got error to iterate method at line 3.
Is there any alternate way to iterate the object?
Only the classes named with *IterStart are iterator APIs. LunListInfo is a regular API, so you'd use the ApiRunner.run() method.
LunListInfoRequest lunListReq = new LunListInfoRequest();
LunListInfoResponse lunListResp = runner.run(lunListReq);
for (LunInfo lun : lunListResp.getLuns()) {
System.out.println("Lun: " + lun.getPath());
}
Check out the other sample code examples which show how to use some other APIs, including ApiRunner.run().
-Ben