# $Id$ # # Copyright (c) 2017 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary QosAdaptivePolicyGroup ComponentState Module ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::QosAdaptivePolicyGroup =head1 DESCRIPTION C is a derived class of L. It represents the state of an ONTAP QosAdaptivePolicyGroup. A related class is L, which represents access to an ONTAP QosAdaptivePolicyGroup. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the QosAdaptivePolicyGroup element are the attributes of the QosAdaptivePolicyGroup 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<< policy_group >> Name Filled in for CMode CLI/ZAPI iter, non-iter. Mapping for CMode ZAPI iter: =item C<< vsid >> Vserver ID Filled in for CMode CLI/ZAPI iter, non-iter. =item C<< peak_iops_allocation >> Peak IOPS Allocation possible value(s) are, used-space,allocated-space Filled in for CMode CLI/ZAPI iter, non-iter. Mapping for CMode ZAPI iter: =item C<< vserver >> Vserver Filled in for CMode CLI/ZAPI iter, non-iter. Mapping for CMode ZAPI iter: =item C<< is_expected_iops_enforced >> Are Expected IOPS Enforced? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter, non-iter. Mapping for CMode ZAPI iter: =item C<< expected_iops >> Expected IOPS Filled in for CMode CLI/ZAPI iter, non-iter. Mapping for CMode ZAPI iter: =item C<< num_workloads >> Number of Workloads Filled in for CMode CLI/ZAPI iter, non-iter. Mapping for CMode ZAPI iter: =item C<< peak_iops >> Peak IOPS Filled in for CMode CLI/ZAPI iter, non-iter. Mapping for CMode ZAPI iter: =item C<< uuid >> Uuid Filled in for CMode CLI/ZAPI iter, non-iter. Mapping for CMode ZAPI iter: =item C<< absolute_min_iops >> Absolute Minimum IOPS Filled in for CMode CLI/ZAPI iter, non-iter. Mapping for CMode ZAPI iter: =item C<< pgid >> ID Filled in for CMode CLI/ZAPI iter, non-iter. Mapping for CMode ZAPI iter: =item C<< uuid_str >> UUID in string Filled in for CMode CLI/ZAPI iter, non-iter. =back =cut package NACL::CS::QosAdaptivePolicyGroup; 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 [ scalar => 'policy_group', scalar => 'vsid', scalar => 'peak_iops_allocation', scalar => 'vserver', scalar => 'is_expected_iops_enforced', scalar => 'expected_iops', scalar => 'num_workloads', scalar => 'peak_iops', scalar => 'uuid', scalar => 'absolute_min_iops', scalar => 'pgid', scalar => 'uuid_str', ]; my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); =head1 METHODS =head2 fetch my $QosAdaptivePolicyGroup_state = NACL::CS::QosAdaptivePolicyGroup->fetch(command_interface => $ci, ...); my @QosAdaptivePolicyGroup_states = NACL::CS::QosAdaptivePolicyGroup->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. Uses CMode CLI / ZAPI . Invokes qos-adaptive-policy-group-get-iter API for CMode ZAPI iter . Invokes qos-adaptive-policy-group-get API for CMode ZAPI non-iter . =over =item Exceptions =back =cut sub fetch { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my @state_objs = $pkg->SUPER::fetch( @args, show_cmd => 'qos adaptive-policy-group 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', }, ], exception_text => 'No matching QosAdaptivePolicyGroup(s) found', frontend => 'NACL::CS::QosAdaptivePolicyGroup::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 => 'qos_adaptive_policy_group_show',); $Log->exit() if $may_exit; return @state_objs; } sub _fetch_cmode_zapi { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my @state_objs = $pkg->SUPER::_fetch_cmode_zapi( @args, copy => [ qw(policy-group peak-iops-allocation is-expected-iops-enforced vserver num-workloads expected-iops peak-iops uuid absolute-min-iops pgid ) ], api => "qos-adaptive-policy-group-get-iter", ); $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(policy-group peak-iops-allocation is-expected-iops-enforced vserver num-workloads expected-iops peak-iops uuid absolute-min-iops pgid ) ], api => "qos-adaptive-policy-group-get", primary_keys => [qw( policy-group )], ); $Log->exit() if $may_exit; return @state_objs; } 1;