use of util.StringOption in project coprhd-controller by CoprHD.
the class FileProtectionPolicies method getAllVarrays.
private static List<StringOption> getAllVarrays() {
List<StringOption> varrayList = Lists.newArrayList();
List<NamedRelatedResourceRep> allVarrays = getViprClient().varrays().list();
for (NamedRelatedResourceRep varray : allVarrays) {
varrayList.add(new StringOption(varray.getId().toString(), varray.getName()));
}
return varrayList;
}
use of util.StringOption in project coprhd-controller by CoprHD.
the class FileVirtualPools method listReplicationVirtualArraysJson.
public static void listReplicationVirtualArraysJson(FileVirtualPoolForm vpool) {
if (vpool == null) {
renderJSON(Collections.emptyList());
}
vpool.deserialize();
List<StringOption> actualOptions = Lists.newArrayList();
List<VirtualArrayRestRep> virtualArrays = VirtualArrayUtils.getVirtualArrays();
for (StringOption option : dataObjectOptions(virtualArrays)) {
actualOptions.add(option);
}
renderJSON(actualOptions);
}
use of util.StringOption 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 util.StringOption in project coprhd-controller by CoprHD.
the class ComputeSystems method edit.
public static void edit(String id) {
try {
addReferenceData();
ComputeSystemRestRep computeSystem = ComputeSystemUtils.getComputeSystem(id);
if (computeSystem != null) {
if (computeSystem.getVlans() != null) {
List<StringOption> vlanOptions = new ArrayList<StringOption>();
vlanOptions.add(VlanListTypes.option(VlanListTypes.NO_OSINSTALL_NONE));
List<String> vlanList = new ArrayList<String>(Arrays.asList(computeSystem.getVlans().split(",")));
for (String vlan : vlanList) {
vlanOptions.add(VlanListTypes.option(vlan));
}
renderArgs.put("computeSystemVlanList", vlanOptions);
}
List<StringOption> computeImageServerOptions = new ArrayList<StringOption>();
computeImageServerOptions.add(ComputeImageServerListTypes.option(ComputeImageServerListTypes.NO_COMPUTE_IMAGE_SERVER_NONE));
List<ComputeImageServerRestRep> computeImageServersList = ComputeImageServerUtils.getComputeImageServers();
if (computeImageServersList != null) {
List<String> computeImageServersArrayList = new ArrayList<String>();
for (ComputeImageServerRestRep cisrr : computeImageServersList) {
if (cisrr.getComputeImageServerStatus().equalsIgnoreCase(AVAILABLE)) {
computeImageServersArrayList.add(cisrr.getName());
}
}
for (String imageServerId : computeImageServersArrayList) {
computeImageServerOptions.add(ComputeImageServerListTypes.option(imageServerId));
}
renderArgs.put("availableComputeImageServersList", computeImageServerOptions);
}
ComputeSystemForm computeSystems = new ComputeSystemForm(computeSystem);
render("@edit", computeSystems);
} else {
flash.error(MessagesUtils.get(UNKNOWN, id));
list();
}
} catch (Exception e) {
flashException(e);
list();
}
}
use of util.StringOption in project coprhd-controller by CoprHD.
the class ComputeSystems method create.
public static void create() {
addReferenceData();
ComputeSystemForm computeSystems = new ComputeSystemForm();
// put all "initial create only" defaults here rather than field
// initializers
List<ComputeImageServerRestRep> computeImageServersList = ComputeImageServerUtils.getComputeImageServers();
if (computeImageServersList != null) {
List<StringOption> computeImageServerOptions = new ArrayList<StringOption>();
List<String> computeImageServersArrayList = new ArrayList<String>();
computeImageServerOptions.add(ComputeImageServerListTypes.option(ComputeImageServerListTypes.NO_COMPUTE_IMAGE_SERVER_NONE));
for (ComputeImageServerRestRep cisrr : computeImageServersList) {
if (cisrr.getComputeImageServerStatus().equalsIgnoreCase(AVAILABLE)) {
computeImageServersArrayList.add(cisrr.getName());
}
}
for (String imageServerId : computeImageServersArrayList) {
computeImageServerOptions.add(ComputeImageServerListTypes.option(imageServerId));
}
renderArgs.put("availableComputeImageServersList", computeImageServerOptions);
}
computeSystems.portNumber = getDefaultPort(DefaultComputeSystemPortMap.port443);
computeSystems.useSSL = true;
render("@edit", computeSystems);
}
Aggregations