Moving Terraform to this repo

This commit is contained in:
Moritz Graf
2020-02-23 18:46:47 +01:00
parent e0b4914f9d
commit 2df820b717
6 changed files with 1013 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
# -*- encoding: utf-8 -*-
###
try:
input = raw_input
except NameError:
pass
import ovh
import json
# create a client using configuration from ovh.conf file
client = ovh.Client()
# Request RO, /me API access
ck = client.new_consumer_key_request()
ck.add_recursive_rules(ovh.API_READ_ONLY, "/")
# Request token
validation = ck.request()
print("Please visit %s to authenticate" % validation['validationUrl'])
input("and press Enter to continue...")
# Print nice welcome message
print("Welcome", client.get('/me')['firstname'])
print("Btw, your 'consumerKey' is '%s'" % validation['consumerKey'])