PHP and iControl REST
Problem this snippet solves: PHP and iControl REST interfaces
Here are a couple of ways to use PHP and iControlREST (iCR). iCR is lighter-weight than iControl SOAP but is only supported on >= v1...
Updated Jun 06, 2023
Version 2.0PeteWhite
Employee
Joined May 16, 2019
PeteWhite
Nov 28, 2016Employee
Hi Santosh, The functions and methods return PHP variables because I used the json_decode method on the returned JSON. So the returned data is an object that contains an array. Therefore you can manage the array by using foreach on the array eg:
$handle = curl_init();
$icr = iCR($handle,"admin","admin","GET","https:///mgmt/tm/ltm/pool")
foreach ($icr->items as $i=>$v) {
echo "Pool name:$v->name
";
}
If you want to retrieve the JSON, I suggest you use json_encode or alternatively change the code of the methods to return the JSON, although I can't see what using the JSON instead of the standard PHP functions will give you.