Who Me Too'd this topic

About Data Infrastructure Management Software Discussions
Connect with peers about the NetApp OnCommand suite of storage management software, including OnCommand Unified Manager, OnCommand System Manager, OnCommand Insight, OnCommand Balance, and OnCommand Workflow Automation.

user role creation in WFA--Perl

Hello,

I want ot create the User role using the Perl in the WFA.I have written below code..but getting the error..

Can't locate object method "child_add" via package "WFAUtil" at ./Useradmin4448434308083319828.pl line 22, <STDIN> line 1.

My code is...

#!/usr/bin/perl

use strict;

use warnings;

use  NaServer;

use Getopt::Long;

use WFAUtil;

our $array;our $server;our $vfiler;our $RoleName;our $comment;our $CapaName;our $api;

GetOptions("array=s" => \$array,

                 "RoleName" => \$RoleName,

                       "comment"   =>  \$comment,

                       "CapaName"  =>  \$CapaName

             ) or die "Illigal Options";

if(!  defined $array){ die "Array Name/ip Address is mendatory";}

my $wfautil=WFAUtil->new();

$wfautil->sendLog('INFO','Connecting to array:',$array);

$server=$wfautil->connect($array,$vfiler);

my $api = WFAUtil->new('useradmin-role-add');

my $xi = WFAUtil->new('useradmin-role');

$api->child_add($xi);

my $xi2 = WFAUtil->new('allowed-capabilities');

my $xi1->child_add($xi2);

my $xi3 = WFAUtil->new('useradmin-capability-info');

$xi2->child_add($xi3);

$xi3->child_add_string('name','login-snmp');

$xi1->child_add_string('comment','Testing');

$xi1->child_add_string('name','snmpAuth');

my $xi4=$wfautil->checkFailure("Failed to run the command",$server->invoke($api));

$wfautil->sendLog('INFO','Create the role for the user failed'.$array);

Who Me Too'd this topic