# $Id: //depot/prod/test/main/lib/NACL/CS/DpRelationship.pm $ # # Copyright (c) 2013 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary DpRelationship ComponentState Module (auto-generated by OCUM CGT) ## @author dl-mpo-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::DFM::DpRelationship =head1 DESCRIPTION C is a derived class of L. It represents the state of a DpRelationship. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the DpRelationship element are the attributes of the DpRelationship ComponentState. =over =item C<< storage_service_connection_resource_key >> =item C<< schedule_resource_key >> =item C<< newest_snapshot >> =item C<< lag_duration >> =item C<< max_transfer_rate >> =item C<< schedule_name >> =item C<< relationship_name >> =item C<< storage_service_source_node_resource_key >> =item C<< source_resource_key >> =item C<< is_healthy >> =item C<< newest_snapshot_timestamp >> =item C<< storage_service_name >> =item C<< source_name >> =item C<< relationship_type >> =item C<< tries >> =item C<< last_transfer_duration >> =item C<< relationship_progress >> =item C<< transfer_snapshot >> =item C<< exported_snapshot >> =item C<< relationship_resource_key >> =item C<< destination_name >> =item C<< last_transfer_error >> =item C<< relationship_state >> =item C<< storage_service_resource_key >> =item C<< snapshot_progress >> =item C<< storage_service_destination_node_resource_key >> =item C<< snapshot_checkpoint >> =item C<< destination_resource_key >> =item C<< exported_snapshot_timestamp >> =item C<< current_transfer_error >> =item C<< relationship_status >> =back =head2 ADDITIONAL FILTER FIELDS The fetch method also allows the following options to be passed in the filter even though they are not MethodMaker fields. =over =item C<< relationship-statuses >> ( Array ) =item C<< is-managed >> =item C<< source-or-destination-resource-key >> =item C<< relationship-states >> ( Array ) =item C<< max-records >> =back =cut package NACL::CS::DFM::DpRelationship; use strict; use warnings; use Params::Validate qw(validate validate_with SCALAR ARRAYREF HASHREF); use NACL::ComponentUtils qw(Dumper); use NATE::Log qw(log_global); my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); use base 'NACL::CS::ComponentState::DFM'; use Class::MethodMaker [ new => [ '-hash', 'new' ], scalar => 'storage_service_connection_resource_key', scalar => 'schedule_resource_key', scalar => 'newest_snapshot', scalar => 'lag_duration', scalar => 'max_transfer_rate', scalar => 'schedule_name', scalar => 'relationship_name', scalar => 'storage_service_source_node_resource_key', scalar => 'source_resource_key', scalar => 'is_healthy', scalar => 'newest_snapshot_timestamp', scalar => 'storage_service_name', scalar => 'source_name', scalar => 'relationship_type', scalar => 'tries', scalar => 'last_transfer_duration', scalar => 'relationship_progress', scalar => 'transfer_snapshot', scalar => 'exported_snapshot', scalar => 'relationship_resource_key', scalar => 'destination_name', scalar => 'last_transfer_error', scalar => 'relationship_state', scalar => 'storage_service_resource_key', scalar => 'snapshot_progress', scalar => 'storage_service_destination_node_resource_key', scalar => 'snapshot_checkpoint', scalar => 'destination_resource_key', scalar => 'exported_snapshot_timestamp', scalar => 'current_transfer_error', scalar => 'relationship_status', ]; =head1 METHODS =head2 fetch my $state = NACL::CS::DFM::DpRelationship->fetch(command_interface => $ci, ...); my @states = NACL::CS::DFM::DpRelationship->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. =cut sub fetch { $Log->enter() if $may_enter; my $pkg = shift; my @state_objs = $pkg->SUPER::fetch( @_, choices => [ { method => '_fetch_zapi', interface => 'ZAPI', set => 'DFM', }, ], exception_text => 'No matching DpRelationship(s) found.', ); $Log->exit() if $may_exit; return wantarray ? @state_objs : $state_objs[0]; } sub _fetch_zapi { $Log->enter() if $may_enter; my $pkg = shift; my @state_objs = $pkg->SUPER::_fetch_dfm_zapi( @_, api => 'dp-relationship', ); $Log->exit() if $may_exit; return @state_objs; } sub _extra_filter_fields { $Log->enter() if $may_enter; $Log->exit() if $may_exit; return [ qw( relationship-type relationship-statuses storage-service-connection-resource-key is-managed relationship-resource-key source-or-destination-resource-key relationship-states storage-service-resource-key max-records ) ]; } 1;