Search in sources :

Example 6 with VcenterDataCenterRestRep

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;
}
Also used : VcenterDataCenterRestRep(com.emc.storageos.model.host.vcenter.VcenterDataCenterRestRep) VcenterClusterParam(com.emc.storageos.model.compute.VcenterClusterParam)

Example 7 with VcenterDataCenterRestRep

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;
}
Also used : VcenterDataCenterRestRep(com.emc.storageos.model.host.vcenter.VcenterDataCenterRestRep) VcenterDataCenterUpdate(com.emc.storageos.model.host.vcenter.VcenterDataCenterUpdate)

Example 8 with VcenterDataCenterRestRep

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;
}
Also used : VcenterDataCenterRestRep(com.emc.storageos.model.host.vcenter.VcenterDataCenterRestRep) VcenterClusterParam(com.emc.storageos.model.compute.VcenterClusterParam)

Example 9 with VcenterDataCenterRestRep

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);
}
Also used : HostRestRep(com.emc.storageos.model.host.HostRestRep) VcenterDataCenterRestRep(com.emc.storageos.model.host.vcenter.VcenterDataCenterRestRep) URI(java.net.URI) HostInfo(models.datatable.HostDataTable.HostInfo)

Example 10 with VcenterDataCenterRestRep

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;
}
Also used : VcenterDataCenterRestRep(com.emc.storageos.model.host.vcenter.VcenterDataCenterRestRep)

Aggregations

VcenterDataCenterRestRep (com.emc.storageos.model.host.vcenter.VcenterDataCenterRestRep)10 HostRestRep (com.emc.storageos.model.host.HostRestRep)4 ClusterRestRep (com.emc.storageos.model.host.cluster.ClusterRestRep)4 VcenterRestRep (com.emc.storageos.model.host.vcenter.VcenterRestRep)3 URI (java.net.URI)3 RelatedResourceRep (com.emc.storageos.model.RelatedResourceRep)2 VcenterClusterParam (com.emc.storageos.model.compute.VcenterClusterParam)2 HostInfo (models.datatable.HostDataTable.HostInfo)2 Asset (com.emc.sa.asset.annotation.Asset)1 VcenterDataCenterUpdate (com.emc.storageos.model.host.vcenter.VcenterDataCenterUpdate)1 ProjectRestRep (com.emc.storageos.model.project.ProjectRestRep)1 AssetOption (com.emc.vipr.model.catalog.AssetOption)1 HashMap (java.util.HashMap)1