use of util.StringOption in project coprhd-controller by CoprHD.
the class WorkflowBuilder method setRestCallResources.
private static void setRestCallResources() {
final List<StringOption> restCallAuthTypes = new ArrayList<StringOption>();
restCallAuthTypes.add(new StringOption(AuthType.NONE.toString(), Messages.get("rest.authType.noAuth")));
restCallAuthTypes.add(new StringOption(AuthType.BASIC.toString(), Messages.get("rest.authType.basicAuth")));
renderArgs.put("restCallAuthTypes", restCallAuthTypes);
}
use of util.StringOption in project coprhd-controller by CoprHD.
the class ComputeVirtualPools method getServiceProfileTemplates.
public static void getServiceProfileTemplates(ComputeVirtualPoolsForm computeVirtualPool) {
List<ComputeSystemRestRep> allComputes = Lists.newArrayList();
List<StringOption> templateList = Lists.newArrayList();
List<String> temps = Lists.newArrayList();
if (computeVirtualPool.id != null) {
ComputeVirtualPoolRestRep computePool = ComputeVirtualPoolUtils.getComputeVirtualPool(computeVirtualPool.id);
for (NamedRelatedResourceRep tmp : computePool.getServiceProfileTemplates()) {
temps.add(tmp.getId().toString());
}
}
Map<String, Set<String>> csTemplatesMap = new HashMap<String, Set<String>>();
Map<String, String> computeSystemsMap = new HashMap<String, String>();
Map<String, String> templatesMap = new HashMap<String, String>();
if (computeVirtualPool.virtualArrays != null) {
for (String arrayId : computeVirtualPool.virtualArrays) {
List<ComputeSystemRestRep> arrayComputes = VirtualArrayUtils.getComputeSystems(uri(arrayId));
for (ComputeSystemRestRep acomp : arrayComputes) {
String compId = acomp.getId().toString();
if (!computeSystemsMap.containsKey(compId)) {
computeSystemsMap.put(compId, acomp.getName());
}
Set<String> spts = csTemplatesMap.get(compId);
if (spts == null) {
spts = new HashSet<String>();
}
for (NamedRelatedResourceRep spt : acomp.getServiceProfileTemplates()) {
spts.add(spt.getId().toString());
if (!templatesMap.containsKey(spt.getId().toString())) {
templatesMap.put(spt.getId().toString(), spt.getName());
}
}
csTemplatesMap.put(compId, spts);
}
}
for (Entry<String, Set<String>> comp : csTemplatesMap.entrySet()) {
Set<String> compTemplates = comp.getValue();
if (compTemplates != null && !compTemplates.isEmpty()) {
String systemName = ComputeSystemTypes.getDisplayValue(ComputeSystemTypes.UCS) + " " + computeSystemsMap.get(comp.getKey());
computeVirtualPool.systems.add(new StringOption(comp.getKey(), systemName));
List<StringOption> templateOptions = Lists.newArrayList();
templateOptions.add(new StringOption("NONE", ""));
for (String template : compTemplates) {
templateOptions.add(new StringOption(template, templatesMap.get(template)));
if (!temps.isEmpty()) {
for (String templateId : temps) {
if (templateId.contains(template)) {
templateList.add(new StringOption(comp.getKey(), template));
}
}
}
}
computeVirtualPool.systemOptions.put(comp.getKey(), templateOptions);
}
}
computeVirtualPool.selectedTemplates = "{}";
if (!templateList.isEmpty()) {
String jsonString = "{\"";
for (int index = 0; index < templateList.size(); index++) {
if (jsonString.indexOf("urn") > 0) {
jsonString = jsonString + ",\"";
}
jsonString = jsonString + templateList.get(index).id + "\":\"" + templateList.get(index).name + "\"";
}
jsonString = jsonString + "}";
computeVirtualPool.selectedTemplates = jsonString;
}
} else {
computeVirtualPool.selectedTemplates = "{}";
}
render("@templates", computeVirtualPool);
}
use of util.StringOption in project coprhd-controller by CoprHD.
the class VCenters method renderTenantOptions.
private static void renderTenantOptions() {
if (TenantUtils.canReadAllTenantsForVcenters() && VCenterUtils.canUpdateVcenterACLs()) {
List<StringOption> tenantOptions = dataObjectOptions(await(new TenantsCall().asPromise()));
renderArgs.put("tenantOptions", tenantOptions);
List<StringOption> tenantOptionsWithNone = new ArrayList<StringOption>();
tenantOptionsWithNone.add(new StringOption(NullColumnValueGetter.getNullStr().toString(), "None"));
tenantOptionsWithNone.addAll(tenantOptions);
renderArgs.put("tenantOptionsWithNone", tenantOptionsWithNone);
}
}
use of util.StringOption in project coprhd-controller by CoprHD.
the class StorageSystems method createPort.
public static void createPort(String id) {
StorageSystemRestRep storageSystem = StorageSystemUtils.getStorageSystem(id);
StringOption[] portTypeOptions = { new StringOption("", ""), new StringOption("IP", StringOption.getDisplayValue("IP", "storageArrayPort.portTypes")), new StringOption("FC", StringOption.getDisplayValue("FC", "storageArrayPort.portTypes")) };
renderArgs.put("portTypeOptions", Arrays.asList(portTypeOptions));
render(storageSystem);
}
use of util.StringOption in project coprhd-controller by CoprHD.
the class Certificates method list.
@FlashException
public static void list() {
CertificateDataTable dataTable = new CertificateDataTable();
List<StringOption> options = Lists.newArrayList();
options.add(new StringOption("true", MessagesUtils.get("common.yes")));
options.add(new StringOption("false", MessagesUtils.get("common.no")));
TruststoreSettings certificateSettings = null;
certificateSettings = api().getTruststoreSettings();
angularRenderArgs().putAll(ImmutableMap.of("options", options, "certificateSettings", certificateSettings));
render(dataTable);
}
Aggregations