Class SwarmRestApi

java.lang.Object
io.jenkins.plugins.swarmcloud.rest.SwarmRestApi
All Implemented Interfaces:
ExtensionPoint, Action, ModelObject, RootAction

@Extension public class SwarmRestApi extends Object implements RootAction
REST API for managing Docker Swarm agents.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface hudson.ExtensionPoint

    ExtensionPoint.LegacyInstancesAreScopedToHudson
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    doAgents(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String cloud)
    GET /swarm-api/agents
    void
    doAudit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String cloud, Integer limitParam)
    GET /swarm-api/audit - Get audit log entries
    void
    doCloud(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String name)
    GET /swarm-api/cloud?name={name}
    void
    doClouds(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
    GET /swarm-api/clouds
    void
    doMetrics(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String cloud)
    GET /swarm-api/metrics
    void
    doPrometheus(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
    GET /swarm-api/prometheus - Prometheus metrics endpoint Returns metrics in Prometheus text format (OpenMetrics compatible)
    void
    doProvision(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String cloud, String template)
    POST /swarm-api/provision
    void
    doTemplate(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
    PUT /swarm-api/template - Update a template's configuration Request body (JSON): { "cloud": "cloud-name", "template": "template-name", "image": "new-image:tag", // optional "labelString": "new-labels", // optional "maxInstances": 10, // optional "cpuLimit": "2.0", // optional "memoryLimit": "4g" // optional }
    void
    doTemplateGet(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String cloud, String name)
    GET /swarm-api/template - Get single template details
    void
    doTemplates(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String cloud)
    GET /swarm-api/templates
     
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface hudson.model.RootAction

    getBadge, isPrimaryAction
  • Constructor Details

    • SwarmRestApi

      public SwarmRestApi()
  • Method Details

    • getIconFileName

      public String getIconFileName()
      Specified by:
      getIconFileName in interface Action
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface Action
      Specified by:
      getDisplayName in interface ModelObject
    • getUrlName

      public String getUrlName()
      Specified by:
      getUrlName in interface Action
    • doClouds

      @GET public void doClouds(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
      GET /swarm-api/clouds
      Throws:
      IOException
    • doCloud

      @GET public void doCloud(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter String name) throws IOException
      GET /swarm-api/cloud?name={name}
      Throws:
      IOException
    • doTemplates

      @GET public void doTemplates(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter String cloud) throws IOException
      GET /swarm-api/templates
      Throws:
      IOException
    • doAgents

      @GET public void doAgents(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter String cloud) throws IOException
      GET /swarm-api/agents
      Throws:
      IOException
    • doMetrics

      @GET public void doMetrics(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter String cloud) throws IOException
      GET /swarm-api/metrics
      Throws:
      IOException
    • doProvision

      @POST public void doProvision(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter String cloud, @QueryParameter String template) throws IOException
      POST /swarm-api/provision
      Throws:
      IOException
    • doTemplate

      @PUT @POST public void doTemplate(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
      PUT /swarm-api/template - Update a template's configuration Request body (JSON): { "cloud": "cloud-name", "template": "template-name", "image": "new-image:tag", // optional "labelString": "new-labels", // optional "maxInstances": 10, // optional "cpuLimit": "2.0", // optional "memoryLimit": "4g" // optional }
      Throws:
      IOException
    • doTemplateGet

      @GET public void doTemplateGet(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter String cloud, @QueryParameter String name) throws IOException
      GET /swarm-api/template - Get single template details
      Throws:
      IOException
    • doPrometheus

      @GET public void doPrometheus(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
      GET /swarm-api/prometheus - Prometheus metrics endpoint Returns metrics in Prometheus text format (OpenMetrics compatible)
      Throws:
      IOException
    • doAudit

      @GET public void doAudit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter String cloud, @QueryParameter("limit") Integer limitParam) throws IOException
      GET /swarm-api/audit - Get audit log entries
      Parameters:
      req - Stapler request
      rsp - Stapler response
      cloud - Optional cloud name filter
      limitParam - Maximum entries to return (default 100)
      Throws:
      IOException - if response writing fails