Network Change & Configuration Management

Reply

How to find a Network/Subnet given a CIDR range via Perl API?

Authority
Posts: 41
1572     0

Hi,

 

I'm trying to find all the networks of 10/8 in our Network using Perl API. I'm confused as which broker to use?

There are two availabe not sure which one would be the right choice?

 

1.NetMRI::API::Broker::Network

2.NetMRI::API::Broker:Smiley Frustratedubnet

 

I'm using (find) method with operator and field value as to narrow the serach but I ddint get any expected reslut?

Once I have the query result I don't see any way to find get the attribut

Can sone point me in the correct direction?

 

thanks

Nidhi

Re: How to find a Network/Subnet given a CIDR range via Perl API?

[ Edited ]
Adviser
Posts: 406
1573     0

Subnet is the correct one to use

 

 

 use NetMRI::API;
 my $client = NetMRI::API->new({ api_version => '3.0.0' });
 my $broker = $client->broker->subnet;

my @subnets =$broker->index;

 

Loop though @subnets and print out $subnet->SubnetCIDR

 

Thanks,

Sif

 

Follow me on LinkedIn: https://www.linkedin.com/in/sifbaksh
Twitter: https://twitter.com/sifbaksh
Showing results for 
Search instead for 
Do you mean 

Recommended for You