address()
ad_sites()
ad_user()
comment()
disable()
login()
password()
network_view()
dns_view()
managing_member()
read_only()
synchronization_interval()
logging_mode()
version()
is_AD()
Infoblox::Grid::MSServer - Microsoft (r) Grid Server object.
A grid Microsoft DNS Server object is a single Microsoft DNS server that is managed by a grid member.
my $ms_member = Infoblox::Grid::MSServer->new( address => $ip_or_fqdn, #Required ad_sites => $ad_sites, #Optional ad_user => $ad_user, #Optional comment => $string, #Optional / Default value is empty disable => "true" | "false" #Optional / Default value is "false" extattrs => { $string => $extattr, ... }, #Optional / Default is undefined extensible_attributes => { $string => $string | $num, $string => [ $string | $num, ... ], ... }, #Optional / Default is undefined login => $string, #Required password => $string, #Optional / Default value is empty managing_member => $Member, #Optional / Default value is empty read_only => "true" | "false", #Optional / Default value is "true" synchronization_interval => $num, #Optional / Default value is 2 logging_mode => "minimum" | "normal" | "advanced" | "full", #Optional / Default value is "normal" network_view => $NetworkView, #Optional / Default is "default" network view dns_view => $DnsView, #Optional / Default is "default" view log_destination => "SYSLOG" | "MSLOG", #Optional / Default is undefined override_log_destination => "true" | "false", #Optional / Default value is "false" max_connection => $num, #Optional / Default is undefined override_max_connection => "true" | "false", #Optional / Default value is "false" rpc_timeout => $num, #Optional / Default is undefined override_rpc_timeout => "true" | "false", #Optional / Default value is "false" );
You cannot set both extattrs and extensible_attributes attributes at the same time.
The following apply to zones assigned to Microsoft DNS servers:
The following methods have no effect on a Microsoft DNS server that is assigned to a zone:
allow_transfer()
Values set or retrieved using the member that manages the Microsoft DNS server apply only to that grid member if it is assigned to a zone.
The following methods apply to any grid member or Microsoft DNS server assigned to the zone:
The following objects cannot be used with a Microsoft DNS Server object or with a Zone object whose primary server is a Microsoft DNS Server object:
The following methods can be applied to DNS zones managed by a Microsoft DNS server:
The following methods have no effect on any zone managed by a Microsoft DNS server:
dnssec_ksk_algorithm()
dnssec_ksk_rollover_interval()
dnssec_ksk_size()
dnssec_zsk_algorithm()
dnssec_zsk_rollover_interval()
dnssec_zsk_size()
This section describes all the methods in an Infoblox::Session module that you can apply to a grid member object.
Use this method to add an object to the Infoblox appliance. See Infoblox::Session->add() for parameters and return values.
#Construct an object my $grid_msserver = Infoblox::Grid::MSServer->new( address => '10.0.0.1', comment => 'This is an MS DNS Server', disable => 'true', extensible_attributes => { Site => 'Main Office'}, login => 'user', password => 'password', managing_member => 'managing.member.com', read_only => 'false', synchronization_interval => 5, logging_mode => 'minimum', ); #Submit for addition my $response = $session->add( $grid_msserver );
Use this method to retrieve all the matching objects from the Infoblox appliance. See Infoblox::Session->get() for parameters and return values.
Apply the following attributes to get a specific grid member object:
address - Optional. A member address or name in FQDN format. comment - Optional. A comment in string format read_only - Optional. A boolean value managing_member - Optional. A name in FQDN format. network_view - Optional. The network view served by the member. dns_view - Optional. The DNS view served by the member. extattrs - Optional. A hash reference containing extensible attributes. extensible_attributes - Optional. A hash reference containing extensible attributes.
my @retrieved_objs = $session->get( object => "Infoblox::Grid::MSServer", address => "10.0.0.1");
Use this method to modify an object in the Infoblox appliance. See Infoblox::Session->modify() for parameters and return values.
# Use this method to modify the comment of a Microsoft DNS server managed by the grid. $grid_msserver->comment("This is modified object"); # Submit modification my $response = $session->modify( $grid_msserver );
Use this method to remove an object from the Infoblox appliance. See Infoblox::Session->remove() for parameters and return values.
To remove a specific object, first use get()
or search()
to retrieve the specific object, and then submit this object for removal.
#Get the objects with the same name my @retrieved_objs = $session->get( object => "Infoblox::Grid::MSServer", name => "10.0.0.1"); #Find the desired object from the retrieved list. my $desired_gridmsserver = $retrieved_objs[0]; # Submit for removal my $response = $session->remove( $desired_gridmsserver );
Use this method to search for Microsoft DNS Server objects in the Infoblox appliance. See Infoblox::Session->search() for parameters and return values.
Apply the following attributes to search for a Microsoft DNS Server object
address - Optional. A member address or name in FQDN format (regular expression). comment - Optional. A comment in string format (regular expression). read_only - Optional. A boolean value managing_member - Optional. The FQDN of the grid member that manages the Microsoft DNS server? network_view - Optional. The network view served by the member. dns_view - Optional. The DNS view served by the member. extattrs - Optional. A hash reference containing extensible attributes. extensible_attributes - Optional. A hash reference that contains extensible attributes.
For more information about searching extensible attributes, see Infoblox::Grid::ExtensibleAttributeDef/Searching Extensible Attributes.
# search for all matching grid msserver objects my @retrieved_objs = $session->search( object => "Infoblox::Grid::MSServer", extensible_attributes => { Site => 'Local'}, );
This section describes all the methods that you can use to configure and retrieve the attribute values of a Microsoft DNS server.
address()
Retrieve or set the IP address or FQDN of the Microsoft DNS server.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
The Microsoft DNS server name in FQDN format or IPV4 format
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 address my $address = $msserver->address();
Use this method to retrieve the Active Directory domain name of the Microsoft Server. This is a read-only attribute.
Omit the parameter to retrieve the attribute value.
None
The method returns the attribute value.
#Get ad_domin value my $ad_domain = $object->ad_domain();
ad_sites()
Use this method to set or retrieve structure containing Active Directory Sites information.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
The valid value is an Infoblox::Grid::MSServer::AdSites 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 ad_sites value my $ad_sites = $msserver->ad_sites();
#Modify ad_sites value my $res = $msserver->ad_sites($ad_sites);
ad_user()
Use this method to set or retrieve the object that contains Active Directory User synchronization information.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
The valid value is an Infoblox::Grid::MSServer::AdUser 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 ad_user value my $ad_user = $msserver->ad_user();
#Modify ad_user value my $res = $msserver->ad_user($ad_user);
comment()
Retrieve or set a user-defined string related to this Microsoft DNS server.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Desired comment 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 = $msserver->comment(); #Modify comment $msserver->comment("Modifying the MS DNS server comment");
disable()
Retrieve or set the disable()
flag of this Microsoft DNS server.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Specify "true" to set the disable flag or "false" to deactivate/unset 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 disable my $disable = $msserver->disable(); #Modify disable $msserver->disable("true");
login()
Retrieve or set the login name that the grid member uses to connect to the Microsoft DNS server.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
When setting a value that requires a domain name, prepend the domain information followed by a backslash to the username: "domain\username".
The valid value is a string that contains the login name.
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 login my $login = $msserver->login(); #Modify login $msserver->login("newuser");
password()
Set the password that the grid member uses to connect to the Microsoft DNS server. This field is used only if the login field for this member is defined. This is a write-only attribute.
This field can not be retrieved.
The valid value is a string that contains the password.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
#Set the password $msserver->password("iG&ojG97Y");
network_view()
Retrieve or set the name of the network view associated with this member.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
The valid value is a string that contains the name of the network view associated with this member.
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 network_view my $network_view = $msserver->network_view(); #Modify network_view $msserver->network_view("external");
dns_view()
Retrieve or set the name of the DNS view that applies to this Microsoft DNS server. If this field is set to undefined, the default view is used. The DNS view must be set to a DNS view linked to the Microsoft DNS server network view.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
The valid value is a string that contains the name of the DNS view associated with the Microsoft DNS server
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 dns_view my $dns_view = $msserver->dns_view(); #Modify dns_view $msserver->dns_view("external");
Use this method to direct the logging of synchronization messages to the syslog or mslog.
Setting this method to a defined value implicitly sets the override_log_destination method to "true". Setting the parameter to undefined causes the appliance to use the grid default and automatically resets the override_log_destination method to "false".
Note that when log_destination is set to a defined value and override_log_destination is set to "false", the last operation takes precedence. Thus the sequence $object->log_destination("MSLOG"); $object->override_log_destination("false"); will set override_log_destination to "false", and the sequence $object->override_log_destination("false"); $object->log_destination("MSLOG"); will result in override_log_destination="true".
Valid values are "SYSLOG" and "MSLOG".
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 log_destination value my $log_destination = $msserver->log_destination(); #Modify log_destination value $msserver->log_destination("SYSLOG");
Use this method to set or retrieve the maximum number of connections to a Microsoft server.
Setting this method to a defined value implicitly sets the override_max_connection method to "true". Setting the parameter to undefined causes the appliance to use the grid default and automatically resets the override_max_connection method to "false".
Note that when max_connection is set to a defined value and override_max_connection is set to "false", the last operation takes precedence. Thus the sequence $object->max_connection(20); $object->override_max_connection("false"); will set override_max_connection to "false", and the sequence $object->override_max_connection("false"); $object->max_connection(20); will result in override_max_connection="true".
Valid values are integers between 2 and 40 inclusive.
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 max_connection value my $max_connection = $msserver->max_connection(); #Modify max_connection value $msserver->max_connection(20);
managing_member()
Retrieve or set the grid member responsible for the synchronization of this Microsoft DNS server.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
The valid value is a string that contains the name of the grid member.
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 managing_member my $managing_member = $msserver->managing_member(); #Modify managing_member $msserver->managing_member("example.member.com");
The override_log_destination attribute controls whether the log_destination method values of the Microsoft Server are used, instead of the Grid default.
The override_log_destination attribute can be specified explicitly. It is also set implicitly when log_destination is set to a defined value.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Set the parameter to "true" to override the Grid-level setting for log_destination. Set the parameter to "false" to inherit the Grid-level setting for log_destination. 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 override_log_destination my $override_log_destination = $msserver->override_log_destination(); #Modify override_log_destination $msserver->override_log_destination("true");
The override_max_connection attribute controls whether the max_connection method values of the Microsoft Server are used, instead of the Grid default.
The override_max_connection attribute can be specified explicitly. It is also set implicitly when max_connection is set to a defined value.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Set the parameter to "true" to override the grid-level setting for max_connection. Set the parameter to "false" to inherit the grid-level setting for max_connection. 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 override_max_connection my $override_max_connection = $msserver->override_max_connection(); #Modify override_max_connection $msserver->override_max_connection("true");
The override_rpc_timeout attribute controls whether the rpc_timeout method values of the Microsoft Server are used, instead of the Grid default.
The override_rpc_timeout attribute can be specified explicitly. It is also set implicitly when rpc_timeout is set to a defined value.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Set the parameter to "true" to override the grid-level setting for rpc_timeout. Set the parameter to "false" to inherit the grid-level setting for rpc_timeout. 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 override_rpc_timeout my $override_rpc_timeout = $msserver->override_rpc_timeout(); #Modify override_rpc_timeout $msserver->override_rpc_timeout("true");
read_only()
Retrieve or set the synchronization mode of this Microsoft DNS server.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Setting the read_only mode to true synchronizes all data from the Microsoft DNS server to the grid and forbids any change on the grid that could be synchronized to the Microsoft DNS server.
Specify "true" to set the disable flag or "false" to deactivate/unset it. The default value is "true".
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 read_only my $read_only = $msserver->read_only(); #Modify read_only $msserver->read_only("false");
Use this method to retrieve the Active Directory root domain name of the Microsoft Server. This is a read-only attribute.
Omit the parameter to retrieve the attribute value.
None
The method returns the attribute value.
#Get ad_domin value my $root_ad_domain = $object->root_ad_domain();
Use this method to set or retrieve the timeout value in seconds for RPC connections to Microsoft Server.
Setting this method to a defined value implicitly sets the override_rpc_timeout method to "true". Setting the parameter to undefined causes the appliance to use the grid default and automatically resets the override_rpc_timeout method to "false".
Note that when rpc_timeout is set to a defined value and override_rpc_timeout is set to "false", the last operation takes precedence. Thus the sequence $object->rpc_timeout(10); $object->override_rpc_timeout("false"); will set override_rpc_timeout to "false", and the sequence $object->override_rpc_timeout("false"); $object->rpc_timeout(10); will result in override_rpc_timeout="true".
Valid values are integers between 0 and 65535 inclusive.
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 rpc_timeout value my $rpc_timeout = $msserver->rpc_timeout(); #Modify rpc_timeout value $msserver->rpc_timeout(10);
synchronization_interval()
Retrieve or set the synchronization interval of this Microsoft DNS server.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
The synchronization interval controls how often data on the Microsoft DNS server is synchronized with the grid. The value is specified in minutes.
The valid value is a number that specifies the synchronization interval in minutes. The default value is 2 minutes.
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 synchronization_interval my $synchronization_interval = $msserver->synchronization_interval(); #Modify synchronization_interval $msserver->synchronization_interval(5);
logging_mode()
Retrieve or set the synchronization logging verbosity of this Microsoft DNS server.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
The valid value is "minimum", "normal", "advanced", or "full". The default value is "normal".
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 logging_mode my $logging_mode = $msserver->logging_mode(); #Modify logging_mode $msserver->logging_mode("advanced");
version()
Retrieve the version of this Microsoft DNS server. The returned version is a string, such as "Microsoft Windows Server 2003".
The method returns the attribute value.
#Get version my $version = $msserver->version();
is_AD()
Retrieve the Active Directory flag of the Microsoft DNS server. The method returns "true" if the Microsoft DNS server has Active Directory capabilities or "false" if it does not.
The method returns the attribute value.
#Get is_AD my $is_AD = $msserver->is_AD();
Use this method to set or retrieve the extensible attributes associated with a Microsoft DNS server object.
Valid value is a hash reference containing the names of extensible attributes and their associated values ( Infoblox::Grid::Extattr 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 extattrs my $ref_extattrs = $msserver->extattrs(); #Modify extattrs $msserver->extattrs({ 'Site' => $extattr1, 'Administrator' => $extattr2 });
Use this method to set or retrieve the extensible attributes associated with a Microsoft DNS server.
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 = $msserver->extensible_attributes(); #Modify extensible attributes $msserver->extensible_attributes({ 'Site' => 'Santa Clara', 'Administrator' => [ 'Peter', 'Tom' ] });
The following sample code demonstrates the different functions that can be applied to an object such as add, get, modify, search and remove. This sample also includes error handling for the operations.
#Preparation prior to getting and modifying a grid msserver object
use strict; use Infoblox;
#refers to Infoblox Appliance IP address my $host_ip = "192.168.1.2";
#Create a session to the Infoblox appliance
my $session = Infoblox::Session->new( master => $host_ip, username => "admin", password => "infoblox" ); unless ($session) { die("Construct session failed: ", Infoblox::status_code() . ":" . Infoblox::status_detail()); } print "Session created successfully\n";
#Create a grid member object
my $grid_member = Infoblox::Grid::Member->new( name => "hostname.com", ipv4addr => "3.0.0.2", mask => "255.0.0.0", gateway => "3.0.0.1", comment => "Script Generated" ); unless ($grid_member) { die("Construct grid member object failed: ", Infoblox::status_code() . ":" . Infoblox::status_detail()); } print "Grid member object created successfully\n";
#Adding the member object to appliance through session my $response = $session->add( $grid_member );
unless ($response) { die("Add grid member failed: ", $session->status_code() . ":" . $session->status_detail()); } print"Grid member added successfully \n";
my $msserver = Infoblox::Grid::MSServer->new( address => '10.0.0.1', comment => 'basic member', disable => 'true', extensible_attributes => { Site => 'Local'}, login => 'user', password => 'password', managing_member => 'hostname.com', read_only => 'false', synchronization_interval => 5, logging_mode => 'minimum', );
unless ($msserver) { die("Construct grid MS DNS server object failed: ", Infoblox::status_code() . ":" . Infoblox::status_detail()); } print "Grid MS DNS server object created successfully\n";
#Adding the member object to appliance through session $response = $session->add( $msserver );
unless ($response) { die("Add grid MS DNS server failed: ", $session->status_code() . ":" . $session->status_detail()); } print"Grid MS DNS server added successfully \n";
#Search for a grid Microsoft DNS server object
my @retrieved_objs = $session->search( object => "Infoblox::Grid::MSServer", comment => "basic.*"); my $object = $retrieved_objs[0];
unless ($object) { die("Search grid MS DNS server object failed: ", $session->status_code() . ":" . $session->status_detail()); } print "Search grid MS DNS server object found at least 1 matching entry\n";
#Get and modify the msserver object
#Get grid member through session my @retrieved_objs = $session->get( object => "Infoblox::Grid::MSServer", address => "10.0.0.1" ); my $msserver = $retrieved_objs[0];
unless ($msserver) { die("Get grid MS DNS server object failed: ", $session->status_code() . ":" . $session->status_detail()); } print"Get grid MS DNS server successful \n";
# Modify one of the attributes of the selected Microsoft DNS server.
$msserver->comment("Modified MS DNS server object");
#Applying the changes $session->modify($msserver) or die("Modify grid MS DNS server failed", $session->status_code() . ":" . $session->status_detail()); print"Grid MS DNS server modified successfully \n";
#Remove the created objects object
#Get grid member through session my @retrieved_objs = $session->get( object => "Infoblox::Grid::MSServer", address => "10.0.0.1" ); my $desired_msserver = $retrieved_objs[0];
unless ($desired_msserver) { die("Get grid MS DNS server object failed: ", $session->status_code() . ":" . $session->status_detail()); } print"Get grid member successful \n";
#Submit the object for removal $session->remove( $desired_msserver ) or die("Remove grid MS DNS server failed", $session->status_code() . ":" . $session->status_detail()); print"Grid MS DNS server removed successfully \n";
#Get grid member through session my @retrieved_objs = $session->get( object => "Infoblox::Grid::Member", name => "hostname.com" ); my $desired_grid_member = $retrieved_objs[0];
unless ($desired_grid_member) { die("Get grid member object failed: ", $session->status_code() . ":" . $session->status_detail()); } print"Get grid member successful \n";
#Submit the object for removal $session->remove( $desired_grid_member ) or die("Remove grid member failed", $session->status_code() . ":" . $session->status_detail()); print"Grid member removed successfully \n";
####PROGRAM ENDS####
Infoblox Inc. http://www.infoblox.com/
Infoblox::Session, Infoblox::Grid::MSServer::AdSites, Infoblox::Grid::MSServer::AdUser.
Copyright (c) 2017 Infoblox Inc.