4 years ago
Using API v2
Hi
Can someone point me in the direction of some instructions on how to make API calls with V2 of the API? (Just with a basic example on how the auth is done now etc)
I can find exampl...
Yeah, it's a bummer that it doesn't just return it as a native python dictionary. Each item in the items object of the response has a .to_dict() method though. So, you'd do it like this:
Python 3.7.3 (default, Mar 27 2019, 09:23:15) [Clang 10.0.1 (clang-1001.0.46.3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from lm import lm >>> alerts = lm.get_alert_list() >>> for alert in alerts.items: ... for key in alert.to_dict().keys(): ... print(key) ... sdt ack_comment acked acked_by acked_epoch alert_value chain chain_id clear_value cleared custom_columns data_point_id data_point_name detail_message ==== etc etc etc ===