use of com.emc.storageos.model.host.vcenter.VcenterDataCenterRestRep in project coprhd-controller by CoprHD.
the class CreateVcenterCluster method doExecute.
@Override
public Task<VcenterDataCenterRestRep> doExecute() throws Exception {
VcenterClusterParam clusterParam = new VcenterClusterParam(cluster);
Task<VcenterDataCenterRestRep> task = getClient().vcenterDataCenters().createVcenterCluster(datacenter, clusterParam);
return task;
}
use of com.emc.storageos.model.host.vcenter.VcenterDataCenterRestRep in project coprhd-controller by CoprHD.
the class VcenterDataCenterUtils method updateDataCenter.
public static VcenterDataCenterRestRep updateDataCenter(URI id, URI tenantId) {
VcenterDataCenterUpdate update = new VcenterDataCenterUpdate();
VcenterDataCenterRestRep dataCenter = getDataCenter(id);
if (dataCenter != null) {
update.setName(dataCenter.getName());
update.setTenant(tenantId);
return getViprClient().vcenterDataCenters().update(id, update);
}
return null;
}
use of com.emc.storageos.model.host.vcenter.VcenterDataCenterRestRep in project coprhd-controller by CoprHD.
the class UpdateVcenterCluster method doExecute.
@Override
public Task<VcenterDataCenterRestRep> doExecute() throws Exception {
VcenterClusterParam clusterParam = new VcenterClusterParam(cluster);
Task<VcenterDataCenterRestRep> task = getClient().vcenterDataCenters().updateVcenterCluster(datacenter, clusterParam);
return task;
}
use of com.emc.storageos.model.host.vcenter.VcenterDataCenterRestRep 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);
}
use of com.emc.storageos.model.host.vcenter.VcenterDataCenterRestRep in project coprhd-controller by CoprHD.
the class HostMapper method map.
public static VcenterDataCenterRestRep map(VcenterDataCenter from) {
if (from == null) {
return null;
}
VcenterDataCenterRestRep to = new VcenterDataCenterRestRep();
mapTenantResource(from, to);
to.setVcenter(toRelatedResource(ResourceTypeEnum.VCENTER, from.getVcenter()));
return to;
}
Aggregations