How to use the proxmoxer.backends.https.AuthenticationError function in proxmoxer

To help you get started, we’ve selected a few proxmoxer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github swayf / proxmoxer / proxmoxer / backends / https.py View on Github external
def __init__(self, msg):
        super(AuthenticationError, self).__init__(msg)
        self.msg = msg
github swayf / proxmoxer / proxmoxer / backends / https.py View on Github external
def __init__(self, base_url, username, password, verify_ssl=False):
        response_data = requests.post(base_url + "/access/ticket",
                                      verify=verify_ssl,
                                      data={"username": username, "password": password}).json()["data"]
        if response_data is None:
            raise AuthenticationError("Couldn't authenticate user: {0} to {1}".format(username, base_url + "/access/ticket"))

        self.pve_auth_cookie = response_data["ticket"]
        self.csrf_prevention_token = response_data["CSRFPreventionToken"]