# # Copyright (c) 2011-2013 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary SystemServicesFirewallPolicy ComponentState Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::SystemServicesFirewallPolicy =head1 DESCRIPTION C is a derived class of L. It represents the state of an ONTAP SystemServicesFirewallPolicy. A related class is L, which represents access to an ONTAP SystemServicesFirewallPolicy. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the SystemServicesFirewallPolicy element are the attributes of the SystemServicesFirewallPolicy ComponentState. =over =item C<< "ip_list" >> Filled in for CMode CLI. =item C<< "action" >> Filled in for CMode CLI. =item C<< "policy" >> Filled in for CMode CLI/ZAPI. =item C<< "service" >> Filled in for CMode CLI/ZAPI. =item C<< vserver >> Filled in for CMode CLI/ZAPI. =item C<< allow_list >> Allowed IPs (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $allow_list = $obj->allow_list(); # $allow_list contains a reference to the array of values my @allow_list = $obj->allow_list(); # @allow_list contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { allow_list = [ value1, value2...] } Filled in for CMode CLI/ZAPI. =item C<< deny_list >> Denied IPs (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $deny_list = $obj->deny_list(); # $deny_list contains a reference to the array of values my @deny_list = $obj->deny_list(); # @deny_list contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { deny_list = [ value1, value2...] } Filled in for CMode CLI. =item C<< ipspace >> IPspace Filled in for CMode CLI. =back =cut package NACL::CS::SystemServicesFirewallPolicy; use strict; use warnings; use Params::Validate qw(validate); use NACL::ComponentUtils qw(_dump_one); use NATE::Log qw(log_global); my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); use Data::Dumper; use NACL::Exceptions::NoElementsFound qw(:try); use NACL::CS::ComponentState::ZapiSkip qw(make_zapi_skip); use NACL::CS::ComponentState::ZapiArray qw(make_zapi_array); use base 'NACL::CS::ComponentState::ONTAP'; use Class::MethodMaker [ array => 'ip_list', scalar => 'action', scalar => 'policy', scalar => 'service', scalar => 'vserver', array => 'allow_list', array => 'deny_list', scalar => 'ipspace', ]; =head1 METHODS =head2 fetch my $SystemServicesFirewallPolicy_state = NACL::CS::SystemServicesFirewallPolicy->fetch(command_interface => $ci, ...); my @SystemServicesFirewallPolicy_states = NACL::CS::SystemServicesFirewallPolicy->fetch(command_interface => $ci, ...); (Class method) Invokes API 'net-firewall-policy-get-iter' for CMode ZAPI. Discovers which elements are present and returns their state in ComponentState objects. Called in scalar context it returns only one state object, in list context it returns all state objects. See L for a more detailed description along with a complete explanation of the options it accepts. Supports CMode CLI. =over =item Exceptions =over =item C When there are no elements matching the query specified or elements of that type doesn't exist, then this exception will be thrown. =back =back =cut sub fetch { $Log->enter() if $may_enter; my $pkg = shift; my @state_objs = $pkg->SUPER::fetch( @_, choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode', }, { method => '_fetch_cmode_zapi', interface => 'ZAPI', set => 'CMode', }, ], show_cmd => 'system services firewall policy show', exception_text => 'No matching system services firewall policy(s) found' ); $Log->exit() if $may_exit; return wantarray ? @state_objs : $state_objs[0]; } ## end sub fetch sub _fetch_cmode_cli { $Log->enter() if $may_enter; my $pkg = shift; my @state_objs = $pkg->SUPER::_fetch_cmode_cli(@_, api => 'system_services_firewall_policy_show'); $Log->exit() if $may_exit; return @state_objs; } ## end sub _fetch_cmode_cli sub _fetch_cmode_zapi { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my %opts = validate @args, $pkg->_fetch_backend_validate_spec(); my @state_objs = $pkg->SUPER::_fetch_cmode_zapi( @args, api => 'net-firewall-policy-get-iter', copy => [qw( policy service vserver )], map => {'allow-list' => [ make_zapi_array('allow-list'), make_zapi_skip('ip-and-mask')]}, ); $Log->exit() if $may_exit; return @state_objs; } ##end sub _fetch_cmode_zapi 1;