Forum Discussion
[iControl] : Working with partitions/folders
Hi,
I need to manipulate objects (nodes, pools, …) that are located on a partition.
I did read the SDK doc and the following articles:
- https://devcentral.f5.com/questions/problem-changing-partitions-in-perl
- https://devcentral.f5.com/codeshare/perl-management-folder
and ended with the following code:
----8<----
my $Protocol = 'https'; force it to be secure.
my $sHost = $conf{f};
my $proxy = "$Protocol://$sHost/iControl/iControlPortal.cgi";
my $folder = '/UAT';
my $SoapSession = SOAP::Lite
-> uri('urn:iControl:System/Session')
-> proxy($proxy);
eval { $SoapSession->transport->http_request->header(
'Authorization' => 'Basic ' . MIME::Base64::encode("$sUID:$sPWD", ''));
};
my $soapResponse = $SoapSession->get_active_folder();
checkResponse($soapResponse);
my $res = $soapResponse->result;
print "get_active_folder before : $res\n";
$soapResponse = $SoapSession->set_active_folder($folder);
checkResponse($soapResponse); !!! I get error here !!!
$soapResponse = $SoapSession->get_active_folder();
checkResponse($soapResponse);
$res = $soapResponse->result;
print "get_active_folder after : $res\n";
----8<----
Unfortunately, the "set_active_folder" returns the following error:
SOAP-ENV:Server Could not find element by name: folder
The "get_active_folder" method is working fine though.
How is it intended to work ?
Thank you, Best Olivier
- PeteWhite
Employee
The code looks fine to me - note that set_active_folder retutrns a void, it does not return a usable code to say whether it has been implemented.
I would hardcode the '/UAT' into the function first, and check again that /UAT exists. Maybe try changing to /Common to check that the function works ok. It's probably something silly, it usually is.
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