Forum Discussion
How to Modify iRule and apply new iRule through API.
Hi Experts, I am completely new to F5 and its a completely grey area for me.I came across a situation where i need to apply one of the two iRule to virtual application defined in LTM. How can do this from PowerShell ? Is there any API if so how to call that ? How to call this from TFS release task ?
To give you the context, I am in process of automating the release process for one of the application in TFS ( which means i need to call the API from TFS release task ).
8 Replies
Hi Mitesh,
I believe those two powershell based package can be helpful:
https://github.com/joel74/POSH-LTM-Rest
https://github.com/joel74/POSH-F5-BIGIP
- Mitesh_378646
Nimbostratus
Thanks so much for the info. Do you know how to use it ? Do I just need to use that single powellshell script "Set-iRule.ps1" or something else. ?
- JRahm
Admin
The usage information for the module is in the readme on Github. You need to establish your credentials, and then instantiate the BIG-IP.
$secpasswd = ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force $mycreds = New-Object System.Management.Automation.PSCredential "username", $secpasswd New-F5Session -LTMName "192.168.1.245" -LTMCredentials $mycreds
This of course assumes you are using basic auth instead of tokens.
- Mitesh_378646
Nimbostratus
Thanks Tiziano & Jason for your help. Does that mean to set\update the iRule i just need to include 'Set-iRule.Ps1' or 'Get-iRule' in my TFS release task and execute it ?
Thanks Again for your help and pointing me to right direction.
- JRahm
Admin
Yes, after instantiation you should be able to just run the script. Note the credentials line in the Set-iRule.ps1 srcipt.
However, please note I'm not sure exactly about the mechanics of TFS as I'm unfamiliar with the platform.
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