test.py 602 B

123456789101112131415161718192021222324
  1. import ovh
  2. # domain-zone-star-test
  3. client = ovh.Client(
  4. endpoint='ovh-eu',
  5. application_key='todo',
  6. application_secret='todo',
  7. consumer_key='todo',
  8. )
  9. # Print nice welcome message
  10. #print("Welcome", client.get('/me')['firstname'])
  11. #print("My records", client.get('/domain/zone/norwood.bzh/record/5353546247')['target'])
  12. # Create a record
  13. params = {}
  14. params['fieldType'] = 'TXT'
  15. params['subDomain'] = 'hello'
  16. params['target'] = 'from python'
  17. params['ttl'] = 600
  18. print('Creating record ...')
  19. ans = client.post('/domain/zone/norwood.bzh/record', **params)
  20. print('Record created : ', ans)