use of com.emc.metalnx.core.domain.entity.DataGridServer in project metalnx-web by irods-contrib.
the class StorageServiceImpl method totalAvailableStorageOfGrid.
@Override
public long totalAvailableStorageOfGrid(List<DataGridServer> servers) {
logger.info("Get total available storage of the grid");
long totalAvailableStorage = 0;
for (DataGridServer dataGridServer : servers) {
totalAvailableStorage += dataGridServer.getTotalStorageAvailable();
}
return totalAvailableStorage;
}
use of com.emc.metalnx.core.domain.entity.DataGridServer in project metalnx-web by irods-contrib.
the class DashboardController method getMSIPackageVersion.
@RequestMapping(value = "/msiPackageVersion/", method = RequestMethod.GET)
public String getMSIPackageVersion(Model model) throws DataGridConnectionRefusedException {
logger.info("getMSIPackageVersion()");
DataGridMSIPkgInfo msiGridInfo = msiService.getMSIPkgInfo();
List<DataGridServer> serverList = msiGridInfo.getServers();
model.addAttribute("msiGridInfo", msiGridInfo);
model.addAttribute("servers", serverList);
model.addAttribute("msiAPIVersionSupported", msiAPIVersionSupported);
return "dashboard/msiPackageVersion";
}
use of com.emc.metalnx.core.domain.entity.DataGridServer in project metalnx-web by irods-contrib.
the class DashboardController method getDetailsForHostname.
@RequestMapping(value = "/detail/{hostname}/", method = RequestMethod.GET)
public String getDetailsForHostname(@PathVariable String hostname, Model model) throws DataGridConnectionRefusedException {
logger.info("getDetailsForHostname()");
DataGridServer server = serverMap.get(hostname);
if (server != null) {
if (isServerResponding) {
server.setResources(resourceService.getResourcesOfAServer(hostname, resources));
} else // if the iCAT server is not respoding, we'll get the resources of a server from
// the cache
{
server.setResources(serverMap.get(hostname).getResources());
}
}
model.addAttribute("server", server);
model.addAttribute("isServerResponding", isServerResponding);
return "dashboard/details/index";
}
use of com.emc.metalnx.core.domain.entity.DataGridServer in project metalnx-web by irods-contrib.
the class DashboardController method getMSIInstalledList.
@RequestMapping(value = "/msiInstalledList")
public String getMSIInstalledList(Model model, @RequestParam("host") String hostname) throws DataGridConnectionRefusedException, DataGridRuleException {
logger.info("getMSIINstalledList()");
DataGridServer server = msiService.getMSIsInstalled(hostname);
model.addAttribute("server", server);
return "dashboard/details/msiPackageListPerServer";
}
use of com.emc.metalnx.core.domain.entity.DataGridServer in project metalnx-web by irods-contrib.
the class DashboardController method totalStorageByServer.
@RequestMapping(value = "/storageServer/", method = RequestMethod.POST, produces = { "text/plain" })
@ResponseBody
public String totalStorageByServer(Model model, @RequestParam("hostname") String hostname) {
logger.info("totalStorageByServer()");
DataGridServer serverObj = serverMap.get(hostname);
long totalUsedStorage = serverObj.getTotalStorageUsed();
long totalAvailableStorage = serverObj.getTotalStorageAvailable();
long totalStorage = totalUsedStorage + totalAvailableStorage;
float usagePercentage = (float) totalUsedStorage / totalStorage * 100;
return FileUtils.byteCountToDisplaySize(totalUsedStorage) + "/" + FileUtils.byteCountToDisplaySize(totalAvailableStorage) + "/" + FileUtils.byteCountToDisplaySize(totalStorage) + "/" + String.valueOf(usagePercentage);
}
Aggregations