Next Topic

Previous Topic

Book Contents

[InsertResult]

$return_value  =  $obj->[InsertResult](
deviceName=>$device_name,
deviceAddr=>"$device_fqdn_or_ip",
dateTime=>time,
testName=>'[ExtTest]',
result=>$value_to_insert,
extraInfo=>$additional_info);
Refer to [External Data Feed (EDF) Reference on page 51|file://share/Documents/Documentation/FrameMaker-Docs/TechPubs55/Dev%20Guide/HTML/Traverse%20Developers%20Guide-4-1.html#wp1083882] for explanations of the parameters and valid values.

Example: Connect, Log In, Insert Test Result, Log Out

The following example creates a connection to localhost (default port), logs in, inserts a result for a test named sample_test on the device with IP address 192.168.200.50 and name my_server into the DGE database, and logs out.

Note: You should use a test name, device address, and device name appropriate to your installation. You may also need to change the Login user and password if they have been changed from the defaults.

use Zyrion qw([ExternalData]);
my $obj = new Zyrion::[ExternalData](Host=>"localhost");
my $return_value = $obj->
Login(User=>"edfuser",Password=>"fixme") \|\|
die "ERROR: ", $obj->[GetErrorMsg], "\n";
$obj->[InsertResult](deviceName=>"my_server",
deviceAddr=>"192.168.200.50",
dateTime=>time,
testName=>'sample_test',
result=>100,
extraInfo=>'needs immediate action') \|\|
print "ERROR: ", $obj->[GetErrorMsg], "\n";
$obj->Logout;

Note that the optional parameter testSerial was not provided, so the server will use deviceName, deviceAddr and testName to uniquely identify the test.