Search in sources :

Example 1 with DataGridServer

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;
}
Also used : DataGridServer(com.emc.metalnx.core.domain.entity.DataGridServer)

Example 2 with DataGridServer

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";
}
Also used : DataGridMSIPkgInfo(com.emc.metalnx.core.domain.entity.DataGridMSIPkgInfo) DataGridServer(com.emc.metalnx.core.domain.entity.DataGridServer) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 3 with DataGridServer

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";
}
Also used : DataGridServer(com.emc.metalnx.core.domain.entity.DataGridServer) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 4 with DataGridServer

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";
}
Also used : DataGridServer(com.emc.metalnx.core.domain.entity.DataGridServer) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 5 with DataGridServer

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);
}
Also used : DataGridServer(com.emc.metalnx.core.domain.entity.DataGridServer) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

DataGridServer (com.emc.metalnx.core.domain.entity.DataGridServer)31 Test (org.junit.Test)12 DataGridResource (com.emc.metalnx.core.domain.entity.DataGridResource)7 ArrayList (java.util.ArrayList)5 Matchers.anyString (org.mockito.Matchers.anyString)4 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)4 DataGridMSIPkgInfo (com.emc.metalnx.core.domain.entity.DataGridMSIPkgInfo)2 DataGridConnectionRefusedException (com.emc.metalnx.core.domain.exceptions.DataGridConnectionRefusedException)2 DataGridServerStatusComparator (com.emc.metalnx.services.machine.util.DataGridServerStatusComparator)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 IOException (java.io.IOException)2 UnknownHostException (java.net.UnknownHostException)2 Before (org.junit.Before)2 ServerInformationRetrievalThread (com.emc.metalnx.services.machine.util.ServerInformationRetrievalThread)1 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1