I have to do bulk changes in F5 box using python, I have syntex for creating single Virtual from python, But i want to do it for around 300 +, where inputs are in .CSV with 10 + columns. 300 Rows.
- So the commands has to fetch the data from row 1 with 10 Data
- Create the Single VIP in f5 box, then again same function commands has to fetch data from second row
- if row is empty, it has to stop and give completed status
- if command failed in any one row, just some message has to place end of the row, then go to next row
Python Command for creating single VIP
myvirtual = bigip.ltm.virtuals.virtual.create(name=["name"],
description=["description"],
destination="%s:%s" % (["ip"], ["port"]),
ipProtocol=["ipProtocol"], [pool][1]=["pool"])
CSV format
Row name description destination IP destination Port ipProtocol pool
1 Server 1 Server 1 172.61.64.1 80 TCp TCp
2 Server 2 Server 2 172.61.64.2 80 TCp TCp
3 Server 3 Server 3 172.61.64.3 80 TCp TCp
4 Server 4 Server 4 172.61.64.4 80 TCp TCp
So, my command has to create 4 Virtual servers from CSV file, each one for one row I am using python 3 and import CSV
please any one help, i am new to python