Forum Discussion
Icontrol Rest for creating Mutiple VIP using .CSV file input
HI, Any one please help me in below codes?
Code is working fine, able to login to bipip and do the changes
from import ManagementRoot import urllib3 urllib3.disable_warnings() bigip = ManagementRoot('35.154.x.x','admin','admin')
I dont understood, how we can give input for below codes using .CSV, belowCodes i got from very old post. any please edit it and give me how i will use this formaking bulk creating for VIP's in Bigip
def configureVirtuals(bigip, virtualFile): These are the fields in the file. The purpose of each field is obvious. See the BIG-IP iControl REST API for more information. fieldNames = ["name", "description", "ip", "port", "ipProtocol","pool", "protocolProfileClient", "httpProfile", "oneConnectProfile", "sslProfileClient", "sslProfileServer", "rules", "persistence", "policies"] virtualReader = csv.DictReader(virtualFile, fieldnames=fieldNames, delimiter=",")
Create a virtual server, one per line. try: for row in virtualReader: myvirtual = bigip.ltm.virtuals.virtual.create(name=row["name"], description=row["description"], destination="%s:%s" % (row["ip"], row["port"]), ipProtocol=row["ipProtocol"], pool=row["pool"])
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