use of com.emc.storageos.model.compute.ComputeImageServerRestRep 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 com.emc.storageos.model.compute.ComputeImageServerRestRep 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