Using the Octopus API with Bash and jq
Blog post from Octopus Deploy
Octopus Deploy, an API-first application, allows users to perform tasks via its API that can also be done through its user interface. While PowerShell is commonly used for interacting with the API due to its ability to easily convert JSON data into PowerShell objects, this post demonstrates how to use Bash with the Octopus API for those who require *nix-based solutions. The process involves using jq, a command-line utility for parsing JSON, and cURL, a tool for making web requests, both of which can be installed through package managers like APT or YUM. The article details handling paginated data from the API by recursively calling the API until all results are retrieved, as well as executing POST requests by creating JSON documents for more interactive tasks. Additionally, the post refers users to the Octopus API examples page for further guidance on using the API with other programming languages such as PowerShell, C#, Python, and Go.