import requests
from requests.auth import HTTPBasicAuth

class MenMiceQuery():
    base_url = "https://ipam.eu.boehringer.com/mmws/api/IPAMRecords"
    #base_url = "https://10.183.177.24/mmws/api"
        
    def run_query(self, username, password, ip):
        response = requests.get(f'{self.base_url}/{ip}/Range', auth=HTTPBasicAuth(username, password), verify=False)
        if response.ok:
            return response.json()
        else:
            print(response.json())
            raise Exception(f"Error detected: {response.status_code}")