
hudson.model.Job._api.jelly Maven / Gradle / Ivy
Show all versions of hudson-core Show documentation
Example API calls for a Job
Fetch/Update config.xml
To programmatically obtain config.xml, use http://your_server/job/your_job_name/config.xml,
(try it now!).
You can also POST an updated config.xml to the same URL to programmatically
update the configuration of a job.
Similarly, http://your_server/job/your_job_name/description can be used to
get and set just the job description (try it now!).
POST form data with a "description" parameter to set the description.
Perform a build
To programmatically schedule a new build, POST or GET
to http://your_server/job/your_job_name/build (try it now!).
If the build has parameters, POST to
http://your_server/job/your_job_name/buildWithParameters
(copy url) and provide the
parameters as form data.
Schedule SCM Poll
To programmatically schedule SCM polling, POST to
http://your_server/job/your_job_name/polling (copy url).
Delete a job
To programmatically delete this job, do HTTP POST (not GET)
to http://your_server/job/your_job_name/doDelete (copy url).
Dealing with Security
If security is enabled, the recommended method is to provide the username/password of an
account with build permission in the request. Tools such as curl and wget
have parameters to specify these credentials. Another alternative (but deprecated) is to
configure the 'Trigger builds remotely' section in the job configuration. Then building
or polling can be triggered by including a parameter called token in the request.