SIAM::Object - the base class for all SIAM object (including the root).
$new_object = new SIAM::Object($driver, $id)
Instantiates a new object. The method expects a driver object and an Object ID.
Expects the object class and ID. Returns an object retrieved from the driver.
my $list = $object->get_contained_objects($classname, $options);
Fetches the list of contained objects of a given class. Returns arrayref of SIAM::Object instances. This is the preferred method of instantiating new objects instead of manually calling the new method.
SIAM::Object
new
It is assumed that the class name is already known to Perl, and the corresponding module was loaded with use or require.
use
require
Without the options, the method retrieves all available objects. Options may define a filter criteria as follows:
my $list = $siam->get_contained_objects('SIAM::Contract', { 'match_attribute' => [ 'siam.object.access_scope_id', ['SCOPEID01', 'SCOPEID02'] ] });
Currently only one filter condition is supported.
my $list = $siam->get_objects_by_attribute( 'SIAM::Device', 'siam.device.inventory_id', $id);
The method takes 3 arguments: class name, attribute name, and attribute value. It returns an arrayref of objects matching the attribute. Empty arrayref is returned if no objects match the criteria.
my $list = $object->deep_walk_contained_objects($classname);
The method walks down the tree of contained objects and retrieves a list of all found objects. It returns an array reference with all found objects;
Returns a value of siam.object.id attribute
siam.object.id
Returns the value of siam.object.class attribute.
siam.object.class
$val = $contract->attr('siam.contract.inventory_id');
Returns a value of an attribute.
Returns a hashref with copies of all object attributes.
Returns the value of siam.object.complete.
siam.object.complete
$val = $contract->computable('siam.contract.content_md5hash');
Returns a value of a computable.
$dataelement->set_condition('torrus.import_successful', 1);
The SIAM client application may use this method to send a (key, value) pair to the driver and tell it about some state update. The condition names and accepted values are defined by the driver and are driver-specific. This is a one-way communication, and there is no way to read the condition value.
Returns true if the object is a root.
Returns true if the object is a predefined object (the one with the ID starting with SIAM.)
Returns the object that contains this object. Returns undef if container is the root object.
Returns arrayref with contained SIAM::Report objects
Takes a driver object as an argument and verifies if it implements all required methods. returns true if all required methods are present. It issues error messages in case of missing methods.
Sets a log manager for SIAM objects. Note that it does not set the log manager for the driver. The default log manager is a Log::Handler object with STDERR output of warnings and errors. The method expects one argument, an object which implements the following methods:
Log::Handler
debug
info
warn
error
Classes that suit as log managers: Log::Handler, Log::Log4perl, ...
Log::Log4perl
Returns the current logger object.
These methods dispatch a message to the log manager. If the log manager is undefined, all except debug() print the message to STDERR with a preceeding timestamp.
debug()
Returns the driver object
Prints a message to STDERR with a preceeding timestamp
To install SIAM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SIAM
CPAN shell
perl -MCPAN -e shell install SIAM
For more information on module installation, please visit the detailed CPAN module installation guide.