Skip to content

Instantly share code, notes, and snippets.

@sboily
Last active June 20, 2016 00:27
Show Gist options
  • Save sboily/88688514cbcb7f7cab7e to your computer and use it in GitHub Desktop.
Save sboily/88688514cbcb7f7cab7e to your computer and use it in GitHub Desktop.
export xivo users informations as CSV
#!/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