# $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 MetroclusterCheckConfigClusterDiff ComponentState Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::MetroclusterCheckConfigClusterDiff =head1 DESCRIPTION C is a derived class of L. It represents the state of an ONTAP MetroclusterCheckConfigClusterDiff. A related class is L, which represents access to an ONTAP MetroclusterCheckConfigClusterDiff. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the MetroclusterCheckConfigClusterDiff element are the attributes of the MetroclusterCheckConfigClusterDiff 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<< object >> Configuration Object Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =item C<< instance >> Object Instance Count Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =item C<< source_cluster_name >> Source Cluster Name Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =item C<< keys >> Keys of Configuration Object (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $keys = $obj->keys(); # $keys contains a reference to the array of values my @keys = $obj->keys(); # @keys contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { keys = [ value1, value2...] } Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =item C<< attribute >> Attribute of Configuration Object (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $attribute = $obj->attribute(); # $attribute contains a reference to the array of values my @attribute = $obj->attribute(); # @attribute contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { attribute = [ value1, value2...] } Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =item C<< source_cluster_uuid >> Source Cluster UUID Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =item C<< source_cluster_value >> Value of Attribute at Source (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $source_cluster_value = $obj->source_cluster_value(); # $source_cluster_value contains a reference to the array of values my @source_cluster_value = $obj->source_cluster_value(); # @source_cluster_value contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { source_cluster_value = [ value1, value2...] } Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =item C<< destination_cluster_uuid >> Destination Cluster UUID Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =item C<< destination_cluster_name >> Destination Cluster Name Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =item C<< destination_cluster_value >> Value of Attribute at Destination (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $destination_cluster_value = $obj->destination_cluster_value(); # $destination_cluster_value contains a reference to the array of values my @destination_cluster_value = $obj->destination_cluster_value(); # @destination_cluster_value contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { destination_cluster_value = [ value1, value2...] } Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =back =cut package NACL::CS::MetroclusterCheckConfigClusterDiff; 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 => 'object', scalar => 'instance', scalar => 'source_cluster_name', array => 'keys', array => 'attribute', scalar => 'source_cluster_uuid', array => 'source_cluster_value', scalar => 'destination_cluster_uuid', scalar => 'destination_cluster_name', array => 'destination_cluster_value', ]; my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); =head1 METHODS =head2 fetch my $MetroclusterCheckConfigClusterDiff_state = NACL::CS::MetroclusterCheckConfigClusterDiff->fetch(command_interface => $ci, ...); my @MetroclusterCheckConfigClusterDiff_states = NACL::CS::MetroclusterCheckConfigClusterDiff->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. See L for a more detailed description along with a complete explanation of the options it accepts. Uses CMode CLI/ZAPI. Invokes metrocluster-config-diff-get-iter API for CMode ZAPI. =over =item Exceptions =over =item C When there are no elements matching the query specified or elements of that type doesn't exist, then this exception will be thrown. =back =back =cut sub fetch { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my @state_objs = $pkg->SUPER::fetch( @args, show_cmd => 'metrocluster check config-cluster diff show', choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode' }, { method => '_fetch_cmode_zapi', interface => 'ZAPI', set => 'CMode' }, ], exception_text => 'No matching metrocluster check config-cluster diff(s) found', frontend => 'NACL::CS::MetroclusterCheckConfigClusterDiff::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 => 'metrocluster_check_config_cluster_diff_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(object source-cluster-name instance source-cluster-uuid destination-cluster-uuid destination-cluster-name ) ], map => { 'keys' => [make_zapi_array('keys'), make_zapi_skip('key-value-pair'),], 'attribute' => [ make_zapi_array('attribute-diff-list'), make_zapi_skip('config-cluster-attribute-info'), 'attribute' ], 'source-cluster-value' => [ make_zapi_array('attribute-diff-list'), make_zapi_skip('config-cluster-attribute-info'), 'source-cluster-value' ], 'destination-cluster-value' => [ make_zapi_array('attribute-diff-list'), make_zapi_skip('config-cluster-attribute-info'), 'destination-cluster-value' ], }, api => "metrocluster-config-diff-get-iter", ); $Log->exit() if $may_exit; return @state_objs; } 1;