Infoblox::Grid::SNMP::User - Grid SNMP User object
The Grid SNMP User object is used to set, get, search, modify, or remove an SNMPv3 user. An SNMPv3 user is a managment system that sends queries and receives traps from the appliance.
#Constructor for a Grid SNMP User object my $snmp_user = Infoblox::Grid::SNMP::User->new( name => $string, #Required auth_protocol => "none"| "md5" | "sha", #Required privacy_protocol => "none"| "des" | "aes", #Required auth_password => $string, #Optional. Required for MD5/SHA authentication comment => $string, #Optional / Default is undefined disable => "true" | "false", #Optional / Default is "false" privacy_password => $string, #Optional. Required for MD5/SHA authentication extattrs => { $string => $extattr, ... }, #Optional / Default is undefined );
This section describes all the methods in Infoblox::Session that you can apply to a Grid SNMP User object.
Use this method to retrieve existing objects from the Infoblox appliance. See Infoblox::Session->get() for parameters and return values.
Apply the following attributes to get a Grid SNMP User object:
name - user name in string format comment - comment string extattrs - Optional. A hash reference containing extensible attributes.
my @retrieved_objs = $session->get( object => "Infoblox::Grid::SNMP::User", name => "testuser" );
Use this method to modify objects in the Infoblox appliance. See Infoblox::Session->modify() for parameters and return values.
# Use this method to modify the comment $snmp_user->comment("This is a modified comment"); # Submit modification my $response = $session->modify( $snmp_user );
Use this method to search for Grid SNMP User objects in the Infoblox appliance. See Infoblox::Session->search() for parameters and return values.
Apply the following attributes to search for a Grid SNMP User object:
name - user name (regular expression) comment - comment string (regular expression) extattrs - Optional. A hash reference containing extensible attributes.
# Search for all Grid SNMP User objects that start with "test" my @retrieved_objs = $session->search( object => "Infoblox::Grid::SNMP::User", name => "test.*", );
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 object, and then submit it for removal.
# Get Grid SNMP User objects with the same starting name my @retrieved_objs = $session->get( object => "Infoblox::Grid::SNMP::User", name => "testuser" ); # find the desired object from the retrieved list. my $desired_user = $retrieved_objs[0]; # Submit for removal my $response = $session->remove( $desired_user );
This section describes all the methods that you can use to configure and retrieve the attribute values of an SNMPv3 user.
Use this method to provide an authentication password for the user. This is a write-only attribute.
Authentication password of the user in string format.
If a parameter is specified, the method returns true when the modification succeeds, and returns false when the operation fails.
#Set the password $snmp_user->auth_password("mysecret");
Use this method to specify the authentication protocol of the user.
Possible values for the authentication protocol are:
none md5 sha
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 auth_protocol my $proto = $snmp_user->auth_protocol(); #Set the protocol $snmp_user->auth_protocol("md5");
Use this method to provide a comment for the SNMPv3 User object.
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 = $snmp_user->comment(); #Set the comment $snmp_user->comment("This is a sample comment");
Use this method to configure or retrieve the "disable" flag.
The default value is false; that is, the user is enabled.
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 flag my $disabled = $snmp_user->disable(); #Set the disable flag $snmp_user->disable("true");
Use this method to retrieve the SNMP engine ID.
This field is read-only.
None
When called without parameters, the method returns the attribute value. Calling this method with a parameter results in an error.
#Get engine_id my $engine_id = $snmp_user->engine_id();
Use this method to set or retrieve the extensible attributes associated with a SNMP user 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 = $snmp_user->extattrs(); #Modify extattrs $snmp_user->extattrs({ 'Site' => $extattr1, 'Administrator' => $extattr2 });
Use this method to set or retrieve the name of an SNMPv3 user.
Text with the name of the user.
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 = $snmp_user->name(); #Modify name $snmp_user->name("test_user");
Use this method to provide a password for the privacy protocol. This is a write-only attribute.
Password in string format.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
#Set the password $snmp_user->privacy_password("mysecret");
Use this method to specify encryption protocol for the SNMP packets.
Possible values for the encryption protocol are:
none des aes
The values are case insensitive.
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 privacy_protocol my $proto = $snmp_user->privacy_protocol(); #Set the protocol $snmp_user->privacy_protocol("aes");
Infoblox Inc. http://www.infoblox.com/
Infoblox::Grid::SNMP::TrapReceiver,Infoblox::Session, Infoblox::Session->get(), Infoblox::Session->modify()
Copyright (c) 2017 Infoblox Inc.