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);
}
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);
}
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);
}
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));
}
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));
}
Aggregations