# $Id$ # # Copyright (c) 2001-2014 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary NetworkPortBroadcastDomain ComponentState Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::NetworkPortBroadcastDomain =head1 DESCRIPTION C is a derived class of L. It represents the state of an ONTAP NetworkPortBroadcastDomain. A related class is L, which represents access to an ONTAP NetworkPortBroadcastDomain. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the NetworkPortBroadcastDomain element are the attributes of the NetworkPortBroadcastDomain ComponentState. Additionally, the command_interface used to obtain the ComponentState object is also an attribute of the object. This makes it easier to obtain the component object corresponding to the CS object, using L. =over =item command_interface The command_interface with which the CS object was obtained. (Available in all CS objects regardless of requested_fields and the mode/interface) =item C<< port_update_status >> Port Update Status possible value(s) are, complete,in-progress,error,overridden-while-offline (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $port_update_status = $obj->port_update_status(); # $port_update_status contains a reference to the array of values my @port_update_status = $obj->port_update_status(); # @port_update_status 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 => { port_update_status = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter, non-iter. Mapping for CMode ZAPI iter: Mapping for CMode ZAPI non-iter: =item C<< port_update_status_combined >> Combined Port Update Status possible value(s) are, complete,in-progress,error,overridden-while-offline Filled in for CMode CLI/ZAPI iter, non-iter. Mapping for CMode ZAPI iter: =item C<< ports >> Ports (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $ports = $obj->ports(); # $ports contains a reference to the array of values my @ports = $obj->ports(); # @ports 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 => { ports = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter, non-iter. Mapping for CMode ZAPI iter: Mapping for CMode ZAPI non-iter: =item C<< failover_groups >> Failover Groups (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $failover_groups = $obj->failover_groups(); # $failover_groups contains a reference to the array of values my @failover_groups = $obj->failover_groups(); # @failover_groups 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 => { failover_groups = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter, non-iter. Mapping for CMode ZAPI iter: Mapping for CMode ZAPI non-iter: =item C<< ipspace >> IPspace Name Filled in for CMode CLI/ZAPI iter, non-iter. Mapping for CMode ZAPI iter: =item C<< broadcast_domain_id >> Broadcast Domain ID Filled in for CMode CLI/ZAPI iter, non-iter. =item C<< broadcast_domain >> Layer 2 Broadcast Domain Filled in for CMode CLI/ZAPI iter, non-iter. Mapping for CMode ZAPI iter: =item C<< subnet_names >> Subnet_names (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $subnet_names = $obj->subnet_names(); # $subnet_names contains a reference to the array of values my @subnet_names = $obj->subnet_names(); # @subnet_names 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 => { subnet_names = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter, non-iter. Mapping for CMode ZAPI iter: Mapping for CMode ZAPI non-iter: =item C<< mtu >> MTU Filled in for CMode CLI/ZAPI iter, non-iter. Mapping for CMode ZAPI iter: =item C<< port_update_status_details >> Status Detail Description (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $port_update_status_details = $obj->port_update_status_details(); # $port_update_status_details contains a reference to the array of values my @port_update_status_details = $obj->port_update_status_details(); # @port_update_status_details 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 => { port_update_status_details = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter, non-iter. Mapping for CMode ZAPI iter: Mapping for CMode ZAPI non-iter: =back =cut package NACL::CS::NetworkPortBroadcastDomain; use strict; use warnings; use Params::Validate qw(validate); use NATE::Log qw(log_global); 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 => 'port_update_status', scalar => 'port_update_status_combined', array => 'ports', array => 'failover_groups', scalar => 'ipspace', scalar => 'broadcast_domain_id', scalar => 'broadcast_domain', array => 'subnet_names', scalar => 'mtu', array => 'port_update_status_details', ]; my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); sub _check_non_iter { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; $pkg->_base_check_non_iter( @opts, _primary_keys => [qw(ipspace broadcast-domain)], _vs_context => 0 ); $Log->exit() if $may_exit; } =head1 METHODS =head2 fetch my $NetworkPortBroadcastDomain_state = NACL::CS::NetworkPortBroadcastDomain->fetch(command_interface => $ci, ...); my @NetworkPortBroadcastDomain_states = NACL::CS::NetworkPortBroadcastDomain->fetch(command_interface => $ci, ...); (Class method) 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. Uses CMode CLI/ZAPI. Invokes net-port-broadcast-domain-get-iter API for CMode ZAPI iter. Invokes net-port-broadcast-domain-get API for CMode ZAPI non-iter. =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, @args) = @_; my @state_objs = $pkg->SUPER::fetch( @args, show_cmd => 'network port broadcast-domain show', choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode', zapi_type => 'none', }, { method => '_fetch_cmode_zapi', interface => 'ZAPI', set => 'CMode', zapi_type => 'iter' }, { method => '_fetch_cmode_zapi_non_iter', interface => 'ZAPI', set => 'CMode', zapi_type => 'non-iter', check => '_check_non_iter' }, ], exception_text => 'No matching network port broadcast-domain(s) found', frontend => 'NACL::CS::NetworkPortBroadcastDomain::fetch', ); $Log->exit() if $may_exit; return wantarray ? @state_objs : $state_objs[0]; } sub _fetch_cmode_cli { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my @state_objs = $pkg->SUPER::_fetch_cmode_cli(@args, api => 'network_port_broadcast_domain_show',); $Log->exit() if $may_exit; return @state_objs; } sub _fetch_cmode_zapi { $Log->enter() if $may_enter; my $pkg = shift; my @state_objs = $pkg->SUPER::_fetch_cmode_zapi( @_, api => 'net-port-broadcast-domain-get-iter', copy => [qw( port-update-status-combined broadcast-domain ipspace mtu )], map => { 'ports' => [ make_zapi_array('ports'), make_zapi_skip('port-info'), 'port' ], 'port-update-status' => [ make_zapi_array('ports'), make_zapi_skip('port-info'), 'port-update-status' ], 'port-update-status-details' => [ make_zapi_array('ports'), make_zapi_skip('port-info'), 'port-update-status-details' ], 'failover-groups' => [ make_zapi_array('failover-groups'), make_zapi_skip('failover-group'), ], 'subnet-names' => [ make_zapi_array('subnet-names'), make_zapi_skip('subnet-name'), ], }, ); $Log->exit() if $may_exit; return @state_objs; } sub _fetch_cmode_zapi_non_iter { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my @state_objs = $pkg->SUPER::_fetch_cmode_zapi_non_iter( @args, copy => [ qw(port-update-status-combined ipspace broadcast-domain mtu ) ], map => { 'port-update-status' => [ make_zapi_array('ports'), make_zapi_skip('port-info'), 'port-update-status' ], 'ports' => [ make_zapi_array('ports'), make_zapi_skip('port-info'), 'port' ], 'failover-groups' => [ make_zapi_array('failover-groups'), make_zapi_skip('failover-group'), ], 'port-update-status-details' => [ make_zapi_array('ports'), make_zapi_skip('port-info'), 'port-update-status-details' ], 'subnet-names' => [ make_zapi_array('subnet-names'), make_zapi_skip('subnet-name'), ], }, api => "net-port-broadcast-domain-get", primary_keys => [qw( ipspace broadcast-domain )], ); $Log->exit() if $may_exit; return @state_objs; } 1;