
hudson.model.Hudson._api.jelly Maven / Gradle / Ivy
Show all versions of hudson-core Show documentation
Example API calls for a Hudson Server
Create Job
To create a new job, POST config.xml to http://your_server/createItem (copy url) with
query parameter name=JOBNAME.
You'll get 200 status code if the creation is successful,
or 4xx/5xx code if it fails. config.xml is the format Hudson uses to store the job
in the file system, so you can see examples of them in the Hudson Home directory.
Copy Job
To copy a job, send a POST request to http://your_server/createItem with
three query parameters:
name=NEWJOBNAME&mode=copy&from=FROMJOBNAME
Build Queue
Build queue has its own separate API: http://your_server/queue/api/[xml|json]
(try it now!).
Load Statistics
Overall load statistics of Hudson has its own separate API
http://your_server/overallLoad/api/[xml|json] (try it now!).
Restarting Hudson
Hudson will enter into the "quiet down" mode by sending a GET request
to http://your_server/quietDown (do it now).
You can cancel this mode by sending a request to http://your_server/cancelQuietDown
(do it now).
On environments where Hudson can restart itself (such as when Hudson is installed as
a Windows service), POSTing to http://your_server/restart
(copy url) will start the restart sequence, or http://your_server/safeRestart
(copy url) to restart once no jobs are running.
All these URLs need the admin privilege to the system.