# # Copyright (c) 2001-2013 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary ClusterImagePackage Component Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::C::ClusterImagePackage =head1 DESCRIPTION C is a derived class of L. It represents access to an ONTAP ClusterImagePackage. A related class is L, which represents the past state of an ONTAP ClusterImagePackage. However, since it does not have any primary keys, 'find' and 'state' do not work for this component. (This component is considered a 'singleton', i.e. there is only one row shown by the relevant 'show' command) =cut =head1 ATTRIBUTES None. =cut package NACL::C::ClusterImagePackage; use strict; use warnings; use NACL::CS::ClusterImagePackage; 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); my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); use NACL::C::Exceptions::ClusterImagePackage::SyncInProgress qw(:try); =head1 METHODS =head2 new my $ClusterImagePackage = NACL::C::ClusterImagePackage->new( command_interface => $ci, ); Return a new ClusterImagePackage component object with the given attributes. =cut use Class::MethodMaker []; =head2 find my $ClusterImagePackage_obj = NACL::C::ClusterImagePackage->find(command_interface => $ci, ...); my @ClusterImagePackage_objs = NACL::C::ClusterImagePackage->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 APISet. =head2 state my ClusterImagePackage_state = $ClusterImagePackage_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::ClusterImagePackage would return a NACL::CS::ClusterImagePackage 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 APISet. =cut =head2 delete NACL::C::ClusterImagePackage->delete( command_interface => $ci, ...); (Class method) This method is used to remove the package from cluster image package diretory. Uses a CMode CLI/ZAPI APIset. Invokes 'cluster-image-package-delete' API for Cmode ZAPI. =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<< 'version' => $string >> Applicable for CMode CLI/ZAPI Maps to: CM ZAPI: package-version =item C<< 'method-timeout' => $time_in_seconds >> (Optional) The default NATE timeout is 60 seconds. If the command might take more time to complete, this option can be used to specify a larger timeout value. The value should be provided in seconds. =item C<< "extended_query" => $string >> (Optional) Applicable for CMode CLI =item C<< other_options >> This method takes other common options described in L =item C<< '*' >> This method takes all other options supported by "cluster image package delete" command in ONTAP. Applicable for CMode CLI. =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 delete { $Log->enter() if $may_enter; my ($pkg, @args) = @_; $pkg->_frontend_log_debug_opts(@args); my %opts = $pkg->_common_validate_with( params => \@args, additional_spec => { 'cmd_execution_time' => {type => SCALARREF, optional => 1}, _optional_scalars( qw( version ) ), }, api => 'cluster_image_package_delete', ); try { $pkg->call_on_apiset( %opts, choices => [ { method => '_delete_cmode_cli', interface => 'CLI', set => 'CMode', }, { method => '_delete_cmode_zapi', interface => 'ZAPI', set => 'CMode', }, ], frontend => 'NACL::C::ClusterImagePackage::delete', ); } catch NATE::BaseException with { my $exception = $_[0]; NACL::C::Exceptions::ClusterImagePackage::SyncInProgress ->detect_convert_and_throw(exception => $exception); $Log->exit() if $may_exit; $exception->throw(); }; $Log->exit() if $may_exit; } ## end sub delete sub _delete_cmode_cli { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; $pkg->_base_backend_cmode_cli(@opts, api => 'cluster_image_package_delete',); $Log->exit() if $may_exit; } ## end sub _delete_cmode_cli sub _delete_cmode_zapi { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; $pkg->_base_backend_cmode_zapi( @opts, map => {'version' => 'package-version'}, api => 'cluster-image-package-delete', frontend_method => 'delete', ); $Log->exit() if $may_exit; } =head2 get NACL::C::ClusterImagePackage->get( command_interface => $ci, ...); (Class method) This method is used to get the package to cluster image package directory. Uses a CMode CLI APIset. =over =item Options Applicable for CMode CLI. =item C<< 'method-timeout' => $time_in_seconds >> (Optional) The default NATE timeout is 60 seconds. If the command might take more time to complete, this option can be used to specify a larger timeout value. The value should be provided in seconds. =item C<< other_options >> This method takes other common options described in L =item C<< '*' >> This method takes all other options supported by "cluster image package eula accept" command in ONTAP =item C<< 'package' => $string >> Applicable for CMode CLI. =item C<< "extended_query" => $string >> (Optional) Applicable for CMode CLI =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 eula_accept { $Log->enter() if $may_enter; my ($pkg, @args) = @_; $pkg->_frontend_log_debug_opts(@args); my %opts = $pkg->_common_validate_with( params => \@args, additional_spec => { 'cmd_execution_time' => {type => SCALARREF, optional => 1}, _optional_scalars( qw( support-site-user-password package-version support-site-user-id is-eula-accepted ) ), }, api => 'cluster_image_package_eula_accept', ); $pkg->call_on_apiset( %opts, choices => [ { method => '_eula_accept_cmode_cli', interface => 'CLI', set => 'CMode', }, ], frontend => 'NACL::C::ClusterImagePackage::eula_accept', ); $Log->exit() if $may_exit; } sub _eula_accept_cmode_cli { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; $pkg->_base_backend_cmode_cli(@opts, api => 'cluster_image_package_eula_accept',); $Log->exit() if $may_exit; } =head2 eula_get NACL::C::ClusterImagePackage->eula_get( command_interface => $ci, ...); (Class method) Uses a CMode CLI APIset. =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<< 'support-site-user-password' => $string >> User password Applicable for CMode CLI. =item C<< 'eula-document' => $string >> EULA document Applicable for CMode CLI. =item C<< 'package-version' => $string >> ONTAP version Applicable for CMode CLI. =item C<< 'support-site-user-id' => $string >> User ID Applicable for CMode CLI. =item C<< 'method-timeout' => $time_in_seconds >> (Optional) The default NATE timeout is 60 seconds. If the command might take more time to complete, this option can be used to specify a larger timeout value. The value should be provided in seconds. =item C<< "extended_query" => $string >> (Optional) Applicable for CMode CLI =item C<< other_options >> This method takes other common options described in L =item C<< '*' >> This method takes all other options supported by "cluster image package eula-get" command in ONTAP. Applicable for CMode CLI. =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 eula_get { $Log->enter() if $may_enter; my ($pkg, @args) = @_; $pkg->_frontend_log_debug_opts(@args); my %opts = $pkg->_common_validate_with( params => \@args, additional_spec => { 'cmd_execution_time' => {type => SCALARREF, optional => 1}, _optional_scalars( qw( support-site-user-password eula-document package-version support-site-user-id ) ), }, api => 'cluster_image_package_eula_get', ); $pkg->call_on_apiset( %opts, choices => [ { method => '_eula_get_cmode_cli', interface => 'CLI', set => 'CMode', }, ], frontend => 'NACL::C::ClusterImagePackage::eula_get', ); $Log->exit() if $may_exit; } ## end sub eula_get sub _eula_get_cmode_cli { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; $pkg->_base_backend_cmode_cli(@opts, api => 'cluster_image_package_eula_get',); $Log->exit() if $may_exit; } ## end sub _eula_get_cmode_cli =head2 get NACL::C::ClusterImagePackage->get( command_interface => $ci, ...); (Class method) This method is used to get the package to cluster image package directory. Uses a CMode CLI/ZAPI APIset. Invokes 'cluster-image-package-download' API for Cmode ZAPI. =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<< 'version' => $string >> Version To Download Applicable for CMode CLI. =item C<< 'package' => $string >> This option is deprecated,use 'url' instead EULA document possible value(s) are, text Applicable for CMode CLI/ZAPI =item C<< 'url' => $string >> Applicable for CMode CLI/ZAPI Maps to: CM ZAPI: package-url =item C<< 'package-version' => $string >> ONTAP version possible value(s) are, text Applicable for CMode CLI =item C<< 'support-site-user-id' => $string >> User ID possible value(s) are, text Package URL EULA document possible value(s) are, text Applicable for CMode CLI. =item C<< 'package-version' => $string >> ONTAP version possible value(s) are, text Applicable for CMode CLI. =item C<< 'support-site-user-id' => $string >> User ID possible value(s) are, text Applicable for CMode CLI. =item C<< 'method-timeout' => $time_in_seconds >> (Optional) The default NATE timeout is 60 seconds. If the command might take more time to complete, this option can be used to specify a larger timeout value. The value should be provided in seconds. =item C<< 'sequence' => $string >> Applicable for CMode CLI. =item C<< "extended_query" => $string >> (Optional) Applicable for CMode CLI =item C<< other_options >> This method takes other common options described in L =item C<< 'password' => $string >> NOW Password Applicable for CMode CLI =item C<< '*' >> This method takes all other options supported by "cluster image package get" command in ONTAP =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 get { $Log->enter() if $may_enter; my ($pkg, @args) = @_; $pkg->_frontend_log_debug_opts(@args); my %opts = $pkg->_common_validate_with( params => \@args, additional_spec => { 'cmd_execution_time' => {type => SCALARREF, optional => 1}, _optional_scalars( qw( version url package sequence password ) ), }, api => 'cluster_image_package_get', ); if($opts{'package'}) { my $warn_message = "The 'package' option is deprecated. Use 'url' "; NACL::C::Component->_print_deprecation_warning($warn_message); $opts{'url'} = delete $opts{'package'}; } $pkg->call_on_apiset( %opts, choices => [ { method => '_get_cmode_cli', interface => 'CLI', set => 'CMode', }, { method => '_get_cmode_zapi', interface => 'ZAPI', set => 'CMode', }, ], frontend => 'NACL::C::ClusterImagePackage::get', ); $Log->exit() if $may_exit; } sub _get_cmode_cli { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; $pkg->_base_backend_cmode_cli(@opts, api => 'cluster_image_package_get'); $Log->exit() if $may_exit; } sub _get_cmode_zapi { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; $pkg->_base_backend_cmode_zapi( @opts, map => {'url' => 'package-url'}, api => 'cluster-image-package-download', frontend_method => 'get', ); $Log->exit() if $may_exit; } =head2 show_local my $show_local_obj = NACL::C::ClusterImagePackage->show_local(command_interface => $ci, [ filter => { %filter } ,] [ requested_fields => [ @req_fields ]); or my @show_local_objs = NACL::C::ClusterImagePackage->show_local(command_interface => $ci, [ filter => { %filter } ,] [ requested_fields => [ @req_fields ]); or my $show_local_obj = $ClusterImagePackage_obj->show_local(); (Class or Instance method) This method is a CS-like fetch method which accepts all the parameters of L (requested_fields, filter, allow_empty) and has all of the other properties of fetch methods (callable in scalar or list context, throws a NoElementsFound exception if no matching elements are found). The requested fields and filter takes L of NACL::CS::ClusterImagePackageShowLocal as input. This method returns objects of the type L. =cut sub show_local { $Log->enter() if $may_enter; my ($pkg_or_obj, @args) = @_; my %opts = $pkg_or_obj->_handle_obj_cs_like_calls(@args); require NACL::CS::ClusterImagePackageShowLocal; my @state_objs = NACL::CS::ClusterImagePackageShowLocal->fetch(%opts); $Log->exit() if $may_exit; return wantarray ? @state_objs : $state_objs[0]; } =head2 show_support_site my $show_support_site_obj = NACL::C::ClusterImagePackage->show_support_site(command_interface => $ci, [ filter => { %filter } ,] [ requested_fields => [ @req_fields ]); or my @show_support_site_objs = NACL::C::ClusterImagePackage->show_support_site(command_interface => $ci, [ filter => { %filter } ,] [ requested_fields => [ @req_fields ]); or my $show_support_site_obj = $ClusterImagePackage_obj->show_support_site(); (Class or Instance method) This method is a CS-like fetch method which accepts all the parameters of L (requested_fields, filter, allow_empty) and has all of the other properties of fetch methods (callable in scalar or list context, throws a NoElementsFound exception if no matching elements are found). The requested fields and filter takes L of NACL::CS::ClusterImagePackageShowSupportSite as input. This method returns objects of the type L. =cut sub show_support_site { $Log->enter() if $may_enter; my ($pkg_or_obj, @args) = @_; my %opts = $pkg_or_obj->_handle_obj_cs_like_calls(@args); require NACL::CS::ClusterImagePackageShowSupportSite; my @state_objs = NACL::CS::ClusterImagePackageShowSupportSite->fetch(%opts); $Log->exit() if $may_exit; return wantarray ? @state_objs : $state_objs[0]; } =head2 show_repository my $show_repository_obj = NACL::C::ClusterImagePackage->show_repository(command_interface => $ci, [ filter => { %filter } ,] [ requested_fields => [ @req_fields ]); or my @show_repository_objs = NACL::C::ClusterImagePackage->show_repository(command_interface => $ci, [ filter => { %filter } ,] [ requested_fields => [ @req_fields ]); or my $show_repository_obj = $ClusterImagePackage_obj->show_repository(); (Class or Instance method) This method is a CS-like fetch method which accepts all the parameters of L (requested_fields, filter, allow_empty) and has all of the other properties of fetch methods (callable in scalar or list context, throws a NoElementsFound exception if no matching elements are found). The requested fields and filter takes L of NACL::CS::ClusterImagePackageShowRepository as input. This method returns objects of the type L. =cut sub show_repository { $Log->enter() if $may_enter; my ($pkg_or_obj, @args) = @_; my %opts = $pkg_or_obj->_handle_obj_cs_like_calls(@args); require NACL::CS::ClusterImagePackageShowRepository; my @state_objs = NACL::CS::ClusterImagePackageShowRepository->fetch(%opts); $Log->exit() if $may_exit; return wantarray ? @state_objs : $state_objs[0]; } __PACKAGE__->_load_event_class(); 1;