是否有Heroku API允许我以编程方式扩展和缩小我的dynos等?
我找到了API文档的链接,但它似乎不再存在了。
由于
答案 0 :(得分:4)
This link目前适用于API。对于自动缩放,我们使用hirefire。这是一个托管服务,其功能略高于open source gem同名。
答案 1 :(得分:4)
Heroku gem允许您轻松添加和删除过程。
gem“heroku”
您可以在ruby中创建一个可以设置工人或动力等的客户端
client = Heroku::Client.new(username, password)
client.list # provides a list of heroku apps
client.info(app) # provides info on the particular app, including dynos and workers
client.workers(app) # returns the number of workers currently running for the app
client.set_workers(app, qty) # sets the number of workers for the app
client.dynos(app) # returns the number of dynos currently running for the app
client.set_dynos(app, qty) # sets the number of dynos
基本上,您可以从命令行执行任何操作,您可以使用gem。
结帐https://github.com/heroku/heroku/blob/master/lib/heroku/client.rb了解详情。
答案 2 :(得分:1)
现在推荐使用Heroku :: Client。 heroku-api gem具有您需要的能力。 https://github.com/heroku/heroku.rb
答案 3 :(得分:0)
我不确定是否有任何记录,但是heroku gem本身会通过REST与他们的API进行对话,因此你可以在其中找到一个高峰。
Heroku有自动缩放宝石,我已经看到了其他的例子,你将Heroku gem包含在你自己的应用程序中,以便能够与他们的API接口,而不会过多地参与其中。