@Override public VmPool update(VmPool pool) { validateUpdate(pool); StringBuilder buf = new StringBuilder(); buf.append("$v = get-vmpool -vmpoolid " + PowerShellUtils.escape(getId()) + ";"); if (pool.getName() != null) { buf.append("$v.name = " + PowerShellUtils.escape(pool.getName()) + ";"); } if (pool.getDescription() != null) { buf.append("$v.description = " + PowerShellUtils.escape(pool.getDescription()) + ";"); } if (pool.getSize() != null) { buf.append("$v.vmcount = " + pool.getSize() + ";"); } buf.append("update-vmpool -vmpoolobject $v"); return addLinks(runAndParseSingle(buf.toString())); }
buf.append(" -vmpoolname " + PowerShellUtils.escape(pool.getName())); if (pool.getDescription() != null) { buf.append(" -vmpooldescription " + PowerShellUtils.escape(pool.getDescription()));
System.out.println(" VM pool: " + model.getVmPool().getName());
public void updateModel(VmPool pool) { // update writable fields only if (pool.isSetName()) { getModel().setName(pool.getName()); } if (pool.isSetDescription()) { getModel().setDescription(pool.getDescription()); } if (pool.isSetCluster() && pool.getCluster().isSetId()) { getModel().setCluster(new Cluster()); getModel().getCluster().setId(pool.getCluster().getId()); } if (pool.isSetTemplate() && pool.getTemplate().isSetId()) { getModel().setTemplate(new Template()); getModel().getTemplate().setId(pool.getTemplate().getId()); } }