public static List<NodeDescriptor> allInstantiable() { List<NodeDescriptor> r = new ArrayList<>(); for (NodeDescriptor d : all()) if(d.isInstantiable()) r.add(d); return r; } }
/** * Really creates a new agent. */ @RequirePOST public synchronized void doDoCreateItem( StaplerRequest req, StaplerResponse rsp, @QueryParameter String name, @QueryParameter String type ) throws IOException, ServletException, FormException { final Jenkins app = Jenkins.getInstance(); app.checkPermission(Computer.CREATE); String fixedName = Util.fixEmptyAndTrim(name); checkName(fixedName); JSONObject formData = req.getSubmittedForm(); formData.put("name", fixedName); // TODO type is probably NodeDescriptor.id but confirm Node result = NodeDescriptor.all().find(type).newInstance(req, formData); app.addNode(result); // take the user back to the agent list top page rsp.sendRedirect2("."); }
NodeDescriptor d = NodeDescriptor.all().findByName(mode); if (d == null) { throw new Failure("No node type ‘" + mode + "’ is known");
public static List<NodeDescriptor> allInstantiable() { List<NodeDescriptor> r = new ArrayList<NodeDescriptor>(); for (NodeDescriptor d : all()) if(d.isInstantiable()) r.add(d); return r; } }
public static List<NodeDescriptor> allInstantiable() { List<NodeDescriptor> r = new ArrayList<NodeDescriptor>(); for (NodeDescriptor d : all()) if(d.isInstantiable()) r.add(d); return r; } }
public static List<NodeDescriptor> allInstantiable() { List<NodeDescriptor> r = new ArrayList<NodeDescriptor>(); for (NodeDescriptor d : all()) if(d.isInstantiable()) r.add(d); return r; } }
public static List<NodeDescriptor> allInstantiable() { List<NodeDescriptor> r = new ArrayList<NodeDescriptor>(); for (NodeDescriptor d : all()) if(d.isInstantiable()) r.add(d); return r; } }
public static List<NodeDescriptor> allInstantiable() { List<NodeDescriptor> r = new ArrayList<NodeDescriptor>(); for (NodeDescriptor d : all()) { if (d.isInstantiable()) { r.add(d); } } return r; } }
/** * Really creates a new slave. */ public synchronized void doDoCreateItem( StaplerRequest req, StaplerResponse rsp, @QueryParameter String name, @QueryParameter String type ) throws IOException, ServletException, FormException { final Hudson app = Hudson.getInstance(); app.checkPermission(Hudson.ADMINISTER); // TODO: new permission? checkName(name); Node result = NodeDescriptor.all().find(type).newInstance(req, req.getSubmittedForm()); app.addNode(result); // take the user back to the slave list top page rsp.sendRedirect2("."); }
/** * Really creates a new slave. */ public synchronized void doDoCreateItem( StaplerRequest req, StaplerResponse rsp, @QueryParameter String name, @QueryParameter String type ) throws IOException, ServletException, FormException { final Hudson app = Hudson.getInstance(); app.checkPermission(Hudson.ADMINISTER); // TODO: new permission? checkName(name); Node result = NodeDescriptor.all().find(type).newInstance(req, req.getSubmittedForm()); app.addNode(result); // take the user back to the slave list top page rsp.sendRedirect2("."); }
/** * Really creates a new slave. */ public synchronized void doDoCreateItem( StaplerRequest req, StaplerResponse rsp, @QueryParameter String name, @QueryParameter String type ) throws IOException, ServletException, FormException { final Hudson app = Hudson.getInstance(); app.checkPermission(Hudson.ADMINISTER); // TODO: new permission? checkName(name); Node result = NodeDescriptor.all().find(type).newInstance(req, req.getSubmittedForm()); app.addNode(result); // take the user back to the slave list top page rsp.sendRedirect2("."); }
/** * Really creates a new agent. */ @RequirePOST public synchronized void doDoCreateItem( StaplerRequest req, StaplerResponse rsp, @QueryParameter String name, @QueryParameter String type ) throws IOException, ServletException, FormException { final Jenkins app = Jenkins.getInstance(); app.checkPermission(Computer.CREATE); String fixedName = Util.fixEmptyAndTrim(name); checkName(fixedName); JSONObject formData = req.getSubmittedForm(); formData.put("name", fixedName); // TODO type is probably NodeDescriptor.id but confirm Node result = NodeDescriptor.all().find(type).newInstance(req, formData); app.addNode(result); // take the user back to the agent list top page rsp.sendRedirect2("."); }
NodeDescriptor d = NodeDescriptor.all().find(mode); d.handleNewNodePage(this,name,req,rsp);
NodeDescriptor d = NodeDescriptor.all().find(mode); d.handleNewNodePage(this,name,req,rsp);
NodeDescriptor d = NodeDescriptor.all().find(mode); d.handleNewNodePage(this,name,req,rsp);
/** * Really creates a new slave. */ public synchronized void doDoCreateItem(StaplerRequest req, StaplerResponse rsp, @QueryParameter String name, @QueryParameter String type) throws IOException, ServletException, FormException { final Hudson app = Hudson.getInstance(); if (app.getTeamManager().isTeamManagementEnabled()) { app.checkPermission(Computer.CREATE); } else { app.checkPermission(Hudson.ADMINISTER); // TODO: new permission? } checkName(name); Node result = NodeDescriptor.all().find(type).newInstance(req, req.getSubmittedForm()); app.addNode(result); addToTeam(result.getNodeName(), null); // take the user back to the slave list top page rsp.sendRedirect2("."); }
NodeDescriptor d = NodeDescriptor.all().findByName(mode); if (d == null) { throw new Failure("No node type ‘" + mode + "’ is known");
NodeDescriptor d = NodeDescriptor.all().find(mode); d.handleNewNodePage(this, name, req, rsp);