Skip to content

Instantly share code, notes, and snippets.

@lupupaulsv
Created April 29, 2020 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lupupaulsv/ae9697cf8e528af788c9c1b82577d820 to your computer and use it in GitHub Desktop.
Save lupupaulsv/ae9697cf8e528af788c9c1b82577d820 to your computer and use it in GitHub Desktop.
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)
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