Search in sources :

Example 91 with NamedRelatedResourceRep

use of com.emc.storageos.model.NamedRelatedResourceRep in project coprhd-controller by CoprHD.

the class WorkflowBuilder method getInventoryFilesForPackage.

public static void getInventoryFilesForPackage(final URI packageId) {
    final List<String> inventoryFileNames = new ArrayList<String>();
    if (null != packageId) {
        final CustomServicesPrimitiveResourceList customServicesPrimitiveResourceList = getCatalogClient().customServicesPrimitives().getPrimitiveResourcesByType(CustomServicesConstants.ANSIBLE_INVENTORY_TYPE, packageId);
        if (null != customServicesPrimitiveResourceList.getResources()) {
            for (NamedRelatedResourceRep inventoryResource : customServicesPrimitiveResourceList.getResources()) {
                inventoryFileNames.add(inventoryResource.getName());
            }
        }
    }
    renderJSON(inventoryFileNames);
}
Also used : CustomServicesPrimitiveResourceList(com.emc.storageos.model.customservices.CustomServicesPrimitiveResourceList) ArrayList(java.util.ArrayList) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep)

Example 92 with NamedRelatedResourceRep

use of com.emc.storageos.model.NamedRelatedResourceRep in project coprhd-controller by CoprHD.

the class WorkflowBuilder method setAnsibleResources.

private static void setAnsibleResources() {
    final CustomServicesPrimitiveResourceList customServicesPrimitiveResourceList = getCatalogClient().customServicesPrimitives().getPrimitiveResourcesByType(StepType.LOCAL_ANSIBLE.toString(), null);
    final List<StringOption> ansibleResourceNames = new ArrayList<StringOption>();
    if (null != customServicesPrimitiveResourceList.getResources()) {
        for (final NamedRelatedResourceRep resourceRep : customServicesPrimitiveResourceList.getResources()) {
            ansibleResourceNames.add(new StringOption(resourceRep.getId().toString(), resourceRep.getName()));
        }
    }
    renderArgs.put("ansibleResourceNames", ansibleResourceNames);
}
Also used : CustomServicesPrimitiveResourceList(com.emc.storageos.model.customservices.CustomServicesPrimitiveResourceList) StringOption(util.StringOption) ArrayList(java.util.ArrayList) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep)

Example 93 with NamedRelatedResourceRep

use of com.emc.storageos.model.NamedRelatedResourceRep in project coprhd-controller by CoprHD.

the class ComputeVirtualPools method computeVirtualPoolDetails.

public static void computeVirtualPoolDetails(String id) {
    ComputeVirtualPoolRestRep computeVirtualPool = ComputeVirtualPoolUtils.getComputeVirtualPool(id);
    if (computeVirtualPool == null) {
        error(MessagesUtils.get(UNKNOWN, id));
    }
    List<NamedRelatedResourceRep> temps = computeVirtualPool.getServiceProfileTemplates();
    List<RelatedResourceRep> varrays = computeVirtualPool.getVirtualArrays();
    StringBuilder selectedTemplatesBuilder = new StringBuilder();
    for (RelatedResourceRep varray : varrays) {
        List<ComputeSystemRestRep> arrayComputes = VirtualArrayUtils.getComputeSystems(varray.getId());
        for (ComputeSystemRestRep acomp : arrayComputes) {
            for (NamedRelatedResourceRep spt : acomp.getServiceProfileTemplates()) {
                if (CollectionUtils.isNotEmpty(temps)) {
                    for (NamedRelatedResourceRep template : temps) {
                        if (spt.getId().equals(template.getId())) {
                            selectedTemplatesBuilder.append(acomp.getName()).append(" - ").append(template.getName()).append(", ");
                        }
                    }
                }
            }
        }
    }
    String selectedTemplatesString = StringUtils.stripEnd(selectedTemplatesBuilder.toString(), ", ");
    render(computeVirtualPool, selectedTemplatesString);
}
Also used : ComputeVirtualPoolRestRep(com.emc.storageos.model.vpool.ComputeVirtualPoolRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) RelatedResourceRep(com.emc.storageos.model.RelatedResourceRep) ComputeSystemRestRep(com.emc.storageos.model.compute.ComputeSystemRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep)

Example 94 with NamedRelatedResourceRep

use of com.emc.storageos.model.NamedRelatedResourceRep in project coprhd-controller by CoprHD.

the class BlockApplications method applicationSnapshotJson.

public static void applicationSnapshotJson(String id) {
    List<ApplicationSnapshotSets> snapDetails = Lists.newArrayList();
    Set<String> snapSets = AppSupportUtil.getVolumeGroupSnapshotSets(id);
    for (String snap : snapSets) {
        List<NamedRelatedResourceRep> snapshots = AppSupportUtil.getVolumeGroupSnapshotsForSet(id, snap);
        snapDetails.add(new ApplicationSnapshotSets(snap, snapshots));
    }
    renderJSON(DataTablesSupport.createJSON(snapDetails, params));
}
Also used : NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) ApplicationSnapshotSets(models.datatable.ApplicationSnapshotSetDataTable.ApplicationSnapshotSets)

Example 95 with NamedRelatedResourceRep

use of com.emc.storageos.model.NamedRelatedResourceRep in project coprhd-controller by CoprHD.

the class BlockApplications method applicationCloneJson.

public static void applicationCloneJson(String id) {
    List<ApplicationFullCopySets> cloneDetails = Lists.newArrayList();
    Set<String> clonesSet = AppSupportUtil.getFullCopySetsByApplication(id);
    for (String clone : clonesSet) {
        List<NamedRelatedResourceRep> volumeDetailClone = AppSupportUtil.getVolumeGroupFullCopiesForSet(id, clone);
        cloneDetails.add(new ApplicationFullCopySets(clone, volumeDetailClone));
    }
    renderJSON(DataTablesSupport.createJSON(cloneDetails, params));
}
Also used : NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) ApplicationFullCopySets(models.datatable.ApplicationFullCopySetsDataTable.ApplicationFullCopySets)

Aggregations

NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)111 URI (java.net.URI)47 ArrayList (java.util.ArrayList)28 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)22 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)18 Asset (com.emc.sa.asset.annotation.Asset)11 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)11 AssetOption (com.emc.vipr.model.catalog.AssetOption)9 HashMap (java.util.HashMap)8 GET (javax.ws.rs.GET)8 Produces (javax.ws.rs.Produces)8 NamedVolumesList (com.emc.storageos.model.block.NamedVolumesList)7 Path (javax.ws.rs.Path)7 RelatedResourceRep (com.emc.storageos.model.RelatedResourceRep)6 NamedURI (com.emc.storageos.db.client.model.NamedURI)5 SnapshotList (com.emc.storageos.model.SnapshotList)5 TaskResourceRep (com.emc.storageos.model.TaskResourceRep)5 StorageSystemRestRep (com.emc.storageos.model.systems.StorageSystemRestRep)5 HashSet (java.util.HashSet)5 List (java.util.List)5