-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#309 JobList API to support Tree and Depth
- Loading branch information
1 parent
e2a3572
commit 97f9333
Showing
8 changed files
with
291 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/main/java/com/cdancy/jenkins/rest/domain/job/JobListTree.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.cdancy.jenkins.rest.domain.job; | ||
|
||
import java.util.List; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import org.jclouds.javax.annotation.Nullable; | ||
import org.jclouds.json.SerializedNames; | ||
|
||
@AutoValue | ||
public abstract class JobListTree { | ||
|
||
@Nullable | ||
public abstract String clazz(); | ||
|
||
@Nullable | ||
public abstract String name(); | ||
|
||
@Nullable | ||
public abstract String fullName(); | ||
|
||
@Nullable | ||
public abstract List<JobListTree> jobs(); | ||
|
||
@Nullable | ||
public abstract String color(); | ||
|
||
@Nullable | ||
public abstract String url(); | ||
|
||
@SerializedNames({"_class", "name", "fullName", "jobs", "color", "url"}) | ||
public static JobListTree create( | ||
@Nullable String clazz, | ||
@Nullable String name, | ||
@Nullable String fullName, | ||
@Nullable List<JobListTree> jobs, | ||
@Nullable String color, | ||
@Nullable String url | ||
) { | ||
return new AutoValue_JobListTree(clazz, name, fullName, jobs, color, url); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"_class": "hudson.model.Hudson", | ||
"assignedLabels": [ | ||
{ | ||
"name": "built-in" | ||
} | ||
], | ||
"mode": "NORMAL", | ||
"nodeDescription": "the Jenkins controller's built-in node", | ||
"nodeName": "", | ||
"numExecutors": 2, | ||
"description": "Jenkins REST API Configuration as code test", | ||
"jobs": [ | ||
{ | ||
"_class": "hudson.model.FreeStyleProject", | ||
"name": "DevTest", | ||
"url": "http://localhost:8080/job/DevTest/", | ||
"color": "notbuilt" | ||
} | ||
], | ||
"overallLoad": {}, | ||
"primaryView": { | ||
"_class": "hudson.model.AllView", | ||
"name": "all", | ||
"url": "http://localhost:8080/" | ||
}, | ||
"quietDownReason": null, | ||
"quietingDown": false, | ||
"slaveAgentPort": 50000, | ||
"unlabeledLoad": { | ||
"_class": "jenkins.model.UnlabeledLoadStatistics" | ||
}, | ||
"url": null, | ||
"useCrumbs": true, | ||
"useSecurity": true, | ||
"views": [ | ||
{ | ||
"_class": "hudson.model.AllView", | ||
"name": "all", | ||
"url": "http://localhost:8080/" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"_class" : "com.cloudbees.hudson.plugins.folder.Folder", | ||
"jobs" : [ | ||
{ | ||
"_class" : "hudson.model.FreeStyleProject", | ||
"fullName" : "Test Project" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"_class": "hudson.model.Hudson", | ||
"jobs": [ | ||
{ | ||
"_class": "hudson.model.FreeStyleProject", | ||
"fullName": "DevTest" | ||
}, | ||
{ | ||
"_class": "com.cloudbees.hudson.plugins.folder.Folder", | ||
"fullName": "test-folder", | ||
"jobs": [ | ||
{ | ||
"_class": "com.cloudbees.hudson.plugins.folder.Folder", | ||
"fullName": "test-folder/test-folder-1" | ||
} | ||
] | ||
} | ||
] | ||
} |