Get job schedule from API

34 views
Skip to first unread message

ccha...@kinaxis.com

unread,
Dec 4, 2015, 9:35:04 AM12/4/15
to Jenkins Users
Is there a way to get the schedule for a job from the API?  I can't find it anywhere. :(

Thanks,
Clint

Victor Martinez

unread,
Dec 4, 2015, 10:08:17 AM12/4/15
to Jenkins Users

Look at the Perform a build section

Cheers

ccha...@kinaxis.com

unread,
Dec 4, 2015, 11:02:08 AM12/4/15
to Jenkins Users
Thanks Victor but I'm not trying to "schedule" a build.  I want a way to access the recurring schedule of the job from the API (i.e.  The "0 0 * * *" in the picture below).

Christopher Orr

unread,
Dec 4, 2015, 1:45:44 PM12/4/15
to jenkins...@googlegroups.com
Only part of the job config is exposed in the API. For example, SCM
info is there, but not build triggers. I imagine you could file a
feature request for that :)

Though there is at least a way of programmatically grabbing the job
config, so if you're authenticated, you can parse the XML, e.g.:

curl -s https://ci.jenkins-ci.org/job/infra_update_center_v3/config.xml
| xpath -e '/project/triggers/hudson.triggers.TimerTrigger/spec/text()'

Regards,
Chris


On 04/12/15 17:02, ccha...@kinaxis.com wrote:
> Thanks Victor but I'm not trying to "schedule" a build. I want a way to
> access the recurring schedule of the job from the API (i.e. The "0 0 *
> * *" in the picture below).
>
> <https://lh3.googleusercontent.com/-kKiuZQV3HMg/VmG4rL6JZlI/AAAAAAAAAAM/f-B26kw4IzY/s1600/schedule.png>
>
>
>
> On Friday, December 4, 2015 at 10:08:17 AM UTC-5, Victor Martinez wrote:
>
> https://YOUR_JENKINS_URL/job/YOUR_JOB/api/
> <https://YOUR_JENKINS_URL/job/YOUR_JOB/api/>
>
> Look at the Perform a build section
>
> Cheers
>
> On Friday, 4 December 2015 15:35:04 UTC+1, ccha...@kinaxis.com wrote:
>
> Is there a way to get the schedule for a job from the API? I
> can't find it anywhere. :(
>
> Thanks,
> Clint
>
> --
> 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
> <mailto:jenkinsci-use...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/ddc8ca2e-0571-4b35-836c-41095dd19e4d%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/ddc8ca2e-0571-4b35-836c-41095dd19e4d%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

ccha...@kinaxis.com

unread,
Dec 4, 2015, 3:40:12 PM12/4/15
to Jenkins Users
Thanks Chris.  My back up was to get the html page and get it from there.  Getting the config.xml file is a better option.

Thanks again,
Clint
Reply all
Reply to author
Forward
0 new messages