Imagine if we could scale up our applications from our company chatroom? Or maybe even from our own custom admin panel? This is possible by integrating with the Heroku API. In this recipe, we'll be introduced to managing processes with the Platform API gem. This will give us the start we need to write our own code to handle scaling our Heroku applications.
Let's get started by opening up a terminal and navigating to our heroku-api-examples
directory. Then, we can perform the following steps:
We can start by launching a console session to get familiar with the
app
commands:$ ruby console.rb
Now that we have a console session running, let's get a list of our available applications from the API using
app.list
. This will return an array of hashes. Each item in the array is one of our applications.We should set the response to a variable so that we can work with it later on.
$ apps = heroku_api...