modify_vrf_assignment()
Infoblox::DHCP::View - DHCP Network View object
Network view provides the ability to manage multiple views of IP address spaces from NIOS. These address spaces could be overlapping or non-overlapping. When the network view is not specified during a write operation, the objects are automatically associated with the system-defined default network view.
A network view is a single routing domain, with its own networks and shared networks. You can manage the networks in one network view independently of the other network views.
my $network = Infoblox::DHCP::View->new( name => $string, #Required comment => $string, #Optional / Default is undefined ddns_zone_primaries => [$ddns1, $ddns2, ... ], #Optional / Default is undefined mgm_private => 'true' | 'false', #Optional / Default is 'false' extensible_attributes => { $string => $string|$num, $string => [ $string|$num, ...], ... }, #Optional / Default is undefined external_ddns_primaries => [ $Nameserver1,$Nameserver2,...], #Optional / Default is undefined internal_ddns_primaries => [ $ForwardZone1,$ForwardZone2,...], #Optional / Default is undefined );
This section describes all the methods in an Infoblox::Session module that can apply to a DHCP Network View object.
Use this method to add a network view object to the Infoblox appliance. See Infoblox::Session->add() for parameters and return values.
#Construct an object my $network_view = Infoblox::DHCP::View->new( name => "netview", );
# Submit for adding network view my $response = $session->add( $network_view );
Use this method to retrieve all the matching network view objects from the Infoblox appliance. See Infoblox::Session->get() for parameters and return values.
Apply the following attributes to get a specific DHCP Network View object:
name - Required. A name in string format. extensible_attributes - Optional. A hash reference containing extensible attributes.
my @result_array = $session->get( object => "Infoblox::DHCP::View" , name => "netview" );
# get all DHCP view objects with a given extensible attribute my @retrieved_objs = $session->get( object => "Infoblox::DHCP::View", extensible_attributes => { 'Site' => 'Santa Clara' });
Use this method to modify a network object in the Infoblox appliance. See Infoblox::Session->modify() for parameters and return values.
#Use method to modify comment method. $object->comment("My modified comment"); # Submit modification my $response = $session->modify( $object );
Use this method to remove an object from the Infoblox appliance. See Infoblox::Session->remove() for parameters and return values.
To remove a specifc object, first use get()
or search()
to retrieve the specific object, and then submit this object for removal.
# Get the object under the same name my @result_array = $session->get( object => "Infoblox::DHCP::View" , name => "netview" );
# find the desired object from the retrieved list. my $desired_network_view = $result_array[0];
# Submit for removal my $response = $session->remove( $desired_network_view );
Use this method to search for a DHCP Network View object in the Infoblox appliance. See Infoblox::Session->search() for parameters and return values.
Apply the following attributes to search for a DHCP Network View object:
name - Required. A name in string format (regular expression). extensible_attributes - Optional. A hash reference containing extensible attributes.
For more information about searching extensible attributes, see Infoblox::Grid::ExtensibleAttributeDef/Searching Extensible Attributes.
# search for DHCP Network View object with name 'netview' my @retrieved_objs = $session->search( object => "Infoblox::DHCP::Network", name => "^netview\$" );
# search for DHCP views with the extensible attribute 'Site' my @retrieved_objs = $session->search( object => "Infoblox::DHCP::View", extensible_attributes => { 'Site' => 'Santa Clara' });
This section describes all the methods that can be used to configure and retrieve the attribute values of a DHCP Network View object
Use this method to retrieve the list of DNS views associated with this network view. This list is read-only and cannot be set.
None
Returns an array reference that contains Infoblox::DNS:View object(s).
# Get associated_dns_views my $associated_dns_views = $network_view->associated_dns_views()
Use this method to set or retrieve cloud API related information for the Infoblox::DHCP::View object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
The valid value is a Infoblox::Grid::CloudAPI::Info object.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
# Get cloud_info my $cloud_info = $network_view->cloud_info(); # Modify cloud_info $network_view->cloud_info($cloud_info_object);
Use this method to set or retrieve a descriptive comment of a DHCP Network View object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Enter a descriptive comment for the network view in string format with a maximum of 256 bytes.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
# Get comment my $comment = $network_view->comment(); # Modify comment $network_view->comment("add a network view");
Use this method to set or retrieve an ordered list of zone primaries that will receive DDNS updates.
A valid value is a reference to an array of Infoblox::DHCP::DDNS objects.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
# Get the attribute value $value = $network_view->ddns_zone_primaries(); # Modify the attribute value $network_view->ddns_zone_primaries([$ddns]);
Use this method to set or retrieve the extensible attributes associated with a DHCP view object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
For valid values for extensible attributes, see Infoblox::Grid::ExtensibleAttributeDef/Extensible Attribute Values.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get extensible attributes my $ref_extensible_attributes = $firstview->extensible_attributes(); #Modify extensible attributes $firstview->extensible_attributes({ 'Site' => 'Santa Clara', 'Administrator' => [ 'Peter', 'Tom' ] });
Use this method to set or retrieve the network view-level external_ddns_primaries value. This specifies the external zone that is updated dynamically. The DHCP server can send dynamic updates to a specified external name server.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
A valid value is an array reference that contains Infoblox::DNS::Nameserver object(s).
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
# Get external_ddns_primaries my $external_ddns_primaries = $network_view->external_ddns_primaries();
# Modify external_ddns_primaries my $nameserver1 = Infoblox::DNS::Nameserver->new( ddns_zone => "ns1.del.com", ipv4addr => "11.11.11.11", ); my $nameserver2 = Infoblox::DNS::Nameserver->new( ddns_zone => "3.2.1.in-addr.arpa", ipv4addr => "22.22.22.22", ); # Nameserver with TSIG security my $nameserver3 = Infoblox::DNS::Nameserver->new( ddns_zone => 'grid_level.local', ipv4addr => '10.102.30.122', TSIGalgorithm => 'HMAC-SHA256', TSIGname => 'kk', TSIGkey => '+NPBBVYjoNC32hfj8vepUw==', );
# Nameserver with GSS-TSIG security my $nameserver4 = Infoblox::DNS::Nameserver->new( ipv4addr => '10.102.30.122', gss_tsig_domain => 'AD-31.LOCAL', ddns_zone => 'grid1_level.local', gss_tsig_dns_principal => 'DNS/w8s232-29.ad-31.local@AD-31.LOCAL' );
$network_view->external_ddns_primaries([$nameserver1, $nameserver2, $nameserver3, $nameserver4]);
# Clear external_ddns_primaries list $network_view->external_ddns_primaries([]);
Use this method to set or retrieve the flag that controls whether the object should be synced to the MGM or not.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Specify 'true' to enable synchronization of the managed Grid with the MGM or 'false' to forbid it. The default value is 'false'.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get mgm_private value my $value = $object->mgm_private();
#Modify mgm_private value $object->mgm_private('true');
modify_vrf_assignment()
This method is used to assign (unassign) a list of the virtual networks (VRFs) to the network view.
VRF membership modification mode: ASSIGN or UNASSIGN.
A valid list (array reference) that contains Infoblox::Grid::Member::Discovery::VRF object(s).
Returns true on success operation, otherwise false.
# Get Network View my $default_view = $session->get(object => 'Infoblox::DHCP::View', name => 'default'); # Get Infoblox::Grid::Member::Discovery::VRF objects my $vrf1 = $session->get(object => 'Infoblox::Grid::Member::Discovery::VRF', name => 'VirtualNetworkMember1'); my $vrf2 = $session->get(object => 'Infoblox::Grid::Member::Discovery::VRF', name => 'VirtualNetworkMember2'); # Assign a list of the VRFs to the Network View my $assign_result = $default_view->modify_vrf_assignment( vrfs => [ $vrf1, $vrf2 ], mode => 'ASSIGN' ); # Unassign VRF from Network View my $unassign_result = $default_view->modify_vrf_assignment( vrfs => [ $vrf2 ], mode => 'UNASSIGN' ); # Check of VRF assignment via Infoblox::Grid::Member::Discovery::VRF object $vrf = $session->get(object => 'Infoblox::Grid::Member::Discovery::VRF', name => 'VirtualNetworkMember1');
# Get current network view name associated with VRF print $vrf->network_view;
Use this method to set or retrieve forward mapping zones which are being served in the grid. Only an authoritative zone can be assigned to this list. All other types of zones will generate an error.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
A valid value is an array reference that contains Infoblox::DNS::Zone object(s).
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
# Get internal_ddns_zones my $internal_ddns_zones = $network_view->internal_ddns_zones();
# Modify internal_ddns_zones my $nameserver1 = Infoblox::DNS::Nameserver->new( name => "ns1.del.com", ipv4addr => "11.11.11.11", ); my $nameserver2 = Infoblox::DNS::Nameserver->new( name => "test", ipv6addr => "2006::b671", ); my $zone1 = Infoblox::DNS::Zone->new( name => "test1.com", primary => [$nameserver1], secondaries => [$nameserver2], ); my $zone2 = Infoblox::DNS::Zone->new( name => "test2.com", ); $network_view->internal_ddns_zones([$zone1, $zone2]);
# Clear internal_ddns_zones list $network_view->internal_ddns_zones([]);
Use this method to specify or retrieve the internal updates DNS view value of a network view. When you enable the appliance to send updates to grid members, you must specify which DNS view receives the updates.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
A valid value is an Infoblox::DNS::View object for internal dynamic updates.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
# Get internal_updates_view my $internal_updates_view = $network_view->internal_updates_view(); # Modify internal_updates_view my $otherview = Infoblox::DNS::View->new( name => "other", ); $network_view->internal_updates_view($otherview);
Use this method to retrieve Microsoft Active Directory users related information. This is a read-only attribute.
None
The valid return value is an Infoblox::Grid::MSServer::AdUser::Data object.
#Get ms_ad_user_data my $ms_ad_user_data = $view->ms_ad_user_data();
Use this method to set or retrieve the name of a DHCP Network View object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
The name of the network view is in string format with a maximum of 64 bytes.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
# Get name my $name = $network_view->name() # Modify name $network_view->name("netview_renamed");
The following sample code demonstrates the different functions that can be applied to an object such as add, search, modify, and remove. This sample also includes error handling for the operations.
#Preparation prior to a DHCP Network View insertion
#PROGRAM STARTS: Include all the modules that will be used use strict; use Infoblox;
#Create a session to the Infoblox appliance
my $session = Infoblox::Session->new( master => "192.168.1.2", username => "admin", password => "infoblox" ); unless ($session) { die("Construct session failed: ", Infoblox::status_code() . ":" . Infoblox::status_detail()); } print "Session created successfully\n";
#Create a DHCP Network View object
my $network_view = Infoblox::DHCP::View->new( name => "netview", );
my $response = $session->add($network_view) or die("Add Network View failed: ", $session->status_code() . ":" . $session->status_detail());
print "Network View added successfully\n";
#Search for a specific Network View
#Search the network view my @retrieved_objs = $session->search( object => "Infoblox::DHCP::View", name => '^netview$', ); my $object = $retrieved_objs[0]; unless ($object) { die("Search Network View failed: ", $session->status_code() . ":" . $session->status_detail()); } print "Search Network found at least 1 matching entry\n";
#Get and modify a Network View attribute
#Get Network View through the session my @retrieved_objs = $session->get( object => "Infoblox::DHCP::View" , name => "netview", );
my $object = $retrieved_objs[0];
unless ($object) { die("Get Network View object failed: ", $session->status_code() . ":" . $session->status_detail()); } print "Get Network View found at least 1 matching entry\n";
#Modify one of the attributes of the specified Network View attribute $object->comment("updated comment"); #Apply the changes
$session->modify($object) or die("Modify Network View attribute failed: ", $session->status_code() . ":" . $session->status_detail());
print "Network View object modified successfully \n";
#Remove a Network View Object
#Get Network View object through the session my @retrieved_objs = $session->get( object => "Infoblox::DHCP::View" , name => "netview", );
my $object = $retrieved_objs[0];
unless ($object) { die("Get Network View object failed: ", $session->status_code() . ":" . $session->status_detail()); }
print "Get Network View object found at least 1 matching entry\n";
#Submit the object for removal $session->remove($object) or die("Remove Network View failed: ", $session->status_code() . ":" . $session->status_detail());
print "Network View removed successfully \n";
####PROGRAM ENDS####
Infoblox Inc. http://www.infoblox.com/
Infoblox::Session, Infoblox::DNS::View, Infoblox::DHCP::Network, Infoblox::DNS::Zone, Infoblox::DNS::Nameserver, Infoblox::Session->get(), Infoblox::Session->search(), Infoblox::Session->add(), Infoblox::Session->remove(), Infoblox::Session->modify(), Infoblox::DHCP::DDNS, Infoblox::Grid::MSServer::AdUser::Data
Copyright (c) 2017 Infoblox Inc.