@RequirePOST @Deprecated public HttpResponse doPin() throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); // See https://groups.google.com/d/msg/jenkinsci-dev/kRobm-cxFw8/6V66uhibAwAJ LOGGER.log(WARNING, "Call to pin plugin has been ignored. Plugin name: " + shortName); return HttpResponses.ok(); }
@RequirePOST @Deprecated public HttpResponse doUnpin() throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); // See https://groups.google.com/d/msg/jenkinsci-dev/kRobm-cxFw8/6V66uhibAwAJ LOGGER.log(WARNING, "Call to unpin plugin has been ignored. Plugin name: " + shortName); return HttpResponses.ok(); }
@StaplerDispatchable public void getTestForReverseProxySetup(String rest) { Jenkins j = Jenkins.getInstance(); String inferred = j.getRootUrlFromRequest() + "manage"; // TODO this could also verify that j.getRootUrl() has been properly configured, and send a different message if not if (rest.startsWith(inferred)) { // not using equals due to JENKINS-24014 throw HttpResponses.ok(); } else { LOGGER.log(Level.WARNING, "{0} vs. {1}", new Object[] {inferred, rest}); throw HttpResponses.errorWithoutStack(404, inferred + " vs. " + rest); } }
@RequirePOST public HttpResponse doMakeDisabled() throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); disable(); return HttpResponses.ok(); }
@RequirePOST public HttpResponse doMakeEnabled() throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); enable(); return HttpResponses.ok(); }
/** * Accepts {@code config.xml} submission, as well as serve it. */ @WebMethod(name = "config.xml") public HttpResponse doConfigDotXml(StaplerRequest req) throws IOException { if (req.getMethod().equals("GET")) { // read checkPermission(READ); return new HttpResponse() { public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException { rsp.setContentType("application/xml"); View.this.writeXml(rsp.getOutputStream()); } }; } if (req.getMethod().equals("POST")) { // submission updateByXml(new StreamSource(req.getReader())); return HttpResponses.ok(); } // huh? return HttpResponses.error(SC_BAD_REQUEST, "Unexpected request method " + req.getMethod()); }
public HttpResponse doPin() throws IOException { Hudson.getInstance().checkPermission(Hudson.ADMINISTER); new FileOutputStream(pinFile).close(); return HttpResponses.ok(); }
public HttpResponse doUnpin() throws IOException { Hudson.getInstance().checkPermission(Hudson.ADMINISTER); pinFile.delete(); return HttpResponses.ok(); }
public void getTestForReverseProxySetup(String rest) { Jenkins j = Jenkins.getInstance(); String inferred = j.getRootUrlFromRequest() + "manage"; // TODO this could also verify that j.getRootUrl() has been properly configured, and send a different message if not if (rest.startsWith(inferred)) { // not using equals due to JENKINS-24014 throw HttpResponses.ok(); } else { LOGGER.log(Level.WARNING, "{0} vs. {1}", new Object[] {inferred, rest}); throw HttpResponses.errorWithoutStack(404, inferred + " vs. " + rest); } }
@RequirePOST @Deprecated public HttpResponse doPin() throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); // See https://groups.google.com/d/msg/jenkinsci-dev/kRobm-cxFw8/6V66uhibAwAJ LOGGER.log(WARNING, "Call to pin plugin has been ignored. Plugin name: " + shortName); return HttpResponses.ok(); }
@RequirePOST @Deprecated public HttpResponse doUnpin() throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); // See https://groups.google.com/d/msg/jenkinsci-dev/kRobm-cxFw8/6V66uhibAwAJ LOGGER.log(WARNING, "Call to unpin plugin has been ignored. Plugin name: " + shortName); return HttpResponses.ok(); }
public HttpResponse doMakeDisabled() throws IOException { Hudson.getInstance().checkPermission(Hudson.ADMINISTER); disable(); return HttpResponses.ok(); }
public HttpResponse doMakeEnabled() throws IOException { Hudson.getInstance().checkPermission(Hudson.ADMINISTER); enable(); return HttpResponses.ok(); }
public HttpResponse doMakeEnabled() throws IOException { Hudson.getInstance().checkPermission(Hudson.ADMINISTER); enable(); return HttpResponses.ok(); }
public HttpResponse doDowngradePlugin(@QueryParameter String pluginName) { if (!hudsonSecurityManager.hasPermission(Permission.HUDSON_ADMINISTER)) { return HttpResponses.forbidden(); } InstalledPluginInfo plugin = installedPluginManager.getInstalledPlugin(pluginName); try { plugin.downgade(); } catch (Exception ex) { return new ErrorHttpResponse("Plugin " + pluginName + " could not be reverted to previous version. " + ex.getLocalizedMessage()); } return HttpResponses.ok(); }
public HttpResponse doUnpinPlugin(@QueryParameter String pluginName) { if (!hudsonSecurityManager.hasPermission(Permission.HUDSON_ADMINISTER)) { return HttpResponses.forbidden(); } InstalledPluginInfo plugin = installedPluginManager.getInstalledPlugin(pluginName); try { plugin.unpin(); } catch (Exception ex) { return new ErrorHttpResponse("Plugin " + pluginName + " could not be unpinned. " + ex.getLocalizedMessage()); } return HttpResponses.ok(); }
public HttpResponse doMakeEnabled() throws IOException { Hudson.getInstance().checkPermission(Hudson.ADMINISTER); enable(); return HttpResponses.ok(); }
@RequirePOST public HttpResponse doMakeDisabled() throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); disable(); return HttpResponses.ok(); }
@RequirePOST public HttpResponse doMakeEnabled() throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); enable(); return HttpResponses.ok(); }
public HttpResponse doZot(StaplerRequest req) { assertEquals("testRestOfUrl/bar/zot", req.getAncestors().get(0).getRestOfUrl()); assertEquals("bar/zot", req.getAncestors().get(1).getRestOfUrl()); assertEquals("zot", req.getAncestors().get(2).getRestOfUrl()); return HttpResponses.ok(); } }