The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Slurm::Sacctmgr::EntityBase

SYNOPSIS

  package Slurm::Sacctmgr::Account;
  use base qw(Slurm::Sacctmgr::EntityBase);

  sub _ro_fields($)
  {     my $class = shift;
        return qw( account description organization coordinators);
  }

  ...

DESCRIPTION

This is the base class for entities managed by sacctmgr. It provides common constructors, etc.

Child classes should overload the following methods to customize behavior:

_ro_fields

Should return a list ref of the names of the read-only fields for this entity. Default is empty.

_rw_fields

Should return a list ref of the names of the read-write fields for this entity. Default is empty.

_required_fields

A list of required fields for the constructor to make the object. Default is empty.

_sacctmgr_fields

This should return a list ref of field names, including all fields names sacctmgr knows about (for all versions of sacctmgr).

_sacctmgr_fields_in_order($sacctmgr)

A list ref of field names in order sacctmgr will return them Takes a Slurm::Sacctmgr instance as an argument, because in general this may depend on the version of Slurm/sacctmgr. Must be overridden.

_sacctmgr_entity_name

The name of sacctmgr entity associated with this Perl class. Default is just derived from the class name.

_my_sacctmgr_where_clause

The "where" clause to give to the sacctmgr list command to list just the record corresponding to this instance in the database. The default is "name=>$NameValue" where NameValue is the value of the field named _sacctmgr_name_field. Should be a hash ref of key => value pairs.

_sacctmgr_name_field

Used to default _my_sacctmgr_where_clause above.

_sacctmgr_fields_addable($sacctmgr)

Only for child classes of EntityBaseAddDel, 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_fields_updatable($sacctmgr)

Only for child classes of EntityBaseModifiable, this should return a list ref of field names which can be included in a sacctmgr update 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).

Most useful methods are in subclasses depending on which commands can be issues on entities of that type. E.g,

EntityBaseListable for entities supporting the "list" command
EntityBaseAddDel for entities with the "add" and "delete" command
EntityBaseModifiable for entities supporting the "modify" command
EntityBaseRW for entities with the "list", "add", "delete" and "modify" commands

EXPORT

None. Pure OO interface.

SEE ALSO

EntityBaseListable EntityBaseAddDel EntityBaseModifiable EntityBaseRW

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.