tatus qw(:constants);
use YAML;
use LWP;
use HTTP::Status qw(:constants :is status_message);
use JSON -convert_blessed_universally;
use XML::Parser;
use Carp::Assert;
=head1 METHODS
=cut
# Constru
s_json>
# Returns pretty-printed JSON string representing BSC object.
=cut
sub as_json {
my $self = shift;
my $json = new JSON->canonical->allow_blessed->convert_blessed;
return $json-
p->code == HTTP_OK) {
if ($resp->content =~ /\"nodes\"/) {
my $nodes = decode_json($resp->content)->{nodes}->{node};
if (! $nodes) {
$status->code($BSC_
er
controlled by a Brocade::BSC controller.
=cut
use strict;
use warnings;
use Data::Walk;
use JSON -convert_blessed_universally;
package Brocade::BSC::Node::NC::Vrouter::OvpnIf;
use parent qw(Cl
===
#
=item B<as_json>
# Returns : OpenVPN interface configuration as formatted JSON string.
=cut ===================================================================
sub as_json {
my $self =
shift;
my $json = new JSON->canonical->allow_blessed->convert_blessed;
return $json->pretty->encode($self);
}
# Subroutine ===========================================================
#
= @_) {
$self->{vlan_id}->{vlan_id} = $vid;
$self->{vlan_id}->{vlan_id_present} = JSON::true;
}
return $self->{vlan_id}->{vlan_id};
}
sub pcp {
my ($self, $pcp) = @_;
$
gexp::Common; # balanced paren matching
use HTTP::Status qw(:constants :is status_message);
use JSON -convert_blessed_universally;
=head1 METHODS
=cut
# Constructor ==============================
s = $1) =~ s/flow-node-inventory:flow-feature-capability-//g);
$feature_info_ref = decode_json($features);
$status->code($BSC_OK);
}
else {
$status->http_err($resp);
my $node_connector_json = ($resp->content =~ /$RE{balanced}{-keep}{-begin => "\"node-connector\":\["}{-end => "]"}/ && $1);
@port_list = ($node_connector_json =~ /\"flow-node-inventory
F::FlowEntry;
use strict;
use warnings;
use Brocade::BSC::Node::OF::Match;
use Data::Walk;
use JSON -convert_blessed_universally;
# Package =======================================================
new Brocade::BSC::Node::OF::FlowEntry::Instructions;
bless ($self, $class);
# if ($params{json}) {
# die "foobar\n";
# }
if ($params{href}) {
while (my ($key, $value) =
<as_json>
# Returns : FlowEntry as formatted JSON string.
=cut ===================================================================
sub as_json {
my $self = shift;
my $json = new JSON->ca
er
controlled by a Brocade::BSC controller.
=cut
use strict;
use warnings;
use Data::Walk;
use JSON -convert_blessed_universally;
package Brocade::BSC::Node::NC::Vrouter::StaticRoute;
use parent
_json>
# Returns : static route configuration as formatted JSON string.
=cut ===================================================================
sub as_json {
my $self = shift;
my $json
= new JSON->canonical->allow_blessed->convert_blessed;
return $json->pretty->encode($self);
}
# Subroutine ===========================================================
# _strip_undef:
er controlled
by a Brocade::BSC controller.
=cut
use strict;
use warnings;
use Data::Walk;
use JSON -convert_blessed_universally;
package Brocade::BSC::Node::NC::Vrouter::VPN;
use parent qw(Clone
m B<as_json>
# Returns : VPN as formatted JSON string.
=cut ===================================================================
sub as_json {
my $self = shift;
my $json = new JSON->canon
ical->allow_blessed->convert_blessed;
return $json->pretty->encode($self);
}
# Subroutine ===========================================================
# _strip_undef: remove all keys
strict;
use warnings;
use Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(Firewall);
use JSON -convert_blessed_universally;
#-----------------------------------------------------------------
====
#
=item B<as_json>
# Returns : pretty-printed JSON string representing Firewall object.
=cut ===================================================================
sub as_json {
my $self =
shift;
my $json = new JSON->canonical->allow_blessed->convert_blessed;
return $json->pretty->encode($self);
}
# Method ===============================================================
#
# Pa
_payload:
# Parameters: none
# Returns : self as JSON formatted for BSC REST call
#
sub get_payload {
my $self = shift;
my $json = new JSON->canonical->allow_blessed->convert_blessed;
m
y $payload = '{"vyatta-interfaces-dataplane:dataplane":'
. $json->encode($self)
. '}';
$payload =~ s/firewall/vyatta-security-firewall:firewall/g;
$payload =~ s/inlist/in/g;
ode::NC);
use HTTP::Status qw(:constants :is status_message);
use URI::Escape qw(uri_escape);
use JSON -convert_blessed_universally;
use Brocade::BSC;
use Brocade::BSC::Status qw(:constants);
=head1
tworking controller.
=cut
package Brocade::BSC::Node;
use strict;
use warnings;
use YAML;
use JSON -convert_blessed_universally;
=head1 METHODS
=cut
# Constructor ==============================
===========
#
=item B<as_json>
# Returns : Returns pretty-printed JSON string representing netconf node.
=cut
sub as_json {
my $self = shift;
my $json = new JSON->canonical->allow_blesse
d->convert_blessed;
return $json->pretty->encode($self);
}
# Method ===============================================================
#
=item B<ctrl_req>
# Parameters: $method (string, req) HTT