Search code examples
f5virtual-serverbig-ip

F5 BIG IP update VIP using REST API cause code:400, message:0107028c:3


I am trying to call my F5 Big IP REST API to update some VIP configurations, for example I want to update the VIP description using this command:

 curl -s -k --tlsv1.2 -u admin:password -H "Content-Type: application/json" -X PUT https://ManagmentIP/mgmt/tm/ltm/virtual/~MyPool~MyVIP_887 {"description":"THIS IS JUST A TEST"}

I am getting this error:

{"code":400,"message":"0107028c:3: The source (::%10) and destination (10.62.185.3%10) addresses for virtual server (/MyPool/MyVIP_887) must be be the same type (IPv4 or IPv6).","errorStack":[],"apiError":3}

My F5 Big IP version: BIG-IP 12.1.3 Build 0.0.378 Final

Am I missing something?


Solution

  • The answer is taken from F5 DevCentral:

    You have to use -d 'data' = The JSON data to send. Note that you need to quote the entire json blob, and each "name":"value" pairs must be quoted. When you have nested quotes, make sure you escape () them.

    Refer the cookbook if it helps.

    So something like,

    curl -sku admin -H "Content-Type: application/json" -X PATCH https:///mgmt/tm/ltm/virtual/ -d '{"description": "Hello World!"}'