How to access jobs under folders in jenkins
I have been looking at this api for a while now and as far as I can tell the folders are seen as jobs and there are no keys under them. Looking at all jobs shows the jobs at the root of the hierarchy and the folder that I have there, but nothing below that. There does not appear to be any parameters or configuration or anything else that the api can get. Is there any way to get this API to read the jobs that are under folders in Jenkins?
Hi,
I just did a quick glance on folders plugin api. It looks that folder is expressed as a job, which has jobs and views arrays - that can be used to distinguish between folder "job" and normal job.
I'd say that from jenkinsapi perspective it would be fairly easy to script folder creation and filter out folders from jenkins.get_jobs().
I will take a look on it.
There is jenkins.process_job_folder(): it returns all jsons for all jobs under specific folder and its subfolders. Some work needs to be done in jenkinsapi to represent folders as proper objects and simplify access to their subfolders and jobs.
I am not seeing that anywhere in the code. If I could at least get something that shows me the listing of jobs under the folders and a way to accessing the jobs under there. I am considering writing my own code for that but I thought it would be easier if this API already had at least some basic way of accessing the information that I could use.
This is fairly new plugin from CloudBees, so nobody has written anything for it. You are more than welcome to send pull request with support for folders!
I'm going to close this since I don't think anybody is likely to work on it.
I'll give it a try
Great!
For a feature like this we'd need to see a unittest that demonstrates the object dealing with the data correctly. We'd also need to see an integration test that shows the API correctly driving Jenkins + this plugin.
On Tue, Jul 29, 2014 at 11:54 PM, Daniel Serodio [email protected] wrote:
I'll give it a try
— Reply to this email directly or view it on GitHub https://github.com/salimfadhley/jenkinsapi/issues/281#issuecomment-50550717 .
Any work done on it yet?
any work done on it?