The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Slurm::Sacctmgr::EntityBaseAddDel

SYNOPSIS

  package Slurm::Sacctmgr::Coordinator;
  use base qw(Slurm::Sacctmgr::EntityBaseAddDel);

DESCRIPTION

This is the base class for entities managed by sacctmgr, for entities which can be use the "add" and "delete" commands. It provides the sacctmgr_add and sacctmgr_del methods. The heavy lifting is actually done by Slurm::Sacctmgr::EntityBase.

This is a child class of Slurm::Sacctmgr::EntityBase, see that class for functions not described here.

This module defines

_sacctmgr_fields_addable($sacctmgr)

This should be overloaded in any child classes. This should return a list ref of field names which can be included in a sacctmgr add command for this entity type. As this in general may depend on the version of Slurm running, includes a Slurm::Sacctmgr instance (which will have version of Slurm).

_sacctmgr_add_cmd

The sacctmgr command to add entities of this type. Default is "-i add $entity" where $entity is _sacctmgr_entity_name.

_sacctmgr_delete_cmd

The sacctmgr command to delete entities of this type. Default is "-i delete $entity" where $entity is _sacctmgr_entity_name.

_my_sacctmgr_add_clause

The clause to give to the sacctmgr list command to add this entity to the database with sacctmgr. Should be a hash ref of key => value pairs. The default is just the list of parameter names (from _sacctmgr_fields_in_order) and there values, with the name of _sacctmgr_name_field replaced by 'name', and the key => value pairs for undef values omitted.

sacctmgr_add($sacctmgr, [ fld1=>val, [fld2=>val2 ... ])

This calls Slurm::Sacctmgr::run_generic_command to add an entity of the desired type with the specified fields. In addition to the standard field definitions, if the pseudo-field '--ok-if-previously-exists' is passed and true, the method will return "successfully" even if sacctmgr errors because the entity already exists.

sacctmgr_add_me($sacctmgr, [ extra1 => val, [ extra2 => val2 ...]])

This is an instance method, and calls sacctmgr_add with the appropriate parameters to add the entity represented by the Perl object. If any "extra" arguments are provided, this will also be passed to sacctmgr. NOTE: The extra arguments will override data members if there is a conflict.

sacctmgr_delete($sacctmgr, [ fld1=>val, [fld2=>val2 ... ])

This calls Slurm::Sacctmgr::run_generic_command to delete one or more entities matching the specified fields. It requires some where clause or will abort.

sacctmgr_delete_me($sacctmgr)

This is an instance method, and calls sacctmgr_modify to delete the entity record in the DB corresponding to the invocant Perl object.

EXPORT

Nothing. Pure OO interface.

SEE ALSO

EntityBase

AUTHOR

Tom Payerle, payerle@umd.edu

COPYRIGHT AND LICENSE

Copyright (C) 2014-2016 by the University of Maryland.

This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:

http://www.perlfoundation.org/artistic_license_2_0

Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.

If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.

This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.

This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.

Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.