Last active
June 20, 2016 00:27
-
-
Save sboily/88688514cbcb7f7cab7e to your computer and use it in GitHub Desktop.
export xivo users informations as CSV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from xivo_auth_client import Client as Auth | |
from xivo_confd_client import Client as Confd | |
username = "change_it" | |
password = "change_it" | |
############################# | |
auth = Auth('127.0.0.1', username=username, password=password, verify_certificate=False) | |
token_data = auth.token.new('xivo_service', expiration=30) | |
token = token_data['token'] | |
confd = Confd('127.0.0.1', port=9486, verify_certificate=False, token=token) | |
print confd.users.export_csv() | |
auth.token.revoke(token) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment