NAME
RackMan::Device - Class for representing a RackObject
SYNOPSIS
use RackMan::Device;
my $obj = RackMan::Device->new({ name => $name, racktables => $rtschema });
DESCRIPTION
This module is a Moose-based class for representing a RackObject.
METHODS
new
Create and return a new object.
Arguments
Arguments are expected as a hashref with the following keys:
id
- ID of the object to retrieve from the databasename
- name of the object to retrieve from the databaseracktables
- (mandatory) aRackTables::Schema
instancerackman
- an optional parent RackMan object
One of name
of id
must be specified.
get_network
Find and return network information about the given IP address. Result is given as a hashref.
Arguments
Result
id
- integer, network id (in IPv4Network)addr
- string, IP addressmask
- integer, network mask lengthname
- string, network namecomment
- string, comment or description, if any
ATTRIBUTES
attributes
Hashref, contains the attributes for this RackObject
default_ipv4_gateway
Hashref, contains information about the default IPv4 gateway:
addr
- string, IPv4 address in dot-quad formiface
- string, interface namemasklen
- integer, network mask lengthnetwork
- string, network addressnetname
- string, network nameobject_id
- integer, ID of the peer RackObjecttype
- string, type of the address (regular
,shared
,virtual
,router
)
explicit_tags
Arrayref, contains the list of explicit tags for this RackObject
implicit_tags
Arrayref, contains the list of implicit tags for this RackObject
ipv4addrs
Arrayref, contains the list of IPv4 addresses for this RackObject, each address being a hashref with the following keys:
type
- string, type of the address (regular
,shared
,virtual
,router
)iface
- string, interface nameaddr
- string, IP address
ipv6addrs
Arrayref, contains the list of IPv6 addresses for this RackObject, each address being a hashref with the following keys:
type
- string, type of the address (regular
,shared
,virtual
,router
)iface
- string, interface nameaddr
- string, IP address
object_id
Integer, RackObject's ID
object_name
String, RackObject's name
object_asset_no
String, RackObject's asset tag
object_has_problem
Boolean
object_comment
String, RackObject's comment
object_type
String, RackObject's type
ports
Arrayref, contains the list of ports associated to this RackObject, each port being a hashref with the following keys:
name
- string, port namel2address
- string, port L2 addressl2address_text
- string, port L2 address in colon-separated formatiif_id
- integer, inner interface IDiif_name
- string, inner interface nameoif_id
- integer, outter interface IDoif_name
- string, outter interface namepeer_port_id
- integer, peer port IDpeer_port_name
- string, peer port namepeer_object_id
- integer, peer object IDpeer_object_name
- string, peer object name
parents
Arrayref, contains the object ID of the parents
physical_interfaces
List of the IPv4 addresses of the device which are not associated with a virtual interface, as given by the [general]/virtual_interfaces config parameter. See "CONFIGURATION" in rack for more details.
rack
Hashref, information about the rack containing the device
id
- integer, rack IDname
- string, rack namecomment
- text, rack commentrow_id
- integer, rack row IDrow_name
- string, rack row name
rackman
An optional parent RackMan object, as given when this object was created
rackobject
The underlying RackObject corresponding to the device
regular_mac_addrs
List of the regular MAC addresses of the device
regular_ipv4addrs
List of the regular IPv4 addresses of the device
regular_ipv6addrs
List of the regular IPv6 addresses of the device
tag_tree
Hashref, contains the tree of tags, with the explicit tags at first level
SEE ALSO
AUTHOR
Sebastien Aperghis-Tramoni (sebastien@aperghis.net)