Veselin
Jan 02, 2024Nimbostratus
F5 SDK LTM Policy Listing
Hello,
I have been working on a script using the SDK to list a VS configuration, so far so good, however I got stuck with the LTM policy. I got to the nested object of the policy and the rules, however the conditions/actions have been done with (**kwargs), example of the dictionary:
{'kind': 'tm:ltm:policy:rules:conditions:conditionsstate', 'name': '0', 'fullPath': '0', 'generation': 125791, 'selfLink': 'https://localhost/mgmt/tm/ltm/policy/~test~policy_test/rules/test/conditions/0?ver=16.1.3.4', 'all': True, 'caseInsensitive': True, 'equals': True, 'external': True, 'httpHost': True, 'index': 0, 'present': True, 'remote': True, 'request': True, 'values': ['test'], '_meta_data': {'container': <f5.bigip.tm.ltm.policy.Conditions_s object at 0x7f8705eb1960>, 'bigip': <f5.bigip.ManagementRoot object at 0x7f870f653bb0>, 'icr_session': <icontrol.session.iControlRESTSession object at 0x7f870f653430>, 'icontrol_version': '', 'minimum_version': '11.5.0', 'allowed_commands': [], 'required_command_parameters': set(), 'exclusive_attributes': [], 'object_has_stats': True, 'minimum_additional_parameters': set(), 'required_creation_parameters': {'name'}, 'required_load_parameters': {'name'}, 'read_only_attributes': [], 'reduction_forcing_pairs': [('enabled', 'disabled'), ('online', 'offline'), ('vlansEnabled', 'vlansDisabled')], 'required_json_kind': 'tm:ltm:policy:rules:conditions:conditionsstate', 'uri': 'https://bigip.example.info:443/mgmt/tm/ltm/policy/~test~policy_test/rules/test/conditions/0/', 'creation_uri_qargs': {'ver': ['16.1.3.4']}, 'creation_uri_frag': '', 'allowed_lazy_attributes': [<class 'f5.bigip.resource.Stats'>]}}
TCL BigIP code:
rules {
test {
actions {
0 {
forward
select
pool /test/test
}
}
conditions {
0 {
http-host
values { test }
}
}
}
}
Is there a way to get the non-default (**kwargs), the conditions/actions, which are non-default and passed as arguments during the creation?
Is it possible to extract something like the GUI:
All your help is much appreciated!