Forum Discussion
python rest api: How to get profiles details?
- Jun 13, 2019
This SelfLink doesn't contain any info regarding configuration. It's only a reference pointing itself.
Check this ->
# curl -sku admin:XXXX https://localhost/mgmt/tm/ltm/virtual/~Common~myvirtual/profiles/~Common~tcp | json-format { "kind": "tm:ltm:virtual:profiles:profilesstate", "name": "tcp", "partition": "Common", "fullPath": "/Common/tcp", "generation": 239, "selfLink": "https://localhost/mgmt/tm/ltm/virtual/~Common~myvirtual/profiles/~Common~tcp?ver\u003d12.1.4.1", "context": "all" }But if you search just for the profile you have all the configuration ->
# curl -sku admin:XXXX https://localhost/mgmt/tm/ltm/profile/tcp/~Common~tcp | json-format { "kind": "tm:ltm:profile:tcp:tcpstate", "name": "tcp", "partition": "Common", "fullPath": "/Common/tcp", "generation": 1, "selfLink": "https://localhost/mgmt/tm/ltm/profile/tcp/~Common~tcp?ver\u003d12.1.4.1", "abc": "enabled", "ackOnPush": "enabled", "closeWaitTimeout": 5, ... }So, as I have already said, you need to capture both queries and associate them.
KR,
Dario.
Hello.
To use SDK is similar of using iControl REST.
This command captures all the profile names bonded to a specific VS (without specifying category)
# https:// <F5_mgmt_IP>/mgmt/tm/ltm/virtual/<virtual_name>/profilesAnd this command captures all Client SSL profiles configured in the device
# https:// <F5_mgmt_IP>/mgmt/tm/ltm/profile/client-sslIf I want to associate what profiles from the first output are Client SSL profiles, I need to compare both outputs.
For SDK is the same.
# CAPTURE ALL CLIENT SSL PROFILES
client_ssls = session.tm.ltm.profile.client_ssls.get_collection()
# https:// <F5_mgmt_IP>/mgmt/tm/ltm/profile/client-ssl
# CAPTURE ALL VIRTUALS
virtuals = session.tm.ltm.virtuals.get_collection()
# https:// <F5_mgmt_IP>/mgmt/tm/ltm/virtual
# SHOW VS AND THEIR CLIENT SSL PROFILES
for virtual in virtuals:
print("------------")
print("Virtual: {}".format(virtual.name))
listClientSsl_inUse = []
for profile in virtual.profiles_s.get_collection():
# https:// <F5_mgmt_IP>/mgmt/tm/ltm/virtual/<virtual_name>/profiles
if profile.name in listClientSsl:
listClientSsl_inUse.append(profile.name)
if listClientSsl_inUse:
for prof in listClientSsl_inUse:
print("Client SSL: {}".format(prof))
else:
print("Client SSL: None")I recommend you to check this example
https://devcentral.f5.com/s/articles/Displaying-VS-config-using-SDK
KR,
Dario.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
