1 Reply Latest reply on Oct 31, 2014 4:47 PM by tdanner

    Need to get the latest Config from the SDK

    dcornell

      I am having issues trying to craft a query to get the latest config for a device from the SDK (The work below is SQL, but I will covert it later once I have the data I need). It would be nice to pull a reference of the last config download time from the node properties and I thought this would be the "LastTransferDate", but it appears that it is not the case. Is there any meta data to that will give me the latest download time so I can join the tables and get one config? What does the lastTransferTime represent?

       

      Here is the test query:

      SELECT TOP 1

         CA.Config

         ,CA.DownloadTime

         ,CN.LastTransferDate

         NCM_ConfigArchive CA

      INNER JOIN

         NCM_NodeProperties CN

      ON

         CA.NodeID = CN.NodeID

      INNER JOIN

         Nodes N

      ON

         CN.CoreNodeID = N.NodeID

         N.Caption = 'NodeNmae'

      ORDER BY

         CA.DownloadTime DESC


      Results:

      Config                                                   DownloadTime                   LastTransferDate
      !Command: show running-config  |  2014-10-21 02:30:53.000  |  2014-10-27 17:35:02.097

       

      I would like to do something like this:

       

      SELECT

          CA.Config

      FROM

          NCM_ConfigArchive CA

      INNER JOIN

          NCM_NodeProperties CN

        ON

          CA.NodeID = CN.NodeID

      INNER JOIN

          Nodes N

        ON

          CN.CoreNodeID = N.NodeID

      WHERE

          N.Caption = 'NodeName'

        AND

          CN.LastTransferDate = CA.DownloadTime