F5 Friday: Python SDK for BIG-IP
First, thanks very much for the SDK! It is very useful. I have been playing around with creating pools and virtual servers. I have run into the following error when trying to add profiles to a virtual server. The code is as follows:
myvirtual = bigip.ltm.virtuals.virtual.create(name="testvirtual", destination="10.25.32.53:443", ipProtocol="tcp", pool="testpool") profiles = myvirtual.profiles_s profile = myvirtual.profiles_s.profiles myvirtual.profiles_s.profiles.create(partition="Common",name="tcp-lan-optimized")
The error:
raise iControlUnexpectedHTTPError(error_message, response=response)
icontrol.exceptions.iControlUnexpectedHTTPError: 400 Unexpected Error: Bad Request for uri: https://10.25.46.19:443/mgmt/tm/ltm/virtual/~Common~testvirtual/profiles/ Text: u'{"code":400,"message":"01070097:3: Virtual server /Common/testvirtual lists duplicate profiles.","errorStack":[],"apiError":3}'
If I get the virtual details I see that there is a tcp profile assigned, I assume by default, when the virtual is created. Do I need to remove this default profile before I create the one that I want? I am able to create "http" and "oneconnect" profiles using the above method without any issues.