iControl REST Cookbook - Virtual Server (ltm virtual)
This cookbook lists selected ready-to-use iControl REST curl commands for virtual-server related resources. Each recipe consists of the curl command, it's tmsh equivalent, and sample output.
In thi...
Updated Oct 30, 2024
Version 3.0Satoshi_Toyosa1
Ret. Employee
Joined May 15, 2019
Arie
Altostratus
The section about disabling VIPs seems to be incorrect.
curl -sku admin:admin https://<host>/mgmt/tm/ltm/<vs> \
-X PATCH -H "Content-Type: application/json" \
-d '{"enabled": false}' \
Results in HTTP 400 Bad Request.
{
"code": 400,
"message": "one or more properties must be specified",
"errorStack": [],
"apiError": 26214401
}
Changing the JSON to the following does the trick:
{
"disabled": true
}
Subsequently, the JSON response is:
{
"kind": "tm:ltm:virtual:virtualstate",
"name": "TestVIP",
[...]
"disabled": true,
[...]
}
For comparison, an enabled VIP looks like this:
{
"kind": "tm:ltm:virtual:virtualstate",
"name": "TestVIP",
[...]
"enabled": true,
[...]
}
Version: 12.1.2
chin_ntt
Oct 31, 2024Nimbostratus
Why is the value true without quotes?
"disabled": true
"enabled": true
Shouldn't the value in JSON data be inside double quotes?
- JRahmOct 31, 2024Admin
some fields are ints or booleans, not strings
- chin_nttOct 31, 2024Nimbostratus
Thanks for the clarification JRahm.
I thought the word true was being parsed as a string. But as you mentioned, it's considered as a Boolean.
I see IP addresses are inside double quotes. So I guess those are considered as strings and not integers!
- JRahmOct 31, 2024Admin
yep, that's correct.