netfishers-onl / Netshot

Network Configuration and Compliance Management
http://www.netfishers.onl/netshot
246 stars 59 forks source link

Export Configuration Compliance via API #247

Closed uchihaitachi2 closed 1 year ago

uchihaitachi2 commented 1 year ago

Hi,

I am trying to export the device configuration compliance via API but I don't know the correct URI.

I am trying this but it doesn't work;

login_url = f'https://localhost:8443/api/user' netshot_session = requests.Session() payload = {'username': netshot_user, 'password': netshot_pass} k = netshot_session.post(login_url, json=payload, verify=False) k.raise_for_status() complianceurl = f'https://localhost:8443/api/reports/configurationcompliances' complianceget = netshot_session.get(complianceurl) compliance = complianceget.json()

Could you please provide the correct URL?

Thanks!

SCadilhac commented 1 year ago

You can use the API browser link in the Help menu within Netshot to get the list of API endpoints. Or open DevTools, Network tab, while you open the compliance report to see which call is done. You probably want to try /api/reports/groupconfigcompliancestats.

uchihaitachi2 commented 1 year ago

Thanks