Menu

REST Api get from mutiple tables

schirrms
2021-02-05
2021-02-05
  • schirrms

    schirrms - 2021-02-05

    Hi,

    I probably misunderstand something, and didn't find an answer by myself.

    Context : itop + teemip, on latest versions (not really important for the subject, but it helps to explain the samples :))

    On one of my import set, I need to retrieve the CI 'owning' a particular IP.

    In can easily get that with that OQL query :

    SELECT i,v FROM  lnkIPInterfaceToIPAddress AS i 
        JOIN LogicalInterface AS l ON  i.ipinterface_id = l.id
        JOIN VirtualMachine AS v ON l.virtualmachine_id = v.id
    

    Now, when it comes to the rest/api, the query works well, too, but, as I have to specify witch Class I query, I'm not able to obtain an answer like the IP address (that would be i.ipaddress_id_friendlyname) and the vm name (that would be v.name)

    To be more precise, if I interrogate the Class lnkIPInterfaceToIPAddress, I can get the IP adress, and if I interrogate the Class VirtualMachine (I need to Write then SELECT v FROM ...) I can get the VM name, but no link between !

    One other way could be to query an entry from the request book, as this is actually workin in the request book too.

    Any idea ?

    Thanks,

    Pascal

     
  • schirrms

    schirrms - 2021-02-05

    In between, I found that thread fron 2017. At this time, that wasn't possible (and the possible to test workaround as propsed by Vincent doesn't work)
    https://sourceforge.net/p/itop/discussion/general/thread/860f407f/

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.