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...
Here is a 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 < 3) {
System.err.println("Usage: VolList <storage-system> <user> <passwd> [<volume>]");
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 > 3) {
volListReq.setVolume(args[3]);
}
Iterator<VolumeInfo> 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();
}
}
}
how should I able to get volumelist using netapp and java?
Here is a answer: