Ad Widget

Collapse

How to discover devices with Azure API when a $nextlink is returned

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lars ds
    Junior Member
    • Oct 2022
    • 18

    #1

    How to discover devices with Azure API when a $nextlink is returned

    Hi everyone,

    Currently I am working on a project and I have to discover a full Azure environment. When discovering I make an API call where I ask for all virtual machines in one discription. Sadly not all devices fit in that one API call and I get a nextlink property returned. This next link property is a link that gives you the option to get the next list of virtual machines by giving you a link that has a skiptoken. This token identifies what the last resource was in the first page so that only new resources are displayed. Now it is possible that the same events occurs more than once. Example: page one return nextlink, page 2 returns next link and so on... Is there a way to get that nextlink into a variable without a script so that I create an item that uses a http poller where I can use that variable so every next page get pulled.

    Regards
  • lars ds
    Junior Member
    • Oct 2022
    • 18

    #2
    You will need to create a script that puts the next page link into a macro, which you can later use in another item. You create a loop until no more nextlink can be found.

    Comment

    • keansargent
      Junior Member
      • Dec 2022
      • 2

      #3
      I prefer to read the documentation first. https://learn.microsoft.com/en-us/rest/api/azure/ Always )

      Comment

      • lars ds
        Junior Member
        • Oct 2022
        • 18

        #4
        I created this post after reading the api documentation since I could not find any solution. If there is a specific part of the documentation that would provide a solution, could you link it? Thanks.

        Comment

        Working...