# $Id$ # # Copyright (c) 2001-2016 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary ApplicationDetail Component Module ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::C::ApplicationDetail =head1 DESCRIPTION C is a derived class of L. It represents access to an ONTAP ApplicationDetail. A related class is L, which represents the past state of an ONTAP ApplicationDetail. =head1 ATTRIBUTES =head2 command_interface See L =head2 element_name =head2 application_component_name =head2 element_type =head2 vserver =head2 application =cut package NACL::C::ApplicationDetail; use strict; use warnings; use NACL::CS::ApplicationDetail; 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); use feature 'state'; =head1 METHODS =head2 new my $ApplicationDetail = NACL::C::ApplicationDetail->new( command_interface => $ci, 'element-name' => $element_name, 'application-component-name' => $application_component_name, 'element-type' => $element_type, 'vserver' => $vserver, 'application' => $application, ); Return a new ApplicationDetail component object with the given attributes. =cut use Class::MethodMaker [ scalar => 'element_name', scalar => 'application_component_name', scalar => 'element_type', scalar => 'vserver', scalar => 'application', ]; my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); =head2 find my $ApplicationDetail_obj = NACL::C::ApplicationDetail->find(command_interface => $ci, ...); my @ApplicationDetail_objs = NACL::C::ApplicationDetail->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 ApplicationDetail_state = $ApplicationDetail_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::ApplicationDetail would return a NACL::CS::ApplicationDetail 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 sub init { $Log->enter() if $may_enter; my ($self, %opts) = @_; # Field application-component-name might be "-" $opts{application_component_name} ||= delete $opts{'application-component-name'} ; my $was_hyphen; if(defined $opts{application_component_name} && $opts{application_component_name} eq '-') { $was_hyphen = 1; # Work around the check in the base class by temporarily setting # a dummy value $opts{application_component_name} = 'dummy'; } $self->SUPER::init(%opts); $self->application_component_name('-') if $was_hyphen; $self->_vserver_context_init(%opts); $Log->exit() if $may_exit; } __PACKAGE__->_load_event_class(); sub _primary_keys_validate_spec { return ( 'element-name' => {type => SCALAR}, 'application-component-name' => {type => SCALAR}, 'element-type' => {type => SCALAR}, 'vserver' => {type => SCALAR}, 'application' => {type => SCALAR}, ); } 1;