use of com.emc.storageos.model.host.HostRestRep in project coprhd-controller by CoprHD.
the class Hosts method itemDetails.
public static void itemDetails(String id) {
HostRestRep host = HostUtils.getHost(uri(id));
ClusterRestRep cluster = ClusterUtils.getCluster(ResourceUtils.id(host.getCluster()));
VcenterDataCenterRestRep dataCenter = VCenterUtils.getDataCenter(ResourceUtils.id(host.getvCenterDataCenter()));
VcenterRestRep vcenter = VCenterUtils.getVCenter(dataCenter);
render(host, cluster, dataCenter, vcenter);
}
use of com.emc.storageos.model.host.HostRestRep in project coprhd-controller by CoprHD.
the class Hosts method edit.
@FlashException("list")
public static void edit(String id) {
HostRestRep dbHost = HostUtils.getHost(uri(id));
if (dbHost != null) {
addReferenceData();
HostForm host = new HostForm(dbHost);
List<InitiatorRestRep> initiators = HostUtils.getInitiators(dbHost.getId());
List<IpInterfaceRestRep> ipInterfaces = HostUtils.getIpInterfaces(dbHost.getId());
render(host, dbHost, initiators, ipInterfaces);
} else {
flash.error(MessagesUtils.get(UNKNOWN, id));
list();
}
}
use of com.emc.storageos.model.host.HostRestRep in project coprhd-controller by CoprHD.
the class BlockExportGroups method availableHostsJson.
public static void availableHostsJson(String exportGroupId) {
List<HostRestRep> availableHosts = Lists.newArrayList();
ExportGroupRestRep exportGroup = getViprClient().blockExports().get(uri(exportGroupId));
final List<URI> exportGroupHosts = ResourceUtils.ids(exportGroup.getHosts());
List<URI> hostIds = getValidHosts(exportGroup);
if (!hostIds.isEmpty()) {
availableHosts = getViprClient().hosts().getByIds(hostIds, new DefaultResourceFilter<HostRestRep>() {
@Override
public boolean accept(HostRestRep item) {
return !exportGroupHosts.contains(item.getId());
}
});
}
renderJSON(DataTablesSupport.createJSON(availableHosts, params));
}
use of com.emc.storageos.model.host.HostRestRep in project coprhd-controller by CoprHD.
the class HostInitiators method list.
public static void list(String hostId) {
HostRestRep host = HostUtils.getHost(uri(hostId));
if (host == null) {
flash.error(Messages.get(Hosts.UNKNOWN, hostId));
Hosts.list();
}
boolean initiatorsEditable = host.getDiscoverable() == null ? false : !host.getDiscoverable();
InitiatorForm initiator = new InitiatorForm();
renderArgs.put("dataTable", new HostInitiatorDataTable());
if (!initiatorsEditable) {
flash.put("warning", MessagesUtils.get("initiators.notEditable"));
}
render(host, initiator, initiatorsEditable);
}
use of com.emc.storageos.model.host.HostRestRep in project coprhd-controller by CoprHD.
the class BlockExports method findByHostOrCluster.
/**
* Finds the exports associated with a host (or that host's cluster) that are for the given project. If a virtual
* array ID is specified, only exports associated with that virtual array are returned.
*
* @param hostId
* the ID of the host.
* @param projectId
* the ID of the project.
* @param virtualArrayId
* the ID of the virtual array to restrict the exports to, or null for no restriction.
* @return the list of export groups associated with the host or any host in the same cluster.
* @deprecated This method was only used in one test class {@code ViPRClientApp} which doesn't use this method anymore.
*/
@Deprecated
public List<ExportGroupRestRep> findByHostOrCluster(URI hostId, URI projectId, URI virtualArrayId) {
HostRestRep host = parent.hosts().get(hostId);
URI clusterId = (host != null) ? id(host.getCluster()) : null;
ResourceFilter<ExportGroupRestRep> filter;
if (virtualArrayId == null) {
filter = new ExportHostOrClusterFilter(hostId, clusterId);
} else {
filter = new ExportHostOrClusterFilter(hostId, clusterId).and(new ExportVirtualArrayFilter(virtualArrayId));
}
return findByProject(projectId, filter);
}
Aggregations