Forum Discussion
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. ...
Mar 11, 2011
Darn typos... I misspelled the "permissions" member int he UserInfo structure. I tested this one and it did create the user for me.
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 = {
is_encrypted => 0,
password => ""
};
$UserID = {
name => $UserName,
full_name => $FullName
};
$UserPermissions = {
role => $Role,
partition => $Partition
};
$UserInfo = {
user => $UserID,
password => $Password,
permissions => [$UserPermissions],
login_shell => "",
};
$soapResponse = $UserManagement->create_user_3(
SOAP::Data->name(users => [$UserInfo])
);
};
That's the down side of perl with it's dynamic language. You need to make sure you get all the parameter names correct. Using a more tightly bound language like .Net or Java will not have this problem.
-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