Re: Jenkins API token behaviour change (no longer valid with new Jenkins images after Jenkins restart?)

2019-02-07 Thread Daniel Beck
> On 1. Feb 2019, at 14:59, adamrobertsah...@gmail.com wrote: > > we've noticed a problem when upgrading the base Jenkins image beyond 2.153 > however To clarify, the problem occurs from 2.154 on? If you only tried a later release, could you try to determine the release that broke it? -- Y

Jenkins API token behaviour change (no longer valid with new Jenkins images after Jenkins restart?)

2019-02-01 Thread adamrobertsahyes
Hi all, seeing strange behaviour with newer Jenkins image versions, API tokens, and Jenkins on Kubernetes. We're using the Jenkins helm chart and API tokens so that our own microservice can talk to it - we've noticed a problem when upgrading the base Jenkins image beyond 2.153 however. It seem

When using github oauth, each jenkins API call is consuming a unit of github rate limit.

2018-12-06 Thread Ian Murray
Hi, We have github oauth set-up but whenever we use a token (either native or github personal access), one is subtracted from the count of github API requests we make an hour. We are using a dashing-js dashboard to monitor unreleased code, but this burns through our 5000 calls per hour limit in

Jenkins API Documentation

2018-08-03 Thread Danny Staple
The "REST" read only parts of the Jenkins HTTP API documentation (https://wiki.jenkins.io/display/JENKINS/Remote+access+API) are usable, but altering states, making changes other than triggering a build seem to be missing. There appear to be HTTP API endpoints for automated interactions and I'v

Jenkins API to find the owner of a job ?

2018-05-05 Thread Sunshine
Is there a way to find owner or find out who created a job in Jenkins ? I do have Jenkins JobConfigHistory plugin where I can I see the people who have made config changes for a job... Is there a way I can capture the owner Details via API or groovy script? -- You received this message because

Re: Jenkins API resulting in HTTP ERROR 404

2018-03-28 Thread 'Jenkins User' via Jenkins Users
FYI, this issue was due to restricted permission for the user. After relaxing the permission API call worked as expected. Thanks! On Wednesday, March 28, 2018 at 4:55:55 PM UTC-5, Jenkins User wrote: > > Hi All, > > I'm using Jenkins 2.89.4. > > I'm making an API call using > > /usr/bin/curl -X

Jenkins API resulting in HTTP ERROR 404

2018-03-28 Thread 'Jenkins User' via Jenkins Users
Hi All, I'm using Jenkins 2.89.4. I'm making an API call using /usr/bin/curl -X GET -k --cookie `cat cookie.txt` https://JENKINS_URL/job/MYJOBNAME/lastCompletedBuild/api/xml/ --user usr:token But it is resulting in 404 error like below Error 404 Not Found HTTP ERROR 404 Problem

Hwo to configure Jenkins API TO fisheye

2018-03-12 Thread Venkata Reddy
Hi Exports, Can you please explain how configure Jenkins API TO fisheye with exm. -- *Best Regards ,* *Venkata Reddy* -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emai

Re: How to limit Jenkins API response to last n build IDs

2017-12-21 Thread Raghav
The tree query parameter allows you to explicitly specify and retrieve only the information you are looking for, by using an XPath-ish path expression. The value should be a list of property names to include, with sub-properties inside square braces. Try tree=jobs[name],views[name,jobs[name]]

Re: How to limit Jenkins API response to last n build IDs

2017-12-21 Thread Daniel Beck
> On 21. Dec 2017, at 19:05, Raghav wrote: > > Above API returns all the build IDs. Is there a way to limit results to get > last 5 build IDS? See the documentation at the /api/ URL, section 'Controlling the amount of data you fetch'. -- You received this message because you are subscribed

How to limit Jenkins API response to last n build IDs

2017-12-21 Thread Raghav
Hi, http://xxx/api/xml?&tree=builds[number,description,result,id,actions[parameters[name, va lue]]]

How to limit Jenkins API response to last n build IDs

2017-12-21 Thread Raghav
Hi, http://xxx/api/xml?&tree=builds[number,description,result,id,actions[parameters[name,value]]] Above API returns all the build IDs. Is there a way to limit results to get last 5 build IDs? Thanks, Raghav -- You received this message because you are subscribed to the Google Groups "

How to write to Console Output from Pipeline build using Jenkins API

2017-05-30 Thread Łukasz Zachulski
Hello, If it possible to write to Console Output using Jenkins API from with-in Jenkins Pipline script, ie. using TaskListener or Launcher? Looks like "currentBuild.rawBuild" doesn't provide such method. I'm having 3rd party jar which makes a calls to Jenkins API, and I wo

create new job using jenkins API with AJAX

2017-05-29 Thread Richard Zilahi
I am trying to create a new job by triggering the jenkins' createItem endpoint, using the following code: $(document).ready(function() { $("#create").click(function (e) { e.preventDefault(); var newJobName = $("#jobname").val(); //console.log(newJobName); jQ

jenkins API credential issues

2017-03-04 Thread Richard Zilahi
Hi Guys! I am having some issue with credentials when using jenkins. I have created a token for the job, and then a token a token for the user i am building the JOB with, and using the following sytanx for the job to be executed from a script: http://:@/jenkins/job//buildWithParameters?toke

Re: Jenkins API: retrieve the complete list of jobs in one single rest api access

2016-11-16 Thread Victor Martinez
Already raised a Jira ticket: - https://issues.jenkins-ci.org/browse/JENKINS-39774 Cheers On Tuesday, 1 November 2016 12:41:38 UTC, Victor Martinez wrote: > > If I run > > println Jenkins.instance.getAllItems().collect {it.fullName} > > it works as expected since it does some recursive search: >

Re: Jenkins API: retrieve the complete list of jobs in one single rest api access

2016-11-01 Thread Victor Martinez
If I run println Jenkins.instance.getAllItems().collect {it.fullName} it works as expected since it does some recursive search: - http://javadoc.jenkins-ci.org/jenkins/model/Jenkins.html#getAllItems() But https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/jenkins/model/Jenkins.

Jenkins API: retrieve the complete list of jobs in one single rest api access

2016-11-01 Thread Victor Martinez
Hi there, I'd like to know whether there is an easy way of retrieving the entire list of jobs in one single rest api even when those jobs are in folders without iterating through the rest api by doing traversal search or any other tree search. I've found the below suggestion, but I'm not a f

Pipeline plugin requires knowing the Jenkins API?

2016-04-01 Thread Vlad Dumitrescu
Hello everybody! I am late to finding out about 2.0, great news! The pipeline plugin seems to get a more prominent place and I have some trouble with using it... There are some simple tasks that require a plugin for a freestyle job, but now can be done much more straightforwardly. For example,

Manually set Jenkins API Token for a user

2015-12-29 Thread kkmayer
I am using the API Token for a user name in Jenkins to allow a git post receive hook to push to jenkins. We upgraded Jenkins and the API Token got updated. How do I manually reset the API Token for that user? Clicking on button Change API Token randomly assigns a different token. thanks --

Re: Jenkins api create job in a folder

2015-12-11 Thread Khai Do
s and Folder >>> implement. >>> >>> On 28.02.2014, at 17:18, Glenn V wrote: >>> >>> > Hi, >>> > >>> > I'm using the scriptler plugin to write a groovy script using the >>> Jenkins api, that will clone a s

Re: Jenkins api create job in a folder

2015-08-20 Thread Daniel Serodio
3:58 PM UTC-5, Daniel Beck wrote: >> >> Folder#createProjectFromXML(String,InputStream). It's from the >> ModifiableTopLevelItemGroup interface that both Jenkins and Folder >> implement. >> >> On 28.02.2014, at 17:18, Glenn V wrote: >> >>

Re: Jenkins api create job in a folder

2015-08-20 Thread Michel Leclerc
7;m using the scriptler plugin to write a groovy script using the > Jenkins api, that will clone a set of jobs. With > jenkins.model.Jenkins.createProjectFromXML(String name, InputStream xml) I > can create new jobs just fine, but that only seems to create top level > items. > > >

Re: Schedule a build in parallel from code (Jenkins API)

2015-07-15 Thread Thandesha VK
Never mind. Got it in import java.lang.Object Now I am stuck with unable to resolve class QueueTaskFuture unable to resolve class QueueTaskFuture On Wed, Jul 15, 2015 at 12:55 PM, Thandesha VK wrote: > It can't find the class Future. Could you please help > > unable to resolve class Future

Re: Schedule a build in parallel from code (Jenkins API)

2015-07-15 Thread Thandesha VK
It can't find the class Future. Could you please help unable to resolve class Future On Monday, March 10, 2014 at 4:26:28 AM UTC+5:30, dev123 wrote: > > A my bad I of course had to call the correct job, it now works thanks :-) > > On Sunday, March 9, 2014 11:47:20 PM UTC+1, dev123 wrote: >> >> Y

Re: Jenkins API - lunch a build and get build number in one atomic action

2015-05-31 Thread Daniel Beck
> I want to lunch a build by Jenkins API and get in return the build number > that this call has started. However, because of synchronizations > considerations, I don't want it to happened in 2 seprate calls (like: > lunchJobBuild(), getJobLatestBuildNumber()), but instead I am l

Jenkins API - lunch a build and get build number in one atomic action

2015-05-28 Thread Yotam Eliraz
I want to lunch a build by Jenkins API and get in return the build number that this call has started. However, because of synchronizations considerations, I don't want it to happened in 2 seprate calls (like: lunchJobBuild(), getJobLatestBuildNumber()), but instead I am looking for a

Re: Jenkins API with Groovy: setUpstreamProjects

2015-03-09 Thread Sverre Moe
Have not found any code examples of how to set upstream projects. Neither does it seems possible with the Jenkins API. I tried to add directly in config.xml myLib++ myLib2++ But it didn't take. According to both JSON and XML schema both downstreamProject and upstreamProject should be pos

Re: Jenkins API + Maven + Eclipse

2015-03-05 Thread James Green
wrote: > Since I am not familiar with the Jenkins API, I would like to program my > Groovy scripts in Eclipse. Having to check the Javadocs every time is quite > tedious. > Having to write the groovy in Jenkins (in a simple text area) and test it > by starting the build is takin

Jenkins API + Maven + Eclipse

2015-03-05 Thread Sverre Moe
Since I am not familiar with the Jenkins API, I would like to program my Groovy scripts in Eclipse. Having to check the Javadocs every time is quite tedious. Having to write the groovy in Jenkins (in a simple text area) and test it by starting the build is taking forever. I was thinking of

Re: Learning Jenkins Groovy with Jenkins API

2015-02-25 Thread Les Mikesell
On Tue, Feb 24, 2015 at 2:52 AM, Sverre Moe wrote: > I have been using "Execute Groovy Script". Then it looks like I should be > using "System Groovy Script" instead. > Would a groovy script with Scriptler also have access to the Jenkins > internals? > I haven't used scriptler so I don't know wha

Re: Learning Jenkins Groovy with Jenkins API

2015-02-24 Thread Sverre Moe
n, Feb 23, 2015 at 9:19 AM, Sverre Moe > wrote: > > Found the example on the web. Much of the Groovy examples I have seen > > entailed using the Jenkins Remote API. I want to use the Jenkins API, > > running the Groovy script inside jenkins. > > > > Haven'

Re: Learning Jenkins Groovy with Jenkins API

2015-02-23 Thread Les Mikesell
On Mon, Feb 23, 2015 at 9:19 AM, Sverre Moe wrote: > Found the example on the web. Much of the Groovy examples I have seen > entailed using the Jenkins Remote API. I want to use the Jenkins API, > running the Groovy script inside jenkins. > > Haven't found any example how to g

Re: Learning Jenkins Groovy with Jenkins API

2015-02-23 Thread Sverre Moe
Found the example on the web. Much of the Groovy examples I have seen entailed using the Jenkins Remote API. I want to use the Jenkins API, running the Groovy script inside jenkins. Haven't found any example how to get the build process. def build = jenkins.build (or whatever the access

RE: Learning Jenkins Groovy with Jenkins API

2015-02-23 Thread Rob Mandeville
[mailto:jenkinsci-users@googlegroups.com] On Behalf Of Sverre Moe Sent: Monday, February 23, 2015 9:47 AM To: jenkinsci-users@googlegroups.com Subject: Re: Learning Jenkins Groovy with Jenkins API Forgot to mention the error message I got while running the Groovy script in my build process: Caught

Re: Learning Jenkins Groovy with Jenkins API

2015-02-23 Thread Sverre Moe
stbuild doesn't work. It will not output a single line of > println, neither in parent nor on any axis slave. > > I want to access the current build process to get build information and > project/job information. Reading the javadoc for Jenkins API is better > suited for

Learning Jenkins Groovy with Jenkins API

2015-02-23 Thread Sverre Moe
formation. Reading the javadoc for Jenkins API is better suited for references and not for learning how to interact with Jenkins. Real example code is hard to find. Much of the example code is also using the deprecated hudson.model instead of jenkins.model. Using the Jenkins Script console many

Re: Jenkins API with Groovy: setUpstreamProjects

2015-02-20 Thread Baptiste Mathus
Upstream means a project is kind of above of some others in the build lifecycle. See it as a waterfall if you like, and water in a waterfall goes down (more rarely up ;-)). You also must think of the required building order: to build your final artifact(s). In your case, you must indeed have built

Jenkins API with Groovy: setUpstreamProjects

2015-02-20 Thread Sverre Moe
I want to dynamically set the downstream projects with a Groovy script. I can get the list of downstream projects, but I cannot find a setter. hudson.model.Hudson.instance.items.each { project -> if (project.name.equals("myProject")) { project.getUpstreamProjects().each { upstreamPro

Attempting to call Jenkins API from AngularJS, running into CORS blockage.

2014-07-30 Thread Ed Abshire
Hello! So I am tinkering with AngularJS and Jenkins. In an attempt to call the Jenkins API from AngularJS, I got the Cross Origin policy block. I installed the "Secure Requester Whitelist Plugin <https://wiki.jenkins-ci.org/display/JENKINS/Secure+Requester+Whitelist+Plugin>"

Re: Jenkins API access to Build History

2014-07-09 Thread teilo
Best practice is to normally have each branch in a different job. Otherwise trends and linear history become a bit meaningless. It also solves your issue as you just use lastStable/api/… /James On Wednesday, 9 July 2014 08:54:31 UTC+1, sebastian.nickel wrote: > > Hi Darrel, > thank you for

Re: Jenkins API access to Build History

2014-07-09 Thread sebastian.nickel
Hi Darrel, thank you for your answer. I already feared that I have to do it this way :-) This means that I need to do multiple API calls until I found all the builds for my specific branch/tag. I hoped there is a method with doing only one API call and then search for the desired build. Cheers

Re: Jenkins API access to Build History

2014-07-08 Thread DarrelVun
Nick: If you're using Git and Gerrit, then you can find the branch and sha1 under "actions" and "parameters" as name/value pairs, with name of "GERRIT_BRANCH" and "GERRIT_PATCHSET_REVISION". I don't know of a way to find the specific build except to walk a project's builds until you find it.

Jenkins API access to Build History

2014-07-08 Thread sebastian.nickel
Heya, we are using jenkins in combination with capistrano to deploy the artifacts build by jenkins directly to our servers. To get the URL for an artifact we are trying to get the build number for a specific git branch/tag we build in jenkins (doing this with json API calls). We noticed that the

Re: How to retrive all triggered jobs information using Jenkins API

2014-05-09 Thread Yang Li
I also noticed there was a 'getBuildTriggerUpstreamProject()' API, but it's not suit my usecase either. Any help is greatly appreciated! Yang Li於 2014年5月8日星期四UTC-7上午10時15分15秒寫道: > > Hi, > > Af

How to retrive all triggered jobs information using Jenkins API

2014-05-08 Thread Yang Li
Hi, After we applied the Jenkins upgrade from v1.480 to v1.532.3, I found the concept of Jenkins Groovy API ‘getDownstreamProject()’ defined in AbstractProject

Re: Schedule a build in parallel from code (Jenkins API)

2014-03-09 Thread dev123
A my bad I of course had to call the correct job, it now works thanks :-) On Sunday, March 9, 2014 11:47:20 PM UTC+1, dev123 wrote: > > Yes I did a check in allow concurrent execution. > > Now when I run mvn clean hpi:run it starts the jobs in parallel on the > available executors, but its spawns

Re: Schedule a build in parallel from code (Jenkins API)

2014-03-09 Thread dev123
Yes I did a check in allow concurrent execution. Now when I run mvn clean hpi:run it starts the jobs in parallel on the available executors, but its spawns jobs infinitely and the text: Done in: " + object.getTime() is never printed. And I have not even pressed the build button. Why do I

Re: Schedule a build in parallel from code (Jenkins API)

2014-03-09 Thread Daniel Beck
Since you seem to be triggering multiple builds of the same project, did you enable the project for parallel execution of multiple builds? On 09.03.2014, at 23:21, Daniel Beck wrote: > If you have the executors, the builds should run in parallel -- You received this message because you are su

Re: Schedule a build in parallel from code (Jenkins API)

2014-03-09 Thread Daniel Beck
If you have the executors, the builds should run in parallel. Given the following script in the Script Console (and jobs named wait1..wait4 with different durations): --- def futures = [] [1, 2, 3, 4].each { futures.add Jenkins.instance.getItemByFullName("wait${it}").scheduleBuild2(0) } futures

Re: Schedule a build in parallel from code (Jenkins API)

2014-03-09 Thread dev123
Not sure I understand I now do: for (int i = 0; i < 4; i++) { try { QueueTaskFuture scheduleBuild2 = project.scheduleBuild2(0, new Cause.UserCause(), myActions[i]); queue.add(scheduleBuild2); } catch (Exception e) { throw new AbortException(e.getMessage())

Re: Schedule a build in parallel from code (Jenkins API)

2014-03-09 Thread Daniel Beck
Don't immediately call .get(), instead assign the Future returned from scheduleBuild2 to a variable. Only .get() once you're willing to wait for the build to complete. On 09.03.2014, at 22:27, dev123 wrote: > In a jenkins plugin I am writing I need to run 5 jobs in parallel. Currently > I do

Schedule a build in parallel from code (Jenkins API)

2014-03-09 Thread dev123
In a jenkins plugin I am writing I need to run 5 jobs in parallel. Currently I do (sequentially): for (int i = 0; i < 4; i++) { try { build = project.scheduleBuild2(0, new Cause.UserCause(), myActions[i]).get(); } catch (Exception e) { throw new AbortException(e.g

Re: Jenkins API

2014-03-07 Thread Eric Pyle
Re: 1 - see http://jenkins-ci.361315.n4.nabble.com/quot-wipe-out-current-workspace-quot-via-REST-API-td4687766.html for suggestions on how to find the most useful functions. Re: 2 - The comments on the Jenkins wiki page mentioned by Robin Rosenberg contain several examples of Python code to ha

Re: Jenkins API

2014-03-07 Thread JonathanRRogers
On Thursday, March 6, 2014 3:01:04 PM UTC-5, Andrew Sumner wrote: > > Couple of questions: > > 1. Where can I find a list of functions I can call? > > eg I found toggleOffline while searching the internet, I don't think > its strictly an api method, but where can I find documentation for this

Jenkins API

2014-03-06 Thread Andrew Sumner
Couple of questions: 1. Where can I find a list of functions I can call? eg I found toggleOffline while searching the internet, I don't think its strictly an api method, but where can I find documentation for this and other methods? 2. Having a problem authenticating with Jenkins using vbs

Re: Jenkins api create job in a folder

2014-02-28 Thread Daniel Beck
Folder#createProjectFromXML(String,InputStream). It's from the ModifiableTopLevelItemGroup interface that both Jenkins and Folder implement. On 28.02.2014, at 17:18, Glenn V wrote: > Hi, > > I'm using the scriptler plugin to write a groovy script using the Jenkins >

Jenkins api create job in a folder

2014-02-28 Thread Glenn V
Hi, I'm using the scriptler plugin to write a groovy script using the Jenkins api, that will clone a set of jobs. With jenkins.model.Jenkins. *createProjectFromXML*(String<http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true> name, Input

Re: Cancel a Queue via Jenkins API

2013-08-09 Thread tiago fernandez
Thanks a lot for the rapid response, Now I see it has to be a POST, do you know how to do it with groovy and what import I have to use for that? Thanks. On Tuesday, August 6, 2013 4:07:00 PM UTC-3, Daniel Beck wrote: > Send a POST request. > > https://en.wikipedia.org/wiki/POST_%28HTTP%29

Re: Cancel a Queue via Jenkins API

2013-08-06 Thread Daniel Beck
Send a POST request. https://en.wikipedia.org/wiki/POST_%28HTTP%29 How this works depends on how you send the requests in the first place. Example using the `curl` command line program: curl --data '' 'http://jenkins/queue/cancelItem?id=65' `--data` causes the request to be sent as POST, '

Cancel a Queue via Jenkins API

2013-08-06 Thread tiago fernandez
Hello, I want to cancel a queue item in a Job that has permissions set. I have tried for example to cancel a queue item with ID 65 (I get the ID from the Queue Api: queue/api/json?pretty=true): http:///queue/cancelItem?id=65 or using the token that job has set: http:///queue/cancelItem?tok

Jenkins api: can you filter builds of a job by build parameters?

2013-06-25 Thread cchen
1) For a parameterized job, how can I filter builds by build parameters? For example, I would like to get all the builds of a job that have parameter name = 'abc' in one call. Currently, I have to make multiple calls. 2) Another related question - I can filter build records using build numb

Creating/removing views/jobs from code using the Jenkins API?

2013-01-13 Thread morty
I would like to automate the process of creating/removing views and jobs on a running instance of jenkins from code. I imagined creating a java application that uses the jenkins api to do various jenkins (re)configuration tasks, eg. create jobs, specify scm, build types (maven, free style

Re: How to offline a slave via jenkins API?

2012-05-22 Thread Jason Swager
I know that you can use the Jenkins CLI to offline a slave with the "disconnect-node" command.

How to offline a slave via jenkins API?

2012-05-22 Thread Romu
Hi, Is it possible to offline a slave via jenkins API? I checked http://myjenkins.com/computer/api/ but didn't find any clue. Thanks Romu