<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9020466955649831107</id><updated>2011-08-09T12:49:12.769-07:00</updated><category term='members'/><title type='text'>Using the Infoblox API</title><subtitle type='html'>All the things you wanted to know, but didn't know how to ask</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://infobloxapi.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9020466955649831107/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://infobloxapi.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>G D H</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_WzBKHO4th1o/SVavHSUn3vI/AAAAAAAABr0/xbPZpw_nALk/S220/4b4f55de-37f6-4faa-891f-a9731a765c51_bigger.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9020466955649831107.post-5359241632979075015</id><published>2008-06-18T15:48:00.005-07:00</published><updated>2008-06-18T17:25:38.163-07:00</updated><title type='text'>Making use of map()</title><content type='html'>The map() function (perldoc -f map) is a surprisingly useful and not well publicised function in perl. It "Evaluates the BLOCK or EXPR for each element of LIST (locally setting $_ to each element) and returns the list value composed of the results of each such evaluation."&lt;br /&gt;&lt;br /&gt;So it is a shortcut method for things like :&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    my @chars&lt;br /&gt;    foreach my $_ ( @nums ) {&lt;br /&gt;       push @chars , chr ;&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can just use map to do the same thing&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    @chars = map(chr, @nums);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now, when you are working with all the methods and imbedded objects in the API, map is a very quick way to pull out the values you want :&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    # get a list of all the DNS zones&lt;br /&gt;    my @zones = $session-&gt;search(&lt;br /&gt;            "object" =&gt; "Infoblox::DNS::Zone",&lt;br /&gt;            "name" =&gt; ".*",&lt;br /&gt;            "view" =&gt; $data{'view'},&lt;br /&gt;    ) ;&lt;br /&gt;&lt;br /&gt;    # get just the list of zone names&lt;br /&gt;    my @names = map ( $_-&gt;name() , @zones ) ;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9020466955649831107-5359241632979075015?l=infobloxapi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://infobloxapi.blogspot.com/feeds/5359241632979075015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9020466955649831107&amp;postID=5359241632979075015&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9020466955649831107/posts/default/5359241632979075015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9020466955649831107/posts/default/5359241632979075015'/><link rel='alternate' type='text/html' href='http://infobloxapi.blogspot.com/2008/06/making-use-of-map.html' title='Making use of map()'/><author><name>G D H</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_WzBKHO4th1o/SVavHSUn3vI/AAAAAAAABr0/xbPZpw_nALk/S220/4b4f55de-37f6-4faa-891f-a9731a765c51_bigger.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9020466955649831107.post-8862693484699724912</id><published>2008-06-18T15:38:00.000-07:00</published><updated>2008-06-18T15:43:52.398-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='members'/><title type='text'>Getting members</title><content type='html'>There are quite a few places that mention members :&lt;br /&gt;&lt;br /&gt;       Infoblox::DHCP::Member - DHCP Member object.&lt;br /&gt;       Infoblox::DNS::Member - DNS Member object&lt;br /&gt;       Infoblox::Grid::Member - Grid Member object.&lt;br /&gt;       Infoblox::Grid::Member::DHCP - DHCP member object.&lt;br /&gt;       Infoblox::Grid::Member::DNS - Grid Member DNS object.&lt;br /&gt;       Infoblox::Grid::Member::Interface - Interface member object.&lt;br /&gt;       Infoblox::Grid::Member::License - License object.&lt;br /&gt;       Infoblox::Grid::Member::OSPF - OSPF (Open Shortest Path First) member&lt;br /&gt;       Infoblox::Grid::Member::QIP - Enable Lucent VitalQIP on a member node.&lt;br /&gt;       Infoblox::Grid::Member::RADIUS - Manages the Remote Authentication&lt;br /&gt;       Infoblox::RADIUS::Member - RADIUS Member object.&lt;br /&gt;&lt;br /&gt;So it can be confusing to work out where you get actual info about the GRID members. You should use this one :&lt;br /&gt;&lt;br /&gt;       Infoblox::Grid::Member - Grid Member object.&lt;br /&gt;&lt;br /&gt;If you wanted to get all the members in the grid, try something like this :&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# get all the members :&lt;br /&gt;my @members =  $Session-&gt;search (&lt;br /&gt;          "object" =&gt; "Infoblox::Grid::Member",&lt;br /&gt;          "name"   =&gt; "Infoblox" ,&lt;br /&gt;    )&lt;br /&gt;&lt;br /&gt;# get a list of the ip addrs&lt;br /&gt;foreach my $mem ( @members ) {&lt;br /&gt;    my  $ip = $mem-&gt;ipv4addr();&lt;br /&gt;    my $name = $mem-&gt;name();&lt;br /&gt;&lt;br /&gt;    print "member : $ip , $name\n";&lt;br /&gt;&lt;br /&gt;} &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;All the rest are just special references to menu items that appear in various places in the workflow, such as adding nameservers to a DNS zone, or setting the member for a DHCP range. These other objects are used so you can tell the server how to find the relevant information that relates to that component of the configuration.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9020466955649831107-8862693484699724912?l=infobloxapi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://infobloxapi.blogspot.com/feeds/8862693484699724912/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9020466955649831107&amp;postID=8862693484699724912&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9020466955649831107/posts/default/8862693484699724912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9020466955649831107/posts/default/8862693484699724912'/><link rel='alternate' type='text/html' href='http://infobloxapi.blogspot.com/2008/06/getting-members.html' title='Getting members'/><author><name>G D H</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_WzBKHO4th1o/SVavHSUn3vI/AAAAAAAABr0/xbPZpw_nALk/S220/4b4f55de-37f6-4faa-891f-a9731a765c51_bigger.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9020466955649831107.post-1148343165322965204</id><published>2008-06-18T15:32:00.000-07:00</published><updated>2008-06-18T15:35:30.109-07:00</updated><title type='text'>Synopsis</title><content type='html'>The Infoblox API doesn't have a Synopsis section, and a lot of users seem to have trouble getting a basic script built. Here are the essential components&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;          use Infoblox;&lt;br /&gt;&lt;br /&gt;          # connect to the grid&lt;br /&gt;&lt;br /&gt;          my $session = Infoblox::Session-&gt;new(&lt;br /&gt;               "master" =&gt; "205.158.171.216",       # VIP address of master&lt;br /&gt;               "username" =&gt; "admin",               # Username of valid account&lt;br /&gt;               "password" =&gt; "infoblox" );          # Password for above &lt;br /&gt;&lt;br /&gt;          # create a reference to a member in the Grid&lt;br /&gt;&lt;br /&gt;          my $member1ns = Infoblox::DNS::Member-&gt;new(&lt;br /&gt;               "name" =&gt; "ns1.infoblox.com",&lt;br /&gt;               "ipv4addr" =&gt; "10.128.64.6" );&lt;br /&gt;&lt;br /&gt;          # create the zone, asisgned to a member&lt;br /&gt;&lt;br /&gt;          my $zone = Infoblox::DNS::Zone-&gt;new(&lt;br /&gt;               "name" =&gt; "test.com",&lt;br /&gt;               "email" =&gt; "hostmaster\@infoblox.com",&lt;br /&gt;               "primary" =&gt; $member1ns,&lt;br /&gt;              );&lt;br /&gt;&lt;br /&gt;          # add the zone&lt;br /&gt;&lt;br /&gt;          $session-&gt;add( $zone ) or&lt;br /&gt;               printf STDERR "Add Zone failure %d: %s\n",&lt;br /&gt;                    $session-&gt;status_code(), $session-&gt;status_detail();&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9020466955649831107-1148343165322965204?l=infobloxapi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://infobloxapi.blogspot.com/feeds/1148343165322965204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9020466955649831107&amp;postID=1148343165322965204&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9020466955649831107/posts/default/1148343165322965204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9020466955649831107/posts/default/1148343165322965204'/><link rel='alternate' type='text/html' href='http://infobloxapi.blogspot.com/2008/06/synopsis.html' title='Synopsis'/><author><name>G D H</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_WzBKHO4th1o/SVavHSUn3vI/AAAAAAAABr0/xbPZpw_nALk/S220/4b4f55de-37f6-4faa-891f-a9731a765c51_bigger.jpg'/></author><thr:total>0</thr:total></entry></feed>
