I’m curious if there is an API call which i can issue so that i can send command to jenkins agent, agent will run the command on it’s host, then return reply/command output as http reply (json or plaintext)?
Currently, we can open up agent config from Jenkins, opet script console, type “println ‘uname -a’.execute()” and it will return them output in that page. But how about doing it via api call?
Linux hostname 5.15.0-1019-aws #23~20.04.1-Ubuntu SMP Thu Aug 18 03:20:14 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Which is what i expected, however i wish there was possibly an easier way? Sure i can place the script in file that use @filename for script parameter but that just adds another layer of complexity.