Forum Discussion

Jakub_Smejkal's avatar
Jakub_Smejkal
Icon for Nimbostratus rankNimbostratus
Sep 13, 2019

iControl - fetching LTM profile config - how to know values are inherited from parent profile

Hello,

 

we are fetching F5 config in this case various ltm profiles(http,tcp), some have attributes inherited from parent, but seems this info gets lost in iControl and later when I PATCH this values all profile attributes inheritance is removed. I could PATCH only stuff I want to change, but still I dont have this information in my tool. Is it possible to get it somewhere from REST API, or I need to parse CLI?

 

Thank you for answer

 

Jakub Smejkal

5 Replies

  • Are you referring to the "Parent Profile" field in GUI or the "defaults-from" attribute in tmsh? If so, it is named "detaultsFrom" in iControl REST (camel case naming convention). You should be able to see it. The following example retrieves this field from the profile 'httpTest' which is from the http profile.

    curl -sku admin:<passwd> https://<host>/mgmt/tm/ltm/profile/http/httpTest?\$select=defaultsFrom

    This httpTest has "Insert X-Forwarded-For" enabled and that's the only parameter that is different from the parent "http". You can see that only this field is different and other parameters are identical from the following test (obviously, name, defaultsFrom or any properties that are intrinsic to the profiles are different).

    curl -sku admin:<passwd> https://<host>/mgmt/tm/ltm/profile/http/http | python -m json.tool > http
    curl -sku admin:<passwd> https://<host>/mgmt/tm/ltm/profile/http/httpTest | python -m json.tool > before
    diff http before
    5c5,8
    <     "defaultsFrom": "none",
    ---
    >     "defaultsFrom": "/Common/http",
    >     "defaultsFromReference": {
    >         "link": "https://localhost/mgmt/tm/ltm/profile/http/~Common~http?ver=14.1.0.1"
    >     },
    47,48c50,51
    <     "fullPath": "http",
    <     "generation": 1,
    ---
    >     "fullPath": "httpTest",
    >     "generation": 22,
    57c60
    <     "insertXforwardedFor": "disabled",
    ---
    >     "insertXforwardedFor": "enabled",
    61c64
    <     "name": "http",
    ---
    >     "name": "httpTest",
    69c72
    <     "selfLink": "https://localhost/mgmt/tm/ltm/profile/http/http?ver=14.1.0.1",
    ---
    >     "selfLink": "https://localhost/mgmt/tm/ltm/profile/http/httpTest?ver=14.1.0.1",

    Or am I missing the point? Will you be able to show what you had performed and observed?

    Thanks

  • thx for answer, but my problem is that I dont know if for example monitor timeout is set in profile httpTest or it is inherited value from parent http (it can be same value but not inherited), I couldnt find indicator in API where it would be distinguished

  • While the list command of tmsh shows only the differences from the parent profile, unfortunately, iControl REST gets all the properties (equivalent to tmsh's 'all-properties'). To find the difference, you need to get both profiles and run diff.

  • Well this doesnt tell me if the value was inherited or not, so I have to look into CLI seems..

  • If you are looking for common entries between two files, you can use the Unix 'comm' command. For example,

    curl -sku admin:<pass> https://<host>/mgmt/tm/ltm/profile/http/httpTest | python -m json.tool > httpTest
    curl -sku admin:<pass> https://<host>/mgmt/tm/ltm/profile/http/http | jpython -m json.tool > http
    comm -12 http httpTest

    This should give you the properties inherited from the parent http profile.