Steve_Brown_882
Mar 10, 2011Historic F5 Account
create_user_3 in a perl script
Hey Guys,
I don't do a lot of perl scripting so I am hoping for a little help getting a script to work. Basically I have pieced som code together from the forums but it doesn't quite work.
Here is the code I have so far, any thoughts?
!/usr/bin/perl
use SOAP::Lite;
sub SOAP::Transport::HTTP::Client::get_basic_credentials
{
return "admin" => "admin";
}
$UserManagement = SOAP::Lite
-> uri('urn:iControl:Management/UserManagement')
-> readable(1)
-> proxy("https://192.168.10.100/iControl/iControlPortal.cgi");
&handle_create();
sub handle_create()
{
my ($UserName, $FullName, $Role, $Partition ) = @_;
if ( $UserName eq "" ) { $UserName = "testuser1"; }
if ( $FullName eq "" ) { $FullName = "New User"; }
if ( $Role eq "" ) { $Role = USER_ROLE_GUEST ; }
if ( $Partition eq "" ) { $Partition = "Common" ; }
$Password = "";
$UserID = {
name => $UserName,
full_name => $FullName
};
$UserPermissions = {
role => $Role,
partition => $Partition
};
$UserInfo = {
user => $UserID,
password => $Password,
permisision => $UserPermissions,
login_shell => "/bin/bash",
};
$soapResponse = $UserManagement->create_user_3(
SOAP::Data->name(users => [$UserInfo])
);
}