Forum Discussion

xsinc_142812's avatar
xsinc_142812
Icon for Nimbostratus rankNimbostratus
Dec 30, 2016

REST API: Determine what type of profile each profile is in the list for a virtual server

I'm using the REST API to do some automation. I'm currently on OS version 12.1. When I use the REST API to retrieve a list of profiles on a virtual server, I can successfully retrieve the list, but there doesn't seem to be any way to determine what kind of profile each one is. Not all my profiles use a standard naming scheme, so I can't rely on the suffix to determine what it is. What do I do to retrieve the type of profile? (SSL, web acceleration, compression etc.).

 

  • Example URL for retrieving the profile list:

https://f5lab01.domain.com/mgmt/tm/ltm/virtual/~Common~Test.app~Test_vs/profiles

 

  • Example Output:

     

    kind : tm:ltm:virtual:profiles:profilesstate name : Test_client-ssl partition : Common subPath : Test.app fullPath : /Common/Test.app/Test_client-ssl generation : 541 selfLink : context : clientside

     

    kind : tm:ltm:virtual:profiles:profilesstate name : Test_http partition : Common subPath : Test.app fullPath : /Common/Test.app/Test_http generation : 541 selfLink : context : all

     

    kind : tm:ltm:virtual:profiles:profilesstate name : Test_oneconnect partition : Common subPath : Test.app fullPath : /Common/Test.app/Test_oneconnect generation : 541 selfLink : context : all

     

2 Replies

  • I know this isn't probably an easy fix you were looking for. But you could go around accessing all profile types (or at least the ones you use) from this endpoint . So you could go iterating trough every endpoint on that list, loading some kind of dictionary with FullPath of each profile and then you could easily access all the properties for a given profile using FullPath property from your endpoint.

     

    Let me know if this helps, or you need some more details about this.

     

  • Try polling

    https://localhost/mgmt/tm/ltm/virtual/~Common~Test.app~Test_vs/profiles/stats
    In the stats response, the profile type of each profile will be listed.

    HTH

    Martin