Forum Discussion

IT-Network_EIB's avatar
IT-Network_EIB
Icon for Nimbostratus rankNimbostratus
Dec 20, 2018

[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:

 

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

 

  • 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.