use of com.emc.storageos.model.host.cluster.ClusterRestRep in project coprhd-controller by CoprHD.
the class ClusterAutoExportTest method createBlockVolumeForCluster.
public URI createBlockVolumeForCluster(String clusterName) {
ClusterRestRep cluster = getCluster(clusterName);
List<VirtualArrayRestRep> virtualArrays = client.varrays().findByConnectedCluster(cluster.getId());
// User choice
VirtualArrayRestRep selectedVirtualArray = chooseVirtualArray(virtualArrays);
List<BlockVirtualPoolRestRep> virtualPools = client.blockVpools().getByVirtualArray(selectedVirtualArray.getId());
// User choice
BlockVirtualPoolRestRep selectedVirtualPool = chooseVirtualPool(virtualPools);
List<ProjectRestRep> projects = client.projects().getByUserTenant();
// User choice
ProjectRestRep selectedProject = chooseProject(projects);
URI volumeId = createVolume(selectedVirtualArray, selectedVirtualPool, selectedProject);
return createExport(volumeId, cluster, selectedVirtualArray, selectedProject);
}
use of com.emc.storageos.model.host.cluster.ClusterRestRep in project coprhd-controller by CoprHD.
the class HostClusters method listJson.
public static void listJson() {
List<ClusterRestRep> clusters = ClusterUtils.getClusters(Models.currentAdminTenant());
List<HostClusterDataTable.HostClusterInfo> hostClusterInfos = Lists.newArrayList();
for (ClusterRestRep cluster : clusters) {
hostClusterInfos.add(new HostClusterDataTable.HostClusterInfo(cluster));
}
renderJSON(DataTablesSupport.createJSON(hostClusterInfos, params));
}
use of com.emc.storageos.model.host.cluster.ClusterRestRep in project coprhd-controller by CoprHD.
the class HostMapper method map.
public static ClusterRestRep map(Cluster from) {
if (from == null) {
return null;
}
ClusterRestRep to = new ClusterRestRep();
mapTenantResource(from, to);
to.setProject(toRelatedResource(ResourceTypeEnum.PROJECT, from.getProject()));
to.setVcenterDataCenter(toRelatedResource(ResourceTypeEnum.VCENTERDATACENTER, from.getVcenterDataCenter()));
to.setAutoExportEnabled(from.getAutoExportEnabled());
if ((from.getVolumeGroupIds() != null) && (!from.getVolumeGroupIds().isEmpty())) {
List<RelatedResourceRep> volumeGroups = new ArrayList<RelatedResourceRep>();
for (String volumeGroup : from.getVolumeGroupIds()) {
volumeGroups.add(toRelatedResource(ResourceTypeEnum.VOLUME_GROUP, URI.create(volumeGroup)));
}
to.setVolumeGroups(volumeGroups);
}
return to;
}
Aggregations