Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

## Release 0.3.8 (NOT RELEASED YET)

* [JENKINS-46472](https://issues.jenkins-ci.org/browse/JENKINS-46472)

Added ability to modify offline cause for offline computers.

```java
ComputerWithDetails computer = ...
if (!computer.getOffline()){
computer.toggleOffline();
computer.changeOfflineCause("Scheduled for termination");
}
```

* [JENKINS-46445](https://issues.jenkins-ci.org/browse/JENKINS-46445)

Add support for both client TLS and basic authentication.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,23 @@ public void toggleOffline() throws IOException {
toggleOffline( false );
}

public void changeOfflineCause(String cause, boolean crumbFlag) throws IOException {
String name;
if ("master".equals(displayName)) {
name = "(master)";
} else {
name = UrlEscapers.urlPathSegmentEscaper().escape(displayName);
}

Map<String, String> data = new HashMap<String, String>();
data.put( "offlineMessage", cause );
client.post_form("/computer/" + name + "/changeOfflineCause?", data, crumbFlag);
}

public void changeOfflineCause(String cause) throws IOException {
changeOfflineCause(cause, false);
}

public Boolean getManualLaunchAllowed() {
return manualLaunchAllowed;
}
Expand Down