Created
April 29, 2020 13:56
-
-
Save lupupaulsv/ae9697cf8e528af788c9c1b82577d820 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import os | |
HEROKU_APP=os.environ['HEROKU_APP'] | |
HEROKU_API_KEY=os.environ['HEROKU_API_KEY'] | |
### scale up our application to 4 dynos | |
url = 'https://api.heroku.com/apps/'+HEROKU_APP+'/formation' | |
head = {"Content-Type": "application/json", "Accept": "application/vnd.heroku+json; version=3", "Authorization": "Bearer "+HEROKU_API_KEY} | |
payload = { "updates": [ { "quantity": 4, "type": "web" } ]} | |
r = requests.patch(url,payload,headers=head) | |
print(r) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -n -X PATCH https://api.heroku.com/apps/$HEROKU_APP/formation \ | |
-d '{ "updates": [ { "quantity": 4, "type": "web" } ]}' \ | |
-H 'Content-Type: application/json' \ | |
-H "Accept: application/vnd.heroku+json; version=3" \ | |
-H "Authorization: Bearer $HEROKU_API_KEY" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment