Perl VCI API

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.

The vci perl library is not installed on the system by default but is available as the “libvci-perl” debian package. If one desires this functionality a debian dependency on that package is required for the package to be installed during an image build.

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).