如何使用Netapp ONTAP8.1 API和java获取系统信息?

如何使用Netapp ONTAP8.1 API和java获取系统信息?,java,netapp,Java,Netapp,我是NETAPP API的新手 我正在使用Netapp ONTAP API 8.1和Java。 我想获取系统信息,如系统名称、序列号、供应商ID、处理器总数等 我可以使用以下代码获得系统版本 try { ApiRunner apirunner = new ApiRunner(ApiTarget.builder() .withHost(host) .withUserName(username) .withPassword(password) .withTar

我是NETAPP API的新手

我正在使用Netapp ONTAP API 8.1和Java。 我想获取系统信息,如系统名称、序列号、供应商ID、处理器总数等

我可以使用以下代码获得系统版本

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");
}
如何使用ontapapi和Java获取上述系统信息?
任何解决方法或帮助都将不胜感激。

与系统版本使用的API不同,系统信息有一个名为SystemGetInfoRequest的API。您可以按如下方式使用它

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();
}
您可以像这样提取所有与系统相关的信息。
希望这对您有用。

如何获得CPU和内存利用率?NETAPP中有哪种API类可以提高系统性能?