#!/usr/bin/env python
import sys
import requests

def usage():
    print "Usage: register provider link-key id-key"
    sys.exit(1)

def main():
    if len(sys.argv) != 4:
        usage()

    provider = sys.argv[1]
    linkkey = sys.argv[2]
    idkey = sys.argv[3]
    r = requests.post('http://{provider}:7900/register'.format(provider=provider), {'linkkey': linkkey, 'idkey': idkey})
    print r.json()

if __name__ == "__main__":
    main()

