Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Due to technical limitations, only a small subset of the VCI functionality is available to Perl scripts. Components should be written in one of the other languages.

Notifications

Only emission of notifications on the VCI bus is supported in Perl.

Emit

Emitting notifications is easy. One simply uses the "client->emit" method providing the module name the notification is modeled in, the name of the notification and the body as an object that may be encoded to RFC7951.

#!/usr/bin/perl

use vci;

my $client = vci::Client->new();
$client->emit( "vyatta-routing-v1", "instance-added",
    { 'vyatta-routing-v1:name' => "blue" } );

The body of the notification will be validated against the data-model before emission on the bus occurs. This means that an invalid notification will be discarded. Any bus client may emit any notification and no access control is provided to ensure notifications come from a given source. This is a tradeoff was chosen to allow flexibility for integrating with existing open-source projects in the most efficient way possible (e.g. a script that is called when a given event occurs).

  • No labels