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.
Thanks a lot Dario. That is great! I wonder though, if there is a way to "load" the profile directly using the information provided by the profile object found in the virtual server.
In my code above, I get the profile in variable "p", which has an attribute "attrs", which pprinted looks like this:
{'context': 'all',
'fullPath': '/Common/udp',
'generation': 1,
'kind': 'tm:ltm:virtual:profiles:profilesstate',
'name': 'udp',
'partition': 'Common',
'selfLink': 'https://localhost/mgmt/tm/ltm/virtual/~Common~syslog-udp-514-vs/profiles/~Common~udp?ver=14.1.0.2'}
Is there a method load(p.selfLink) or something like that?
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.
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