Forum Discussion
set_active_partition & set_active_folder using PHP
Dear community,
I'm currently trying to get some information out of my partitioned F5 LTMs via PHP so I can display it easily in a website.
Listing partitions works like a charm but changing the active one fails every time.
I tried using set_active_partition and set_active_folder but both are not working for me.
Here is the problematic part of code:
require_once 'SOAP/Client.php';
$soapoptions = array('namespace' => 'urn:iControl');
$wsdl_partition = $sdk . $sys . '/Management.Partition.wsdl';
$wsdl_pool = $sdk . $sys . '/LocalLB.Pool.wsdl';
$wsdl_session = $sdk . $sys . '/System.Session.wsdl';
$proxy_parms = array('user' => $username, 'pass' => $password);
$client_partition = new SOAP_Client($wsdl_partition, true, '', $proxy_parms);
$client_partition->setOpt('curl', CURLOPT_SSL_VERIFYPEER, 0);
$client_partition->setOpt('curl', CURLOPT_SSL_VERIFYHOST, 0);
$partition_list = $client_partition->get_partition_list();
foreach ($partition_list as $index => $part) {
$pn = $part->partition_name;
$pd = $part->description;
echo "$pn ($pd)";
$client_session = new SOAP_Client($wsdl_session, true, '', $proxy_parms);
$client_session->setOpt('curl', CURLOPT_SSL_VERIFYPEER, 0);
$client_session->setOpt('curl', CURLOPT_SSL_VERIFYHOST, 0);
$output = $client_session->set_active_folder('/');
$active = $client_session->get_active_folder();
echo "debug: >$output< >$active<";
The Output for set_active_folder is "The named parameter folder is not in the call parameters."
For set_active_partition it's "The named parameter active_partition is not in the call parameters."
Both times the active partition stays Common.
Could you please help me where's the problem with my coding
Best Regards
Sam
EDIT:
Never mind... Just found the solution looking at this page: http://norbert.mocsnik.com/blog/arc...eters.html
Now my code is this:
$params = array('active_partition' => $pn);
$output = $client_partition->call('set_active_partition', $params);
Works perfect :-)
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com