Forum Discussion
Haluk_Yildirim_
Nimbostratus
Dec 10, 2009using perl iControl for system backups / archives
Hello:
At my organization, we are trying to automate system backups of F5 LTM appliances. After considering many methods, I decided to use the iControl method mentioned.
...
Dec 16, 2009
Actually, the referenced sample includes some code I wrote to auto-insert the authentication headers in the first request.
$ConfigSync = SOAP::Lite
-> uri('urn:iControl:System/ConfigSync')
-> readable(1)
-> proxy("$sProtocol://$sHost:$sPort/iControl/iControlPortal.cgi");
eval { $ConfigSync->transport->http_request->header
(
'Authorization' =>
'Basic ' . MIME::Base64::encode("$sUID:$sPWD", '')
); };
The use of passing user:pass in the URL is not standard and not guaranteed to work across all client toolkits. It looks from your post that your version of perl does allow it but my solution will work as well.
If you want to trap the exception in the code you can use the "eval" command like this:
eval { $soap_response = $ConfigSync->get_configuration_list(); };
if ( $@ )
{
print "ERROR: $@\n";
}
$@ will contain "401 F5 Authorization Required at ..." for invalid credentials.
-Joe
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects