First commit and first version of the add-on
This commit is contained in:
14
Snet_check_addon/package/bin/menmice_query.py
Normal file
14
Snet_check_addon/package/bin/menmice_query.py
Normal file
@@ -0,0 +1,14 @@
|
||||
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}")
|
||||
Reference in New Issue
Block a user