通过Heroku API更改Dyno类型 [英] Change Dyno types through the Heroku API
问题描述
import heroku
云= heroku.from_key(os.environ.get('HEROKU_API_KEY'))
app = cloud.apps ['myapp']
webproc = app.processes ['web']
webproc。 (1)
我的问题是:是否有API调用来改变Dyno / em>的?例如将其从标准1X改为标准2X或爱好。 谢谢 与Heroku支持的聊天已经证实python API没有执行此操作的命令;因此,我采取了将以下脚本添加到应用程序(遵循本答案): 将 I have an app running in Heroku; I'm using the Heroku scheduler to run a python script that scales the number of dynos at particular times of the day, using the python API (following this answer): My question is: is there an API call to change Dyno types? For instance to change it from "standard 1X" to "standard 2X" or to "hobby". Thanks A chat with the Heroku support has confirmed that the python API has no command to perform this operation; I have therefore resorted to add the following script to the app (following this answer): Changing 这篇关于通过Heroku API更改Dyno类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
#!/ bin / bash
curl -s https://s3.amazonaws.com/assets.heroku.com/heroku -client / heroku-client.tgz | tar xz
mv heroku-client / *。
rmdir heroku-client
PATH =bin:$ PATH
heroku dyno:type hobby --app MYAPP
hobby
改为 standard-1x
或 standard-2x
根据需要。import heroku
cloud = heroku.from_key(os.environ.get('HEROKU_API_KEY'))
app = cloud.apps['myapp']
webproc = app.processes['web']
webproc.scale(1)
#!/bin/bash
curl -s https://s3.amazonaws.com/assets.heroku.com/heroku-client/heroku-client.tgz | tar xz
mv heroku-client/* .
rmdir heroku-client
PATH="bin:$PATH"
heroku dyno:type hobby --app MYAPP
hobby
with standard-1x
or standard-2x
as needed.