Skip to content
Permalink
Browse files

JENKINS-25286: Export assigned labels for slaves and the label expres…

…sion for jobs in JSON and XML APIs

Adds @export attribute to assignedLabels for Computer and AbstractProject
Also adjusts visibility on Label "name" parameter so it appears by default
  • Loading branch information...
benru authored and Ben Russell committed Oct 23, 2014
1 parent 6fb6e6f commit 3a0a575ecf4f68ecb1e91a249c304d683e5c273c
@@ -407,6 +407,7 @@ public void setConcurrentBuild(boolean b) throws IOException {
/**
* Gets the textual representation of the assigned label as it was entered by the user.
*/
@Exported(name="labelExpression")
public String getAssignedLabelString() {
if (canRoam || assignedNode==null) return null;
try {
@@ -776,6 +776,12 @@ public String getUrl() {
return "computer/" + Util.rawEncode(getName()) + "/";
}

@Exported
public Set<LabelAtom> getAssignedLabels() {
Node node = getNode();
return (node != null) ? node.getAssignedLabels() : Collections.EMPTY_SET;
}

/**
* Returns projects that are tied on this node.
*/
@@ -127,7 +127,7 @@ protected boolean matches(Queue.Item item, SubTask subTask) {
/**
* Alias for {@link #getDisplayName()}.
*/
@Exported
@Exported(visibility=2)
public final String getName() {
return getDisplayName();
}

0 comments on commit 3a0a575

Please sign in to comment.
You can’t perform that action at this time.