Get all of ping-multis on a collector
Hi there
I’m using the LM SDK to pull data from LM. I’m looking to pull a list of ICMP Ping-Multis configured on the collector.
Which sdk call should I be using here and does someone have an example for me of what the call will look like?
Thank very much.
| api_instance.get_device_datasource_by_id( |
| api_instance.get_device_datasource_by_id_with_http_info( |
| api_instance.get_device_datasource_data_by_id( |
| api_instance.get_device_datasource_data_by_id_with_http_info( |
| api_instance.get_device_datasource_instance_alert_setting_by_id( |
| api_instance.get_device_datasource_instance_alert_setting_by_id_with_http_info( |
| api_instance.get_device_datasource_instance_alert_setting_list_of_device( |
| api_instance.get_device_datasource_instance_alert_setting_list_of_device_with_http_info( |
| api_instance.get_device_datasource_instance_alert_setting_list_of_dsi( |
| api_instance.get_device_datasource_instance_alert_setting_list_of_dsi_with_http_info( |
| api_instance.get_device_datasource_instance_by_id( |
| api_instance.get_device_datasource_instance_by_id_with_http_info( |
| api_instance.get_device_datasource_instance_data( |
| api_instance.get_device_datasource_instance_data_with_http_info( |
| api_instance.get_device_datasource_instance_graph_data( |
| api_instance.get_device_datasource_instance_graph_data_with_http_info( |
| api_instance.get_device_datasource_instance_group_by_id( |
| api_instance.get_device_datasource_instance_group_by_id_with_http_info( |
| api_instance.get_device_datasource_instance_group_list( |
| api_instance.get_device_datasource_instance_group_list_with_http_info( |
| api_instance.get_device_datasource_instance_group_overview_graph_data( |
| api_instance.get_device_datasource_instance_group_overview_graph_data_with_http_info( |
| api_instance.get_device_datasource_instance_list( |
| api_instance.get_device_datasource_instance_list_with_http_info( |
| api_instance.get_device_datasource_instance_sdt_history( |
| api_instance.get_device_datasource_instance_sdt_history_with_http_info( |
| api_instance.get_device_datasource_list( |
| api_instance.get_device_datasource_list_with_http_info( |
MrJ
10 comments
MrJ
OPYes. All of them have the potential of paginating the results.
OK thanks.
LM User
Yes. All of them have the potential of paginating the results.
MrJ
OPOut of interest, am I going to hit the same issues with these calls?
Do I need to re-write those with pagination as well?
Thanks
MrJ
OPThat would be nice. If i were smart enough in python, i’d add it to my lm_wrapper. @BMAC could probably do it.
That reminds me, I need to add my LM Logs SDK action logger functions (simple function to send logs from an sdk script to LM Logs) to the lm_wrapper.
Sounds great, will keep an eye out.
Thanks again
LM User
That would be nice. If i were smart enough in python, i’d add it to my lm_wrapper. @BMAC could probably do it.
That reminds me, I need to add my LM Logs SDK action logger functions (simple function to send logs from an sdk script to LM Logs) to the lm_wrapper.
MrJ
OPThanks, that’s done the trick. It would be good to just have an option in the sdk call of pagination = yes or something like that. Or just return full results by default?
P.S I did have 1000 originally but I was trying all sorts to get a full response.
LM User
LM User
You need to add a size=1000 parameter to your get_device_datasource_instance_list() call. The default return size is 50. Max is 1000. If you’re going to have more than 1000, you’ll need to do some pagination. I’ll see if i can find my post where i explain how to do pagination with the sdk.
MrJ
OPSorry, I thought I had this working. I can pull a list of ping-multi using the following SDK command:
The strange thing is it’s only returning 50 items but there are a lot more then 50 of them configured. Here is the code I am using:
Any help appreciated here.
Thanks
MrJ
OPIgnore this, I solved it. I don’t seem to be able to delete this post.