# # Copyright (c) 2001-2012 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary DebugClusterSetup Component Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::C::DebugClusterSetup =head1 DESCRIPTION C is a derived class of L. It represents access to an ONTAP DebugClusterSetup. A related class is L, which represents the past state of an ONTAP DebugClusterSetup. =head1 ATTRIBUTES =head2 command_interface See L =head2 sub_task_id =head2 task_id =cut package NACL::C::DebugClusterSetup; use strict; use warnings; use NACL::CS::DebugClusterSetup; use NACL::ComponentUtils qw (_optional_scalars); use base 'NACL::C::Component::ONTAP'; use Params::Validate qw(validate validate_with SCALAR ARRAYREF); use NATE::Log qw(log_global); my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); use Data::Dumper; =head1 METHODS =head2 new my $DebugClusterSetup = NACL::C::DebugClusterSetup->new( command_interface => $ci, 'sub-task-id' => $sub_task_id, 'task-id' => $task_id, ); Return a new DebugClusterSetup component object with the given attributes. =cut use Class::MethodMaker [ scalar => 'sub_task_id', scalar => 'task_id', ]; =head2 find my $DebugClusterSetup = NACL::C::DebugClusterSetup->find(command_interface => $ci, ...); my @DebugClusterSetups = NACL::C::DebugClusterSetup->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. =head2 state my DebugClusterSetup_state = $NACL::C::DebugClusterSetup->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::DebugClusterSetup would return a NACL::CS::DebugClusterSetup 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. =cut =head2 create my $DebugClusterSetup_object = NACL::C::DebugClusterSetup->create( command_interface => $ci, 'sub-task-id' => $sub_task_id, 'task-id' => $task_id, ...); (Class method) Uses a CMode CLI APIset. =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<< 'sub-task-id' => $sub_task_id >> (Required) Applicable for CMode CLI. =item C<< 'task-id' => $task_id >> (Required) Applicable for CMode CLI. =item C<< 'method-timeout' => $time_in_seconds >> (Optional) The default NATE timeout is 60 seconds. If the command might take more time to complete, this option can be used to specify a larger timeout value. The value should be provided in seconds. =item C<< "extended_query" => $string >> (Optional) Applicable for CMode CLI =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,); my $obj = $pkg->call_on_apiset( %opts, choices => [ { method => '_create_cmode_cli', interface => 'CLI', set => 'CMode', }, ], ); $Log->exit() if $may_exit; return $obj; } ## end sub create sub _create_cmode_cli { $Log->enter() if $may_enter; my $pkg = shift; my %opts = validate_with( params => \@_, spec => $pkg->_backend_validate_spec(), allow_extra => 1 ); my $command_interface = delete $opts{command_interface}; my $apiset = delete $opts{apiset}; my $allowed_cmode_options = [ qw( sub-task-id task-id extended_query ) ]; my %cmode_args; $pkg->_hash_copy( source => \%opts, copy => $allowed_cmode_options, target => \%cmode_args, ); $Log->debug("Opts to API call 'debug_cluster_setup_create' are: \n" . Dumper(\%cmode_args)); $apiset->debug_cluster_setup_create(%cmode_args); $Log->exit() if $may_exit; return $pkg->new( command_interface => $command_interface, sub_task_id => $cmode_args{'sub-task-id'}, task_id => $cmode_args{'task-id'}, ); } ## end sub _create_cmode_cli =head2 delete NACL::C::DebugClusterSetup->delete( command_interface => $ci, 'sub-task-id' => $sub_task_id, 'task-id' => $task_id, ...); or $DebugClusterSetup_object->delete(...); (Class or instance method) Uses a CMode CLI APIset. =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<< 'sub-task-id' => $sub_task_id >> (Required for class method, Not Applicable for instance method) Applicable for CMode CLI. =item C<< 'task-id' => $task_id >> (Required for class method, Not Applicable for instance method) Applicable for CMode CLI. =item C<< 'method-timeout' => $time_in_seconds >> (Optional) The default NATE timeout is 60 seconds. If the command might take more time to complete, this option can be used to specify a larger timeout value. The value should be provided in seconds. =item C<< "extended_query" => $string >> (Optional) Applicable for CMode CLI =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,); $pkg_or_obj->call_on_apiset( %opts, choices => [ { method => '_delete_cmode_cli', interface => 'CLI', set => 'CMode', }, ], ); $Log->exit() if $may_exit; } ## end sub delete sub _delete_cmode_cli { $Log->enter() if $may_enter; my $pkg_or_obj = shift; my %opts = validate_with( params => \@_, spec => $pkg_or_obj->_backend_validate_spec(), allow_extra => 1 ); delete $opts{command_interface}; my $apiset = delete $opts{apiset}; my $allowed_cmode_options = [ qw( sub-task-id task-id extended_query ) ]; my %cmode_args; $pkg_or_obj->_hash_copy( source => \%opts, copy => $allowed_cmode_options, target => \%cmode_args, ); $Log->debug("Opts to API call 'debug_cluster_setup_delete' are: \n" . Dumper(\%cmode_args)); $apiset->debug_cluster_setup_delete(%cmode_args); $Log->exit() if $may_exit; } ## end sub _delete_cmode_cli __PACKAGE__->_load_event_class(); sub _primary_keys_validate_spec { return ( 'sub-task-id' => {type => SCALAR}, 'task-id' => {type => SCALAR}, ); } ## end sub _primary_keys_validate_spec 1;