Reply

Failed to Create Network using API

Member
Posts: 2
1593     0
Hi, I am using the Infoblox 6.8 API to create a network but when I execute the PERL Program it throws me with the following: Status_Code = 1114 Status_Details = Object is incompatible with session object I would really appreciate your help. Best Regards, Mark Pagulayan Below is the code that I used: #!/usr/bin/perl my $session = getIBSessions("130.xxx.xxx.xxx"); my $network = "10.10.0.0/16"; addNetwork($session, $network); sub addNetwork { my ($session, $netwo) = @_; my $network = Infoblox:Smiley Very HappyHCP::Network->new( network => $netwo, ); $session->add( $netwo ) || die "Add Network Failed " . Infoblox::status_code(). ":" .Infoblox::status_detail() . "\n"; } sub getIBSession { my ($master) = @_; my $session = Infoblox:Smiley Frustratedession->new( master => $master, #appliance host ip username => "admin", #appliance user login password => "" #appliance password ); if ($session){ print "Session created successfully\n"; return $session; } else { die("Construct session failed: ", Infoblox::status_code() . ":" . Infoblox::status_detail()); } }

Passing wrong variable to $session

Authority
Posts: 39
1594     0

Hi,

In the code you're trying to add $netwo (the string) instead of $network (the Infoblox:Smiley Very HappyHCP::Network object)

your code :

sub addNetwork {
my ($session, $netwo) = @_;
my $network = Infoblox:Smiley Very HappyHCP::Network->new(
network => $netwo,
);

#replace $netwo by $network
#$session->add( $netwo ) || die "Add Network Failed " . Infoblox::status_code(). ":" .Infoblox::status_detail() . "\n";
$session->add($network) || die "Add Network Failed " . Infoblox::status_code(). ":" .Infoblox::status_detail() . "\n";
}

Kind regards,

Stefaan Van den Branden

Showing results for 
Search instead for 
Did you mean: 

Recommended for You