Disable Jenkins Job via HTTP GET or HTTP POST

446 views
Skip to first unread message

Nitish Kumar

unread,
Apr 26, 2015, 12:47:00 AM4/26/15
to jenkins...@googlegroups.com
Hi,

I want to disable a Jenkins job in remote machine. I know that we can disable via jenkins-cli.jar
Can we disable a Jenkins job via GET or POST ?

If yes, then what is the syntax of the URL?



Thanks
Nitish

Benjamin Lau

unread,
Apr 26, 2015, 4:14:08 AM4/26/15
to Jenkins Users
Very very simple.

http POST https://jenkins.example.com/jenkins//job/example/disable
http POST https://jenkins.example.com/jenkins//job/example/enable

You'll need to authenticate obviously.

Here's a more complete example:

curl -X POST https://jenkins.example.com/jenkins//job/example/disable \
--user USER:PASSWORD
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-use...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/767f8cb5-3d9b-4b93-9f75-2f760a6c7dbf%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages