Class SwarmRestApi
java.lang.Object
io.jenkins.plugins.swarmcloud.rest.SwarmRestApi
- All Implemented Interfaces:
ExtensionPoint,Action,ModelObject,RootAction
REST API for managing Docker Swarm agents.
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoAgents(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String cloud) GET /swarm-api/agentsvoiddoAudit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String cloud, Integer limitParam) GET /swarm-api/audit - Get audit log entriesvoiddoCloud(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String name) GET /swarm-api/cloud?name={name}voiddoClouds(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) GET /swarm-api/cloudsvoiddoMetrics(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String cloud) GET /swarm-api/metricsvoiddoPrometheus(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)voiddoProvision(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String cloud, String template) POST /swarm-api/provisionvoiddoTemplate(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 }voiddoTemplateGet(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String cloud, String name) GET /swarm-api/template - Get single template detailsvoiddoTemplates(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String cloud) GET /swarm-api/templatesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.model.RootAction
getBadge, isPrimaryAction
-
Constructor Details
-
SwarmRestApi
public SwarmRestApi()
-
-
Method Details
-
getIconFileName
- Specified by:
getIconFileNamein interfaceAction
-
getDisplayName
- Specified by:
getDisplayNamein interfaceAction- Specified by:
getDisplayNamein interfaceModelObject
-
getUrlName
- Specified by:
getUrlNamein interfaceAction
-
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 requestrsp- Stapler responsecloud- Optional cloud name filterlimitParam- Maximum entries to return (default 100)- Throws:
IOException- if response writing fails
-