Search in sources :

Example 21 with ClusterRestRep

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);
}
Also used : ClusterRestRep(com.emc.storageos.model.host.cluster.ClusterRestRep) VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep) BlockVirtualPoolRestRep(com.emc.storageos.model.vpool.BlockVirtualPoolRestRep) ProjectRestRep(com.emc.storageos.model.project.ProjectRestRep) URI(java.net.URI)

Example 22 with ClusterRestRep

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));
}
Also used : ClusterRestRep(com.emc.storageos.model.host.cluster.ClusterRestRep) HostClusterDataTable(models.datatable.HostClusterDataTable)

Example 23 with ClusterRestRep

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;
}
Also used : ClusterRestRep(com.emc.storageos.model.host.cluster.ClusterRestRep) RelatedResourceRep(com.emc.storageos.model.RelatedResourceRep) ArrayList(java.util.ArrayList)

Aggregations

ClusterRestRep (com.emc.storageos.model.host.cluster.ClusterRestRep)23 HostRestRep (com.emc.storageos.model.host.HostRestRep)7 Asset (com.emc.sa.asset.annotation.Asset)6 AssetOption (com.emc.vipr.model.catalog.AssetOption)6 URI (java.net.URI)6 RelatedResourceRep (com.emc.storageos.model.RelatedResourceRep)5 VcenterDataCenterRestRep (com.emc.storageos.model.host.vcenter.VcenterDataCenterRestRep)4 VcenterRestRep (com.emc.storageos.model.host.vcenter.VcenterRestRep)4 DefaultResourceFilter (com.emc.vipr.client.core.filters.DefaultResourceFilter)3 ProjectRestRep (com.emc.storageos.model.project.ProjectRestRep)2 FlashException (controllers.util.FlashException)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)1 Vcenter (com.emc.storageos.db.client.model.Vcenter)1 VcenterDataCenter (com.emc.storageos.db.client.model.VcenterDataCenter)1 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)1 SnapshotList (com.emc.storageos.model.SnapshotList)1 VirtualArrayRelatedResourceRep (com.emc.storageos.model.VirtualArrayRelatedResourceRep)1 VolumeGroupList (com.emc.storageos.model.application.VolumeGroupList)1