POSH-LTM-Rest
POSH-LTM-Rest copied to clipboard
Support for policies
I am interested in adding support for policies. They are managed at https://localhost/mgmt/tm/ltm/policy/.
I've written a few functions to manage policies that are specific to my use cases. I'd be willing to make that generic and fill out the areas I haven't covered yet. This might result in creating the following functions
New-Policy
Get-Policy
Set-Policy
Remove-Policy
New-PolicyRule
Get-PolicyRule
Set-PolicyRule
Remove-PolicyRule
New-PolicyRuleAction
Get-PolicyRuleAction
Set-PolicyRuleAction
Remove-PolicyRuleAction
New-PolicyRuleCondition
Get-PolicyRuleCondition
Set-PolicyRuleCondition
Remove-PolicyRuleCondition
Would this be worth working on?
Hi, Elijah, it sounds like a good addition to the module, but I'm not experienced enough with policies to say one way or another if this is the best way to structure the functions or not. It looks like actions and conditions are tied to policy rules, but I'm guessing that it would be simpler to define a rule action or condition and assign it to a policy rule, than to modify a policy rule and in the process have to create actions and conditions. But again, this is not my area of expertise. If someone else wants to weigh in, please do.
@elijahgagne
I've got a few generic ASM policy functions I wrote as well for getting and setting portions of existing policies. Would you be able to share you code / provide insight on how you got them to work in the existing f5-ltm framework?
@kleinsmk https://gist.github.com/elijahgagne/a962ad36ec9244de87c5dd1e1bbdcf1c shows what I've been using. That code expects a credential instead of using the F5Session like this module. That gist may disappear in a few days.
@elijahgagne Thanks a ton. It's nice to not have to rewrite some of these. I've got no idea why F5 hasn't provided these for APM, ASM and other large portions of in their python SDK. It isn't too terribly hard to figure out the JSON object required to use the REST API but its a lot nicer to have native cmdlets.