Basic API interaction

This commit is contained in:
Maël Kervella 2018-05-24 13:27:42 +00:00
parent 031bef9074
commit d72f23d085
2 changed files with 19 additions and 0 deletions

4
config.ini Normal file
View File

@ -0,0 +1,4 @@
[Re2o]
hostname = re2o-dev.rez-rennes.fr
username = moamoak
password = motdepasse

15
main.py Normal file
View File

@ -0,0 +1,15 @@
from configparser import ConfigParser
from re2oapi import Re2oAPIClient
config = ConfigParser()
config.read('config.ini')
hostname = config.get('Re2o', 'hostname')
password = config.get('Re2o', 'password')
username = config.get('Re2o', 'username')
api_client = Re2oAPIClient(hostname, username, password)
extensions = api_client.list_extensions()
print(len(extensions))