0

I am novice to NETAPP API.

I am using Netapp ONTAP API 8.1 and Java. I want to get system information such as systemname,serial number, vendorID,Total processors etc.

I am able to get system version using following code

try {
ApiRunner apirunner = new ApiRunner(ApiTarget.builder()
        .withHost(host)
    .withUserName(username)
    .withPassword(password)
    .withTargetType(TargetType.FILER)
    .useProtocol(protocol)
    .build()
);

    SystemGetVersionRequest vq = new SystemGetVersionRequest();
System.out.println("version request"+vq);
SystemGetVersionResponse vr = apirunner.run(vq);
storageout.put("version", vr.getVersion());         
}
catch (Exception e){
e.printStackTrace();
System.out.println("Error in getting info");
}

How do I able to get above mentioned system information using ONTAP API and Java? Any workaround or help will be appreciated.

user3322141
  • 158
  • 6
  • 23

1 Answers1

0

Unlike you used API for system version, there is a API for system information named as SystemGetInfoRequest. You can use it as following

SystemGetInfoRequest sq = new SystemGetInfoRequest();
SystemGetInfoResponse sr = apirunner.run(sq);
try {
System.out.println("Systemname"+ sr.getSystemInfo().getSystemName());                     

    System.out.println("SerialNumber"+sr.getSystemInfo().getSystemSerialNumber());
System.out.println("MemorySize"+ sr.getSystemInfo().getMemorySize());
System.out.println("VendorID"+ sr.getSystemInfo().getVendorId());
    System.out.println("TotalProcessors"+ sr.getSystemInfo().getNumberOfProcessors());
} catch (JSONException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

You can extract all system related information like this. Hope this will work for you.

Vishwas
  • 6,967
  • 5
  • 42
  • 69
  • 1
    how do I get CPU and memory utilization? Which API class is there in NETAPP for getting performance of system? – user3322141 Mar 20 '14 at 10:12