Skip to content

Commit

Permalink
doc: add man pages for bank commands
Browse files Browse the repository at this point in the history
Problem: There are no manual pages for the bank commands in
flux-accounting.

Add man pages for add-bank, view-bank, delete-bank, and edit-bank.
  • Loading branch information
cmoussa1 committed Dec 20, 2024
1 parent 77b23d0 commit a5159f5
Show file tree
Hide file tree
Showing 8 changed files with 236 additions and 1 deletion.
7 changes: 6 additions & 1 deletion doc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ MAN1_FILES_PRIMARY = \
man1/flux-account-view-user.1 \
man1/flux-account-add-user.1 \
man1/flux-account-delete-user.1 \
man1/flux-account-edit-user.1
man1/flux-account-edit-user.1 \
man1/flux-account-view-bank.1 \
man1/flux-account-add-bank.1 \
man1/flux-account-delete-bank.1 \
man1/flux-account-edit-bank.1 \
man1/flux-account-list-banks.1

MAN5_FILES_PRIMARY = \
man5/flux-config-accounting.5
Expand Down
40 changes: 40 additions & 0 deletions doc/man1/flux-account-add-bank.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.. flux-help-section: flux account
========================
flux-account-add-bank(1)
========================


SYNOPSIS
========

**flux** **account** **add-bank** BANK SHARES [--parent-bank=PARENT-BANK]

DESCRIPTION
===========

.. program:: flux account add-bank

:program:`flux account add-bank` will add a new bank to the ``bank_table`` in
the flux-accounting database. If the bank being added is not the root bank, its
parent must be specified when added. Shares allocated to the bank can also be
configured when adding the bank.

.. option:: --parent-bank

The name of the parent bank.

EXAMPLES
--------

A parent bank does not need to be specified when adding the root bank:

.. code-block:: console
$ flux account add-bank root 1
All others, however, require a parent bank:

.. code-block:: console
$ flux account add-bank bankA 1 --parent-bank=root
29 changes: 29 additions & 0 deletions doc/man1/flux-account-delete-bank.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. flux-help-section: flux account
===========================
flux-account-delete-bank(1)
===========================


SYNOPSIS
========

**flux** **account** **delete-bank** BANK

DESCRIPTION
===========

.. program:: flux account delete-bank

:program:`flux account delete-bank` will set a bank's ``active`` field to ``0``
in the ``bank_table``. Banks can be reactivated by simply re-adding them to the
``bank_table`` with ``flux account add-bank``.

EXAMPLES
--------

A bank can be deactivated by calling ``delete-bank``:

.. code-block:: console
$ flux account delete-bank bankA
35 changes: 35 additions & 0 deletions doc/man1/flux-account-edit-bank.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.. flux-help-section: flux account
=========================
flux-account-edit-bank(1)
=========================


SYNOPSIS
========

**flux** **account** **edit-bank** BANK [OPTIONS]

DESCRIPTION
===========

.. program:: flux account edit-bank

:program:`flux account edit-bank` allows for the modifications of certain
fields for a given bank. The list of modifiable fields are as follows:

.. option:: --parent-bank

The name of the parent bank.

.. option:: --shares

The amount of available resources their organization considers the bank
should be entitled to use relative to other competing banks.

EXAMPLES
--------

.. code-block:: console
$ flux account edit-bank bankA --shares=100
34 changes: 34 additions & 0 deletions doc/man1/flux-account-list-banks.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. flux-help-section: flux account
==========================
flux-account-list-banks(1)
==========================


SYNOPSIS
========

**flux** **account** **list-banks**

DESCRIPTION
===========

.. program:: flux account list-banks

:program:`flux account list-banks` will list all of the banks in the
``bank_table``. By default, it will include every column in the ``bank_table``,
but the output can be customized by specifying which columns to include.

.. option:: --inactive

Include inactive banks in the output.

.. option:: --fields

A list of columns from the table to include in the output. By default, all
columns are included.

.. option:: --table

Output data in table format. By default, the format of any returned data is
in JSON.
37 changes: 37 additions & 0 deletions doc/man1/flux-account-view-bank.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.. flux-help-section: flux account
=========================
flux-account-view-bank(1)
=========================


SYNOPSIS
========

**flux** **account** **view-bank** BANK [OPTIONS]

DESCRIPTION
===========

.. program:: flux account view-bank

:program:`flux account view-bank` returns all of the various attributes for
the bank specified. Options can be passed in to view all users that belong to
this bank or view the bank in relation to other banks in the flux-accounting
database hierarchy.

.. option:: --tree

View the flux-accounting database hierarchy in a tree format where BANK is
the root of the tree.

.. option:: --parsable

Similar to ``--tree``, view the flux-accounting database hierarchy in a
tree format where BANK is the root of the tree, delimited by a pipe (``|``)
character.

.. option:: --users

List every user that belongs to BANK, along with their basic accounting
information.
20 changes: 20 additions & 0 deletions doc/man1/flux-account.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,38 @@ BANK ADMINISTRATION
view-bank
^^^^^^^^^

View information about a bank in the flux-accounting database.

See :man1:`flux-account-view-bank` for more details.

add-bank
^^^^^^^^

Add a bank to the flux-accounting database.

See :man1:`flux-account-add-bank` for more details.

delete-bank
^^^^^^^^^^^

Set a bank to inactive in the flux-accounting database.

See :man1:`flux-account-delete-bank` for more details.

edit-bank
^^^^^^^^^

Modify an attribute for a bank in the flux-accounting database,

See :man1:`flux-account-edit-bank` for more details.

list-banks
^^^^^^^^^^

List all of the banks in the ``bank_table``.

See :man1:`flux-account-list-banks` for more details.

QUEUE ADMINISTRATION
====================

Expand Down
35 changes: 35 additions & 0 deletions doc/manpages.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,41 @@
[author],
1,
),
(
"man1/flux-account-view-bank",
"flux-account-view-bank",
"view information about a bank in the flux-accounting database",
[author],
1,
),
(
"man1/flux-account-add-bank",
"flux-account-add-bank",
"add a bank to the bank_table",
[author],
1,
),
(
"man1/flux-account-delete-bank",
"flux-account-delete-bank",
"set a bank to inactive in the flux-accounting database",
[author],
1,
),
(
"man1/flux-account-edit-bank",
"flux-account-edit-bank",
"modify an attribute for a bank in the flux-accounting database",
[author],
1,
),
(
"man1/flux-account-list-banks",
"flux-account-list-banks",
"list all banks in bank_table",
[author],
1,
),
(
"man5/flux-config-accounting",
"flux-config-accounting",
Expand Down

0 comments on commit a5159f5

Please sign in to comment.