From df4c58989aed3d7d98203ac3278727be6e068162 Mon Sep 17 00:00:00 2001 From: Gilles Grandou Date: Mon, 19 Feb 2018 23:42:40 +0100 Subject: [PATCH] helper script to add OVH customer key --- register_ovh_account | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 register_ovh_account diff --git a/register_ovh_account b/register_ovh_account new file mode 100755 index 0000000..b017b64 --- /dev/null +++ b/register_ovh_account @@ -0,0 +1,20 @@ +#!/usr/bin/python3 + +from ovh import ovh + +domain = 'example.com' + +client = ovh.Client() + +ck = client.new_consumer_key_request() +ck.add_rules(ovh.API_READ_WRITE_SAFE, '/domain/zone/%s/record' % domain) +ck.add_rules(ovh.API_READ_WRITE_SAFE, '/domain/zone/%s/record/*' % domain) +ck.add_rules(ovh.API_READ_WRITE_SAFE, '/domain/zone/%s/refresh' % domain) + +validation = ck.request() + +print("Please visit %s to authenticate" % validation['validationUrl']) +input("and press Enter to continue...") + +# Print nice welcome message +print("'consumerKey' is '%s'" % validation['consumerKey'])