Skip to main content
Solved

API to get devices aligned to a dynamic app

  • October 31, 2024
  • 1 reply
  • 5 views

Forum|alt.badge.img

Hey, I am wondering if there is an API logic to get all devices aligned to a snippet performance dynamic application ? regardless of whether they are collecting any data or not.

Best answer by chris_thornton

So I am not too familiar with the API, but a quick search doesn't look like you can. I am more familiar with the GQL side and it is possible to get it that way though. 

This is an example that will get the devices aligned to the "BGP Peer Statistics" Snippet Performance Dynamic Application. I have it limited to 2 devices, first: 2 at the end, but you can put whatever number you want there. It is also only returning the device ID and name from the system for those that match it, but you can get more or less fields if you want. You can replace the Dynamic Application name with whatever one you want to target to get the info from as well.

{ devices(search: {alignedDynamicApplication: {has: {dynamicApplication: {has: {name: {eq: "BGP Peer Statistics"}}}}}}, first: 2) { edges { node{ id name } } pageInfo { matchCount } } }

 

1 reply

Forum|alt.badge.img

So I am not too familiar with the API, but a quick search doesn't look like you can. I am more familiar with the GQL side and it is possible to get it that way though. 

This is an example that will get the devices aligned to the "BGP Peer Statistics" Snippet Performance Dynamic Application. I have it limited to 2 devices, first: 2 at the end, but you can put whatever number you want there. It is also only returning the device ID and name from the system for those that match it, but you can get more or less fields if you want. You can replace the Dynamic Application name with whatever one you want to target to get the info from as well.

{ devices(search: {alignedDynamicApplication: {has: {dynamicApplication: {has: {name: {eq: "BGP Peer Statistics"}}}}}}, first: 2) { edges { node{ id name } } pageInfo { matchCount } } }