Forum Discussion
Any clues on how to use api of f5 to create and delete virtual server ?
Did any one worked on a script which will use api calls to create and delete virtual server , pool, snatpool and nodes on ltm.
If so can you please post the script.
In other words I am looking to automate virtual server creation, any help in that direction is also appreciated, mostly I am trying with opensource..
1 Reply
- Jad_Tabbara__J1
Cirrostratus
Hello Kiran,
You can use TMSH command to create/delete VS, pool, nodes and other objects...
Create a Pool: tmsh create ltm pool "pool-name" monitor "monitor-name" load-balancing-mode "load-balancing-method-name" members add { "pool-member-name1":port { address "x.x.x.x" } "pool-member-name2":port { address "x.x.x.x" } }
Create a VS: tmsh create ltm virtual "vs-name" { destination "x.x.x.x:port" pool "pool-name" persist replace-all-with { "persistence-profile-name" } fallback-persistence none rules { "irule-name1" "irule-name2"} vlans-enabled vlans replace-all-with { "vlan-name" } profiles add { "profile-name1" "profile-name2" } snat automap }
Delete a Pool: tmsh delete ltm pool "pool-name"
Delete a VS: tmsh delete ltm virtual "vs-name"
N.B: You cannot delete an object if it is already referenced in an another object, you must first remove it from that object.
You can use the "modify" command to modify an existing object.
For more info about the tmsh command you have all the command :
If you have developpment skills in python, perl, java, php or .net and you want to use REST or SOAP APIs you can use iControl
https://devcentral.f5.com/articles/sid/6985
Hope that it helps
Regards
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