# # Copyright (c) 2001-2012 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary SystemServicesNtpConfig Component Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::C::SystemServicesNtpConfig =head1 DESCRIPTION C is a derived class of L. It represents access to an ONTAP SystemServicesNtpConfig. A related class is L, which represents the past state of an ONTAP SystemServicesNtpConfig. 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 =head2 command_interface See L =cut package NACL::C::SystemServicesNtpConfig; use strict; use warnings; use NACL::CS::SystemServicesNtpConfig; use NACL::ComponentUtils qw (_optional_scalars); use base 'NACL::C::Component::ONTAP'; use Params::Validate qw(validate validate_with SCALAR ARRAYREF); 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; =head1 METHODS =head2 new my $SystemServicesNtpConfig = NACL::C::SystemServicesNtpConfig->new(command_interface=>$ci, ); Return a new SystemServicesNtpConfig component object with the given attributes. =cut =head2 modify NACL::C::SystemServicesNtpConfig->modify( command_interface => $ci, ...); (Class method) This method is used to modify NTP Configuration. Uses CMode Cli and 7Mode Cli APISet. Invokes 'options' command for 7Mode 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<< "enabled" => $string >> Applicable for CMode CLI, 7Mode CLI. Maps to: 7M CLI : timed.enable =item C<< 'extended_query' => $string >> (Optional) Applicable for CMode CLI. =item C<< '*' >> This method takes all other options supported by "system services ntp config modify" 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 modify { $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( enabled ) ), }, cli_cmd => 'system services ntp config modify', ); my $ret = $pkg->call_on_apiset( %opts, choices => [ { method => "_modify_cmode_cli", interface => "CLI", set => "CMode", }, { method => '_modify_7mode_cli', interface => 'CLI', set => '7Mode', }, ], frontend => 'NACL::C::SystemServicesNtpConfig::modify', ); $Log->exit() if $may_exit; return $ret; } ## end sub modify sub _modify_cmode_cli { $Log->enter() if $may_enter; my ($pkg, %opts) = @_; $pkg->_base_backend_cmode_cli( %opts, api => 'system_services_ntp_config_modify', ); $Log->exit() if $may_exit; } ## end sub _modify_cmode_cli sub _modify_7mode_cli { $Log->enter() if $may_enter; my $pkg = shift; my %opts = validate_with( params => \@_, spec => $pkg->_backend_validate_spec(), allow_extra => 1 ); my $command_interface = delete $opts{command_interface}; my $apiset = delete $opts{apiset}; my $enabled = delete $opts{enabled}; if ($enabled eq "true") { $opts{'timed.enable'} = "on"; } else { $opts{'timed.enable'} = "off"; } my %allowed_7mode_args; $pkg->_hash_copy( source => \%opts, copy => [qw(timed.enable)], target => \%allowed_7mode_args, ); $apiset->options(%allowed_7mode_args); $Log->exit() if $may_exit; } __PACKAGE__->_load_event_class(); sub _primary_keys_validate_spec { return (); } 1;