-
-
Save xiangchu0/bc4d9a9358a7c0f1e014024b92a9aa34 to your computer and use it in GitHub Desktop.
Revisions
-
hiroyuki-sato revised this gist
Nov 14, 2014 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,9 +8,9 @@ my @c = $config->listNodes(); #=begin #foreach my $i ( @c ){ # print $i,"\n"; #} #=end print $config->returnValue("advertise-interval"),"\n"; -
hiroyuki-sato revised this gist
Nov 14, 2014 . 1 changed file with 16 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ #!/usr/bin/perl -w use lib '/opt/vyatta/share/perl5'; use Vyatta::Config; $config = new Vyatta::Config; $config->setLevel("interfaces ethernet eth0 vrrp vrrp-group 100"); my @c = $config->listNodes(); #=begin foreach my $i ( @c ){ print $i,"\n"; } #=end print $config->returnValue("advertise-interval"),"\n"; -
hiroyuki-sato renamed this gist
Nov 14, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
hiroyuki-sato revised this gist
Nov 14, 2014 . No changes.There are no files selected for viewing
-
hiroyuki-sato revised this gist
Nov 14, 2014 . 1 changed file with 14 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ #!/usr/bin/perl -w use lib '/opt/vyatta/share/perl5'; use Vyatta::Config; $config = new Vyatta::Config; $config->setLevel("interfaces ethernet eth0 vrrp vrrp-group 100"); my @c = $config->listNodes(); foreach my $i ( @c ){ print $i,"\n"; } print $config->returnValue("advertise-interval"),"\n"; -
hiroyuki-sato revised this gist
Nov 14, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -79,7 +79,7 @@ So I enabled =begin and =end part. I expected it output advertise-interval value. But none of output. vyos@foo# perl d.pl [edit] ### show version -
hiroyuki-sato revised this gist
Nov 14, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ ### Goal I would like to get value of **advertise-interval** in vrrp-group 100. And I would like to use Perl API. show config -
hiroyuki-sato created this gist
Nov 14, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,94 @@ ### Goal I would like to get value of "advertise-interval" in vrrp-group 100. And I would like to use Perl API. show config interfaces { ethernet eth0 { address dhcp duplex auto hw-id 00:0c:29:8f:10:55 smp_affinity auto speed auto vrrp { vrrp-group 100 { advertise-interval 1 description test preempt true virtual-address 10.10.10.0/24 } } ### Sample script1. Work fine as I expected. But I don't need foreach part. #!/usr/bin/perl -w use lib '/opt/vyatta/share/perl5'; use Vyatta::Config; $config = new Vyatta::Config; $config->setLevel("interfaces ethernet eth0 vrrp vrrp-group 100"); my @c = $config->listNodes(); #=begin foreach my $i ( @c ){ print $i,"\n"; } #=end print $config->returnValue("advertise-interval"),"\n"; Execution result. vyos@foo# perl d.pl advertise-interval description preempt virtual-address 1 [edit] ### Sample script 2 So I enabled =begin and =end part. use lib '/opt/vyatta/share/perl5'; use Vyatta::Config; $config = new Vyatta::Config; $config->setLevel("interfaces ethernet eth0 vrrp vrrp-group 100"); my @c = $config->listNodes(); =begin foreach my $i ( @c ){ print $i,"\n"; } =end print $config->returnValue("advertise-interval"),"\n"; I expected it output advertise-interval value. But none of output. vyos@foo# vi d.pl [edit] ### show version vyos@foo:~$ show version Version: VyOS 1.1.0 Description: VyOS 1.1.0 (helium) Copyright: 2014 VyOS maintainers and contributors Built by: [email protected] Built on: Thu Oct 9 22:27:26 UTC 2014 Build ID: 1410092227-af6433f