# $Id$ # # Copyright (c) 2001-2011 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary League Component Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::C::League =head1 DESCRIPTION C is a derived class of L. It represents access to an ONTAP League. A related class is L, which represents the past state of an ONTAP League. =head1 ATTRIBUTES =head2 command_interface See L =head2 league_name =cut package NACL::C::League; use strict; use warnings; use NACL::CS::League; use NACL::ComponentUtils qw (_optional_scalars Dumper); use base 'NACL::C::Component::ONTAP'; use Params::Validate qw(validate_with SCALAR ARRAYREF SCALARREF); use NATE::Log qw(log_global); my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); =head1 METHODS =head2 new my $League = NACL::C::League->new( command_interface => $ci, 'league-name' => $league_name, ); Return a new League component object with the given attributes. =cut use Class::MethodMaker [scalar => 'league_name',]; =head2 find my $League_obj = NACL::C::League->find(command_interface => $ci, ...); my @League_objs = NACL::C::League->find(command_interface => $ci, ...); (Class method) A constructor of sorts, which discovers which elements are present (by interacting with the given command interface). In an array context it creates a component object for each present element and returns them. In a scalar context it creates a component object for just one element. This method is generally not implemented in individual components. The base class (L provides an implementation. See for a more detailed description along with explanation of all the options accepted. Uses a CMode CLI APISet. =head2 state my League_state = $League_obj->state(); (Instance method) Fetch the current state of the element associated with this component, and return a Component State object corresponding to this component (calling this on NACL::C::League would return a NACL::CS::League object) This method is generally not implemented in individual components. The base class (L provides an implementation. See for a more detailed description along with explanation of all the options accepted. Uses a CMode CLI APISet. =cut =head2 abandon NACL::C::League->abandon( command_interface => $ci, 'league-name' => $league_name, ...); or $League_obj->abandon(...); (Class or instance method) This method is used to abandon our membership in a league. Uses CMode CLI . =over =item Options =over =item C<< command_interface => $command_interface >> (Required for class method, Not Applicable for instance method) See L =item C<< apiset_must => $ruleset >> (Optional) See L =item C<< apiset_should => $ruleset >> (Optional) See L =item C<< 'league-name' => $league_name >> (Required for class method, Not Applicable for instance method) League Name Applicable for CMode CLI =item C<< '*' >> This method takes all other options supported by "league abandon" command in ONTAP =item C<< other_options >> This method takes other common options described in L =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 abandon { $Log->enter() if $may_enter; my ($pkg_or_obj, @args) = @_; $pkg_or_obj->_frontend_log_debug_opts(@args); my %opts = $pkg_or_obj->_common_validate_with( params => \@args, api => 'league_abandon', ); $pkg_or_obj->call_on_apiset( %opts, choices => [ { method => '_abandon_cmode_cli', interface => 'CLI', set => 'CMode', }, ], frontend => 'NACL::C::League::abandon', ); } sub _abandon_cmode_cli { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; $pkg_or_obj->_base_backend_cmode_cli(@opts, api => 'league_abandon',); $Log->exit() if $may_exit; } =head2 apply NACL::C::League->apply( command_interface => $ci, 'league-name' => $league_name, ...); or $League_obj->apply(...); (Class or instance method) This method is used to apply to join a cluster league. Uses CMode CLI . =over =item Options =over =item C<< command_interface => $command_interface >> (Required for class method, Not Applicable for instance method) See L =item C<< apiset_must => $ruleset >> (Optional) See L =item C<< apiset_should => $ruleset >> (Optional) See L =item C<< 'league-name' => $league_name >> (Required for class method, Not Applicable for instance method) League Name Applicable for CMode CLI =item C<< 'master-address' => $string >> Network Address of League Master Applicable for CMode CLI =item C<< 'keyphrase' => $string >> Keyphrase for Shared Secret Applicable for CMode CLI =item C<< 'ipspace' => $string >> IPspace for League Applicable for CMode CLI =item C<< 'passphrase' => $string >> Passphrase for Acceptance Applicable for CMode CLI =item C<< 'intercluster-ips' => [ $intercluster-ip1, $intercluster-ip2, ... ] >> (Arrayref, even if only a single value is to be sent it should specified as an arrayref containing that single value) Applicable for CMode CLI =item C<< '*' >> This method takes all other options supported by "league apply" command in ONTAP =item C<< other_options >> This method takes other common options described in L =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 apply { $Log->enter() if $may_enter; my ($pkg_or_obj, @args) = @_; $pkg_or_obj->_frontend_log_debug_opts(@args); my %opts = $pkg_or_obj->_common_validate_with( params => \@args, additional_spec => { 'intercluster-ips' => {type => ARRAYREF, optional => 1}, _optional_scalars( qw( master-address keyphrase ipspace passphrase ) ), }, api => 'league_apply', ); $pkg_or_obj->call_on_apiset( %opts, choices => [ { method => '_apply_cmode_cli', interface => 'CLI', set => 'CMode', }, ], frontend => 'NACL::C::League::apply', ); } sub _apply_cmode_cli { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; $pkg_or_obj->_base_backend_cmode_cli(@opts, api => 'league_apply',); $Log->exit() if $may_exit; } =head2 create my $League_obj = NACL::C::League->create( command_interface => $ci, 'league-name' => $league_name, ...); (Class method) This method is used to create a new league. Uses CMode 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<< 'league-name' => $league_name >> (Required) League Name Applicable for CMode CLI =item C<< 'admin-contact' => $string >> League Administrator's Contact Info Applicable for CMode CLI =item C<< 'keyphrase' => $string >> Keyphrase for Shared Secret Applicable for CMode CLI =item C<< 'comment' => $string >> League Comment Applicable for CMode CLI =item C<< 'league-ipspace' => $string >> League IPspace Applicable for CMode CLI =item C<< 'intercluster-ips' => [ $intercluster-ip1, $intercluster-ip2, ... ] >> (Arrayref, even if only a single value is to be sent it should specified as an arrayref containing that single value) Applicable for CMode CLI =item C<< 'master-uuid' => $string >> Master Cluster UUID Applicable for CMode CLI =item C<< 'league-uuid' => $string >> League UUID Applicable for CMode CLI =item C<< 'passphrase' => $string >> Identification Passphrase Applicable for CMode CLI =item C<< '*' >> This method takes all other options supported by "league create" command in ONTAP =item C<< other_options >> This method takes other common options described in L =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 create { $Log->enter() if $may_enter; my ($pkg, @args) = @_; $pkg->_frontend_log_debug_opts(@args); my %opts = $pkg->_common_validate_with( params => \@args, additional_spec => { 'intercluster-ips' => {type => ARRAYREF, optional => 1}, _optional_scalars( qw( admin-contact keyphrase comment league-ipspace master-uuid league-uuid passphrase ) ), }, api => 'league_create', ); $pkg->call_on_apiset( %opts, choices => [ { method => '_create_cmode_cli', interface => 'CLI', set => 'CMode', }, ], frontend => 'NACL::C::League::create', ); my $obj = $pkg->new( command_interface => $opts{command_interface}, league_name => $opts{'league-name'}, ); $Log->exit() if $may_exit; return $obj; } sub _create_cmode_cli { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; $pkg->_base_backend_cmode_cli(@opts, api => 'league_create',); $Log->exit() if $may_exit; } =head2 delete NACL::C::League->delete( command_interface => $ci, 'league-name' => $league_name, ...); or $League_obj->delete(...); (Class or instance method) This method is used to delete a league. Uses CMode CLI . =over =item Options =over =item C<< command_interface => $command_interface >> (Required for class method, Not Applicable for instance method) See L =item C<< apiset_must => $ruleset >> (Optional) See L =item C<< apiset_should => $ruleset >> (Optional) See L =item C<< 'league-name' => $league_name >> (Required for class method, Not Applicable for instance method) League Name Applicable for CMode CLI =item C<< '*' >> This method takes all other options supported by "league delete" command in ONTAP =item C<< other_options >> This method takes other common options described in L =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 delete { $Log->enter() if $may_enter; my ($pkg_or_obj, @args) = @_; $pkg_or_obj->_frontend_log_debug_opts(@args); my %opts = $pkg_or_obj->_common_validate_with( params => \@args, api => 'league_delete', ); $pkg_or_obj->call_on_apiset( %opts, choices => [ { method => '_delete_cmode_cli', interface => 'CLI', set => 'CMode', }, ], frontend => 'NACL::C::League::delete', ); } sub _delete_cmode_cli { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; $pkg_or_obj->_base_backend_cmode_cli(@opts, api => 'league_delete',); $Log->exit() if $may_exit; } =head2 modify NACL::C::League->modify( command_interface => $ci, 'league-name' => $league_name, ...); or $League_obj->modify(...); (Class or instance method) This method is used to modify league properties. Uses CMode CLI . =over =item Options =over =item C<< command_interface => $command_interface >> (Required for class method, Not Applicable for instance method) See L =item C<< apiset_must => $ruleset >> (Optional) See L =item C<< apiset_should => $ruleset >> (Optional) See L =item C<< 'league-name' => $league_name >> (Required for class method, Not Applicable for instance method) League Name Applicable for CMode CLI =item C<< 'admin-contact' => $string >> League Administrator's Contact Info Applicable for CMode CLI =item C<< 'comment' => $string >> League Comment Applicable for CMode CLI =item C<< 'master-name' => $string >> Master Cluster Applicable for CMode CLI =item C<< 'master-uuid' => $string >> Master Cluster UUID Applicable for CMode CLI =item C<< 'league-uuid' => $string >> League UUID Applicable for CMode CLI =item C<< 'passphrase' => $string >> Identification Passphrase Applicable for CMode CLI =item C<< 'updates-enabled' => $string >> Accepting Updates? possible value(s) are, true,false Applicable for CMode CLI =item C<< '*' >> This method takes all other options supported by "league modify" command in ONTAP =item C<< other_options >> This method takes other common options described in L =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_or_obj, @args) = @_; $pkg_or_obj->_frontend_log_debug_opts(@args); my %opts = $pkg_or_obj->_common_validate_with( params => \@args, additional_spec => { _optional_scalars( qw( admin-contact comment master-name master-uuid league-uuid passphrase updates-enabled ) ), }, api => 'league_modify', ); $pkg_or_obj->call_on_apiset( %opts, choices => [ { method => '_modify_cmode_cli', interface => 'CLI', set => 'CMode', }, ], frontend => 'NACL::C::League::modify', ); } sub _modify_cmode_cli { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; $pkg_or_obj->_base_backend_cmode_cli(@opts, api => 'league_modify',); $Log->exit() if $may_exit; } =head2 rename NACL::C::League->rename( command_interface => $ci, 'league-name' => $league_name, ...); or $League_obj->rename(...); (Class or instance method) This method is used to rename a league. Uses CMode CLI . =over =item Options =over =item C<< command_interface => $command_interface >> (Required for class method, Not Applicable for instance method) See L =item C<< apiset_must => $ruleset >> (Optional) See L =item C<< apiset_should => $ruleset >> (Optional) See L =item C<< 'league-name' => $league_name >> (Required for class method, Not Applicable for instance method) League Name Applicable for CMode CLI =item C<< 'new-name' => $string >> New League Name Applicable for CMode CLI =item C<< '*' >> This method takes all other options supported by "league rename" command in ONTAP =item C<< other_options >> This method takes other common options described in L =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 rename { $Log->enter() if $may_enter; my ($pkg_or_obj, @args) = @_; $pkg_or_obj->_frontend_log_debug_opts(@args); my %opts = $pkg_or_obj->_common_validate_with( params => \@args, additional_spec => { _optional_scalars( qw( new-name ) ), }, api => 'league_rename', ); $pkg_or_obj->call_on_apiset( %opts, choices => [ { method => '_rename_cmode_cli', interface => 'CLI', set => 'CMode', }, ], frontend => 'NACL::C::League::rename', ); $pkg_or_obj->league_name($opts{'new-name'}) if ref($pkg_or_obj); } sub _rename_cmode_cli { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; $pkg_or_obj->_base_backend_cmode_cli(@opts, api => 'league_rename',); $Log->exit() if $may_exit; } __PACKAGE__->_load_event_class(); sub _primary_keys_validate_spec { return ('league-name' => {type => SCALAR},); } 1;