title: What is the programmatic way to disconnect a node in Jenkins?
body: <p>I want to accomplish, through a script using the Jenkins API, the equivalent of manually clicking on the "Disconnect" link on the node management page in Jenkins. I want to add this code to a script I made using the Pipeline scripting plugin.</p>
  
  <p>In other words, as a user with Jenkins admin privileges, do</p>
  
  <pre><code>Manage Jenkins -&gt; Manage Nodes -&gt; Click on a node -&gt; Click on "Disconnect"
  </code></pre>
  
  <p>As in:</p>
  
  <p><a href="https://i.stack.imgur.com/p8a6L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p8a6L.png" alt="Mange Node Page"></a></p>
  
  <p>I do not want to do the equivalent of "temporarily mark this node as offline".<br>
  That is not useful to me.</p>