未验证 提交 972257bf 编写于 作者: O Oleg Nenashev 提交者: GitHub

Merge pull request #1437 from benru/JENKINS-25286

[FIXED JENKINS-25286] Export assignedLabels for agents and jobs in JSON and XML APIs
......@@ -407,6 +407,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
/**
* 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 /*transient*/ abstract class Computer extends Actionable implements Acces
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 @@ public abstract class Label extends Actionable implements Comparable<Label>, Mod
/**
* Alias for {@link #getDisplayName()}.
*/
@Exported
@Exported(visibility=2)
public final String getName() {
return getDisplayName();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册