LoginSignup
0
0

More than 1 year has passed since last update.

Heroku の dyno type を API で変更する方法(Ruby)

Last updated at Posted at 2022-01-01

背景

Heroku の dyno type を柔軟に変更したいケースがあるかと思いますが、Platform API を利用すれば簡単に実現する事が出来ました。
重めの処理が走る時だけ dyno を Performance-M に変更し、処理が終わったら Standard 1X に戻すなどの操作が可能です。

実装

Gem
$ gem install platform-api
require 'platform-api'

heroku = PlatformAPI.connect_oauth("#{platform_api_token}")
heroku.formation.update("#{app_id_or_app_name}", "#{formation_id_or_formation_type}", {"size" => "Standard-1X"})

参照

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0