Forum Discussion

Kalo's avatar
Kalo
Icon for Nimbostratus rankNimbostratus
Jan 24, 2019

obtaining total number of rest endpoints.

Hi,

 

I want to obtain total amount of icrREST objects count like this.

 

[root@:Active:Standalone] tmp curl -sku : -H "content-type": "application/json" |python -m json.tool|grep link -c 2715<---- !! it's well returned links recursively. [root@:Active:Standalone] tmp cat /VERSION|grep -i version Version: 13.1.1.2

 

 

[root@:Active:Standalone] tmp curl -sku : -H "content-type": "application/json" |python -m json.tool|grep -c link 160<---!! however, in v12, it seems a bit(?) low. [root@:Active:Standalone] tmp cat /VERSION|grep -i version Version: 12.1.3.6

 

 

Does anyone could help me out how can I get all of links in v12 like v13?

 

Thank you,

 

2 Replies

  • v12.1 I have just tested only shows the top level organization collections (tmsh modules) for

    GET /mgmt/tm
    . If you need to get the collections under each top levels and more, you need to iterate through the links.

    Accessing to

    https:///mgmt/toc
    will give you the list of endpoints (I do not know if it contain ALL), but it is designed for web browsing.

  • Kalo's avatar
    Kalo
    Icon for Nimbostratus rankNimbostratus

    Hi, Thanks! for telling me mgmt/toc, didn't know that and of course this is great. I think it will perfectly be alternate iCR reference hereafter, for me, at least.

     

    you need to iterate through the links.

     

    On the ground that finding out newly tmos components or changes, I've been drilling entire tmsh::* components in that way, it fish out really all of objects(includes monitors, profiles, early access and deprecated objects), but a bit tricky and take long time to run. so if v12's top-level organization collections were like v13(4), i can write some more intelligent code I thought.

     

    thanks anyway!