title: How to get volumelist using netapp sdk and java?
body: <p>I want to get volumelist on storage system using netapp manageability sdk and java.
  I am able to get only version and type of storage system.
  I am running a sample program given with sdk, but it gives me null values...</p>
  
  <p>Here is a code...</p>
  
  <pre><code>import com.netapp.nmsdk.client.ApiRunner;
  import com.netapp.nmsdk.client.ApiTarget;
  import com.netapp.nmsdk.client.ApiTarget.TargetType;
  import com.netapp.nmsdk.ontap.api.volume.VolumeInfo;
  import com.netapp.nmsdk.ontap.api.volume.VolumeListInfoIterStartRequest;
  import com.netapp.nmsdk.ontap.api.volume.VolumeListInfoIterStartRequest;
  import java.util.Iterator;
  import java.util.List;
  
  public class VolList {
  
  public static void main(String[] args) { 
  
      if (args.length &lt; 3) {
          System.err.println("Usage: VolList &lt;storage-system&gt; &lt;user&gt; &lt;passwd&gt; [&lt;volume&gt;]");
          System.err.println("    Note: This sample code will list the volume information of a 7-Mode Storage system.");
          System.exit(1);
      }
      try {
          ApiRunner runner = new ApiRunner(ApiTarget.builder()
              .withHost(args[0])
              .withUserName(args[1])
              .withPassword(args[2])
              .withTargetType(TargetType.FILER)
              .useHttp()
              .build());
  
          VolumeListInfoIterStartRequest volListReq = new VolumeListInfoIterStartRequest();
          if (args.length &gt; 3) {
              volListReq.setVolume(args[3]);
          }
  
          Iterator&lt;VolumeInfo&gt; volumeIter = runner.iterate(volListReq, 10);
  
          VolumeInfo volume;
  
          while(volumeIter.hasNext()) {
              System.out.println("------------------------------------------------");
              volume = volumeIter.next();
              System.out.println("Name               : " + volume.getName()); 
              System.out.println("Type               : " + volume.getType()); 
              System.out.println("State              : " + volume.getState());
              System.out.println("Total size (bytes) : " + volume.getSizeTotal());
              System.out.println("Used size (bytes)  : " + volume.getSizeUsed());
              System.out.println("------------------------------------------------");
          }
      } catch(Exception e) {
          e.printStackTrace();
      }
  }
  }
  </code></pre>
  
  <p>how should I able to get volumelist using netapp and java?</p>