# Copyright (c) 2001-2014 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary Metrocluster ComponentState Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::Metrocluster =head1 DESCRIPTION C is a derived class of L. It represents the state of an ONTAP Metrocluster. A related class is L, which represents access to an ONTAP Metrocluster. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the Metrocluster element are the attributes of the Metrocluster 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) =head2 OLD ATTRIBUTES In FS.0, the metrocluster commands were redesigned. See http://wikid.netapp.com/w/C_Mode_MetroCluster/metrocluter_show_redesign. In the process, the output of the command changed. The attributes listed in this section are for builds prior to the redesign (this would be builds that do B have the uichange string "new-mcc-show"). =item C<< dr_operation_time >> Filled in for CMode CLI. =item C<< node_uuid >> Filled in for CMode CLI. =item C<< state >> Filled in for CMode CLI. =item C<< maximum_volumes_online >> Filled in for CMode CLI. =item C<< additional_configuration_info >> Filled in for CMode CLI. =item C<< node_cluster_uuid >> Filled in for CMode CLI. =item C<< dr_operation_state >> Filled in for CMode CLI. =item C<< node_systemid >> Filled in for CMode CLI. =item C<< ha_partner_systemid >> Filled in for CMode CLI. =item C<< ha_partner_cluster_uuid >> Filled in for CMode CLI. =item C<< cluster_ordinal >> Filled in for CMode CLI. =item C<< additional_dr_operation_info >> Filled in for CMode CLI. =item C<< dr_partner >> Filled in for CMode CLI. =item C<< volume_count_limit >> Filled in for CMode CLI. =item C<< dr_partner_cluster_uuid >> Filled in for CMode CLI. =item C<< node >> Filled in for CMode CLI. =item C<< reason_dr_nvram_mirroring_disabled >> Filled in for CMode CLI. =item C<< dr_partner_systemid >> Filled in for CMode CLI. =item C<< reason_ha_nvram_mirroring_disabled >> Filled in for CMode CLI. =item C<< dr_auxiliary_uuid >> Filled in for CMode CLI. =item C<< dr_auxiliary_systemid >> Filled in for CMode CLI. =item C<< dr_auxiliary >> Filled in for CMode CLI. =item C<< ha_partner >> Filled in for CMode CLI. =item C<< configuration_state >> Filled in for CMode CLI. =item C<< cluster >> Filled in for CMode CLI. =item C<< dr_partner_uuid >> Filled in for CMode CLI. =item C<< dr_cluster >> Filled in for CMode CLI. =item C<< dr_auxiliary_cluster_uuid >> Filled in for CMode CLI. =item C<< ha_partner_uuid >> Filled in for CMode CLI. =item C<< is_nvram_mirroring_to_ha_partner >> Filled in for CMode CLI. =item C<< volumes_online >> Filled in for CMode CLI. =item C<< is_nvram_mirroring_to_dr_partner >> Filled in for CMode CLI. =item C<< node_location_uuid >> Filled in for CMode CLI. =item C<< is_configured >> Filled in for CMode CLI. =item C<< dr_partner_location_uuid >> Filled in for CMode CLI. =item C<< ha_partner_location_uuid >> Filled in for CMode CLI. =item C<< force_node_object_limit >> Specifies if the Node Object Limits are Enforced possible value(s) are, on,off Filled in for CMode CLI. =item C<< node_object_limit >> Specifies if the Node Object Limits are Enforced possible value(s) are, on,off Filled in for CMode CLI. =head2 NEW ATTRIBUTES In FS.0, the metrocluster commands were redesigned. See http://wikid.netapp.com/w/C_Mode_MetroCluster/metrocluter_show_redesign. In the process, the output of the command changed. The attributes listed in this section are for builds after the redesign (this would be builds that do have the uichange string "new-mcc-show"). =item C<< local_configuration_state >> State of the Local Cluster Configuration Filled in for CMode CLI/ZAPI =item C<< remote_configuration_state >> State of the Remote Cluster Configuration Filled in for CMode CLI/ZAPI =item C<< local_mode >> Mode of Operation of Local Cluster Filled in for CMode CLI/ZAPI =item C<< remote_mode >> Mode of Operation of Remote Cluster Filled in for CMode CLI/ZAPI =item C<< dr_group_id >> DR Group ID Filled in for CMode CLI. =item C<< local_cluster_name >> Name of the Local Cluster Filled in for CMode CLI/ZAPI =item C<< remote_cluster_name >> Name of the Remote Cluster Filled in for CMode CLI/ZAPI =item C<< display_partner_objects >> Display Partner Objects possible value(s) are, true,false Filled in for CMode CLI. =back =cut package NACL::CS::Metrocluster; use strict; use warnings; use Params::Validate qw(validate); use NATE::Log qw(log_global); my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); use NACL::Exceptions::NoElementsFound qw(:try); use base 'NACL::CS::ComponentState::ONTAP'; use Class::MethodMaker [ # Old fields - pre the metrocluster redesign scalar => 'dr_operation_time', scalar => 'node_uuid', scalar => 'state', scalar => 'maximum_volumes_online', scalar => 'additional_configuration_info', scalar => 'node_cluster_uuid', scalar => 'dr_operation_state', scalar => 'node_systemid', scalar => 'ha_partner_systemid', scalar => 'ha_partner_cluster_uuid', scalar => 'cluster_ordinal', scalar => 'additional_dr_operation_info', scalar => 'dr_partner', scalar => 'volume_count_limit', scalar => 'dr_partner_cluster_uuid', scalar => 'node', scalar => 'reason_dr_nvram_mirroring_disabled', scalar => 'dr_partner_systemid', scalar => 'reason_ha_nvram_mirroring_disabled', scalar => 'dr_auxiliary_uuid', scalar => 'dr_auxiliary_systemid', scalar => 'dr_auxiliary', scalar => 'ha_partner', scalar => 'configuration_state', scalar => 'cluster', scalar => 'dr_partner_uuid', scalar => 'dr_cluster', scalar => 'dr_auxiliary_cluster_uuid', scalar => 'ha_partner_uuid', scalar => 'is_nvram_mirroring_to_ha_partner', scalar => 'volumes_online', scalar => 'is_nvram_mirroring_to_dr_partner', scalar => 'node_location_uuid', scalar => 'is_configured', scalar => 'dr_partner_location_uuid', scalar => 'ha_partner_location_uuid', scalar => 'force_node_object_limit', scalar => 'node_object_limit', # New fields scalar => 'local_configuration_state', scalar => 'remote_configuration_state', scalar => 'local_mode', scalar => 'remote_mode', scalar => 'dr_group_id', scalar => 'local_cluster_name', scalar => 'remote_cluster_name', scalar => 'display_partner_objects', ]; =head1 METHODS =head2 fetch my $Metrocluster_state = NACL::CS::Metrocluster->fetch(command_interface => $ci, ...); my @Metrocluster_states = NACL::CS::Metrocluster->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 a CMode CLI APISet. =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 = shift; my @state_objs = $pkg->SUPER::fetch( @_, show_cmd => 'metrocluster show', choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode' }, { method => '_fetch_cmode_zapi', interface => 'ZAPI', set => 'CMode' } ], exception_text => 'No matching metrocluster(s) found', show_cmd => 'metrocluster show' ); $Log->exit() if $may_exit; return wantarray ? @state_objs : $state_objs[0]; } ## end sub fetch sub _fetch_cmode_cli { $Log->enter() if $may_enter; my ($pkg, %opts) = @_; # The metrocluster commands were re-designed in FS. See: # http://wikid.netapp.com/w/C_Mode_MetroCluster/metrocluter_show_redesign # With the updated code, "metrocluster show" became a singleton if ($opts{command_interface}->has_uichange( uichange => 'new-mcc-show', throw_exception => 0 ) ) { $opts{is_singleton} = 1; } my @state_objs = $pkg->SUPER::_fetch_cmode_cli( %opts, api => 'metrocluster_show', ); $Log->exit() if $may_exit; return @state_objs; } ## end sub _fetch_cmode_cli sub _fetch_cmode_zapi { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my $zapi_copy = [qw (local-cluster-name local-configuration-state local-mode remote-cluster-name remote-configuration-state remote-mode)]; my $obj = $pkg->SUPER::_fetch_cmode_zapi_non_iter( @args, api => 'metrocluster-get', copy => $zapi_copy, primary_keys => [qw()] #No primary keys ); $Log->exit() if $may_exit; return $obj; } ## end sub _fetch_cmode_zapi 1;