# $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 StorageShelf Component Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::C::StorageShelf =head1 DESCRIPTION C is a derived class of L. It represents access to an ONTAP StorageShelf. A related class is L, which represents the past state of an ONTAP StorageShelf. =head1 ATTRIBUTES =head2 command_interface See L =head2 shelf_uid =head2 node =head2 shelf =cut package NACL::C::StorageShelf; use strict; use warnings; use NACL::CS::StorageShelf; use NACL::ComponentUtils qw (_optional_scalars Dumper); use base 'NACL::C::Component::ONTAP'; use Params::Validate qw(validate_with SCALAR ARRAYREF SCALARREF); use NATE::Log qw(log_global); use NACL::CS::ComponentState::ZapiSkip qw(make_zapi_skip); use NACL::CS::ComponentState::ZapiArray qw(make_zapi_array); =head1 METHODS =head2 new my $StorageShelf = NACL::C::StorageShelf->new( command_interface => $ci, 'shelf-uid' => $shelf_uid, 'node' => $node, 'shelf' => $shelf, ); Return a new StorageShelf component object with the given attributes. =cut use Class::MethodMaker [ scalar => 'shelf_uid', scalar => 'node', scalar => 'shelf', ]; my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); =head2 find my $StorageShelf_obj = NACL::C::StorageShelf->find(command_interface => $ci, ...); my @StorageShelf_objs = NACL::C::StorageShelf->find(command_interface => $ci, ...); (Class method) A constructor of sorts, which discovers which elements are present (by interacting with the given command interface). In an array context it creates a component object for each present element and returns them. In a scalar context it creates a component object for just one element. This method is generally not implemented in individual components. The base class (L provides an implementation. See for a more detailed description along with explanation of all the options accepted. Uses a CMode CLI/ZAPI APISet. =head2 state my StorageShelf_state = $StorageShelf_obj->state(); (Instance method) Fetch the current state of the element associated with this component, and return a Component State object corresponding to this component (calling this on NACL::C::StorageShelf would return a NACL::CS::StorageShelf object) This method is generally not implemented in individual components. The base class (L provides an implementation. See for a more detailed description along with explanation of all the options accepted. Uses a CMode CLI/ZAPI APISet. =cut =head2 check NACL::C::StorageShelf->check( command_interface => $ci, 'node' => $node, ...); (Class method) This method is used to verifies the communication of environmental information between disk shelves and the node. Uses CMode CLI. =over =item Options =over =item C<< command_interface => $command_interface >> (Required) See L =item C<< apiset_must => $ruleset >> (Optional) See L =item C<< apiset_should => $ruleset >> (Optional) See L =item C<< 'node' => $node >> (Required) Node possible value(s) are, ,local Applicable for CMode CLI =item C<< '*' >> This method takes all other options supported by "storage shelf check" command in ONTAP =item C<< other_options >> This method takes other common options described in L =back =back =over =item Exceptions =over =item C In general, Component methods propagate the exceptions thrown from underlying API layer and the details of those exceptions are described in the L of user guide. =back =back =cut sub check { $Log->enter() if $may_enter; my ($pkg, @args) = @_; $pkg->_frontend_log_debug_opts(@args); my %opts = $pkg->_common_validate_with( params => \@args, additional_spec => { _optional_scalars( qw( node ) ), }, ignore_primary_keys => 1, cli_cmd => 'storage shelf check', ); $pkg->call_on_apiset( %opts, choices => [ { method => '_check_cmode_cli', interface => 'CLI', set => 'CMode', zapi_type => 'none', }, ], frontend => 'NACL::C::StorageShelf::check', ); $Log->exit() if $may_exit; } sub _check_cmode_cli { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; $pkg->_base_backend_cmode_cli(@opts, api => 'storage_shelf_check',); $Log->exit() if $may_exit; } __PACKAGE__->_load_event_class(); sub _primary_keys_validate_spec { return ( 'shelf-uid' => {type => SCALAR}, 'node' => {type => SCALAR}, 'shelf' => {type => SCALAR}, ); } 1;