use of com.emc.storageos.model.host.HostRestRep in project coprhd-controller by CoprHD.
the class RemoveHostFromCluster method doExecute.
@Override
public Task<HostRestRep> doExecute() throws Exception {
HostUpdateParam hostUpdateParam = new HostUpdateParam();
hostUpdateParam.setCluster(uri("null"));
Task<HostRestRep> task = getClient().hosts().update(host, hostUpdateParam);
return task;
}
use of com.emc.storageos.model.host.HostRestRep in project coprhd-controller by CoprHD.
the class DiscoverHost method executeTask.
@Override
public Task<HostRestRep> executeTask() throws Exception {
HostUpdateParam param = new HostUpdateParam();
param.setDiscoverable(true);
Task<HostRestRep> task = getClient().hosts().update(hostId, param);
addOrderIdTag(task.getTaskResource().getId());
return task;
}
use of com.emc.storageos.model.host.HostRestRep in project coprhd-controller by CoprHD.
the class ClusterAutoExportTest method test3.
public void test3() throws Exception {
// Set auto-export to false on both clusters. Exports will not be triggered.
setClusterAutoExport(cluster1, false);
HostRestRep host = getHosts(cluster2).get(0);
moveHost(host, cluster1);
// wait long enough for export updates to process
Thread.sleep(SLEEP);
verifyHostNotInClusterExport(host, export1);
verifyHostInClusterExport(host, export2);
}
use of com.emc.storageos.model.host.HostRestRep in project coprhd-controller by CoprHD.
the class ClusterAutoExportTest method test2.
public void test2() throws Exception {
// Set auto-export on one cluster. Move host. Exports should be automatic.
setClusterAutoExport(cluster2, false);
HostRestRep host = getHosts(cluster2).get(0);
moveHost(host, cluster1);
verifyHostNotInClusterExport(host, export2);
verifyHostInClusterExport(host, export1);
}
use of com.emc.storageos.model.host.HostRestRep in project coprhd-controller by CoprHD.
the class Hosts method itemsJson.
public static void itemsJson(@As(",") String[] ids) {
Map<URI, String> clusterMap = ResourceUtils.mapNames(getViprClient().clusters().listByTenant(uri(Models.currentAdminTenant())));
List<HostInfo> results = Lists.newArrayList();
if ((ids != null) && (ids.length > 0)) {
for (String id : ids) {
if (StringUtils.isBlank(id)) {
continue;
}
HostRestRep host = HostUtils.getHost(uri(id));
if (host != null) {
Set<URI> dataCenterIds = HostUtils.getDataCenterIds(Lists.newArrayList(host));
Map<URI, VcenterDataCenterRestRep> vcenterDataCenters = HostUtils.getVcenterDataCenters(dataCenterIds);
results.add(new HostInfo(host, clusterMap, vcenterDataCenters));
}
}
}
renderJSON(results);
}
Aggregations