Skip to content

Commit

Permalink
Move console commands in their own data type
Browse files Browse the repository at this point in the history
  • Loading branch information
smortex committed Jun 19, 2024
1 parent e29c622 commit 493e2bf
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 39 deletions.
28 changes: 11 additions & 17 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

### Data types

* [`Bacula::Command`](#Bacula--Command): A Bacula console command
* [`Bacula::JobType`](#Bacula--JobType): The type of job
* [`Bacula::Message`](#Bacula--Message): A Bacula message specification
* [`Bacula::Runscript`](#Bacula--Runscript): A Bacula Runscript specification
Expand Down Expand Up @@ -1115,23 +1116,7 @@ Default value: `'*all*'`

##### <a name="-bacula--director--console--commandacl"></a>`commandacl`

Data type:

```puppet
Array[Enum[
['add'], ['autodisplay'], ['automount'], ['cancel'], ['cloud'], ['create'], ['delete'], ['disable'], ['enable'], ['estimate'],
['exit'], ['gui'], ['help'], ['label'], ['list'], ['llist'], ['messages'], ['memory'], ['mount'], ['prune'], ['purge'], ['query'],
['quit'], ['relabel'], ['release'], ['reload'], ['restart'], ['resume'], ['restore'], ['run'], ['setbandwidth'], ['setdebug'],
['setip'], ['show'], ['sqlquery'], ['status'], ['tag'], ['time'], ['trace'], ['umount'], ['unmount'], ['update'], ['use'], ['var'],
['version'], ['wait'], ['.api'], ['.backups'], ['.clients'], ['.catalogs'], ['.defaults'], ['.die'], ['.dir'], ['.dump'], ['.exit'],
['.events'], ['.filesets'], ['.help'], ['.jobs'], ['.estimate'], ['.jlist'], ['.levels'], ['.messages'], ['.msgs'], ['.pools'],
['.quit'], ['.putfile'], ['.schedule'], ['.sql'], ['.status'], ['.storage'], ['.volstatus'], ['.media'], ['.mediatypes'],
['.locations'], ['.actiononpurge'], ['.bvfs_lsdirs'], ['.bvfs_lsfiles'], ['.bvfs_get_volumes'], ['.bvfs_update'],
['.bvfs_get_jobids'], ['.bvfs_get_jobs'], ['.bvfs_get_bootstrap'], ['.bvfs_get_fileindex'], ['.bvfs_versions'], ['.bvfs_get_delta'],
['.bvfs_restore'], ['.bvfs_cleanup'], ['.bvfs_decode_lstat'], ['.bvfs_clear_cache'], ['.bvfs_update_fv'], ['.bvfs_delete_fileid'],
['.setuid'], ['.ls'], ['.types'], ['.query'], ['.tags'],
]]
```
Data type: `Array[Bacula::Command]`

A list of of console commands that can be executed by the console.

Expand Down Expand Up @@ -2302,6 +2287,15 @@ A boolean value

## Data types

### <a name="Bacula--Command"></a>`Bacula::Command`

A Bacula console command

* **See also**
* https://www.bacula.org/15.0.x-manuals/en/console/Bacula_Enterprise_Console.html

Alias of `Enum['add', 'autodisplay', 'automount', 'cancel', 'cloud', 'create', 'delete', 'disable', 'enable', 'estimate', 'exit', 'gui', 'help', 'label', 'list', 'llist', 'messages', 'memory', 'mount', 'prune', 'purge', 'query', 'quit', 'relabel', 'release', 'reload', 'restart', 'resume', 'restore', 'run', 'setbandwidth', 'setdebug', 'setip', 'show', 'sqlquery', 'status', 'tag', 'time', 'trace', 'umount', 'unmount', 'update', 'use', 'var', 'version', 'wait', '.api', '.backups', '.clients', '.catalogs', '.defaults', '.die', '.dir', '.dump', '.exit', '.events', '.filesets', '.help', '.jobs', '.estimate', '.jlist', '.levels', '.messages', '.msgs', '.pools', '.quit', '.putfile', '.schedule', '.sql', '.status', '.storage', '.volstatus', '.media', '.mediatypes', '.locations', '.actiononpurge', '.bvfs_lsdirs', '.bvfs_lsfiles', '.bvfs_get_volumes', '.bvfs_update', '.bvfs_get_jobids', '.bvfs_get_jobs', '.bvfs_get_bootstrap', '.bvfs_get_fileindex', '.bvfs_versions', '.bvfs_get_delta', '.bvfs_restore', '.bvfs_cleanup', '.bvfs_decode_lstat', '.bvfs_clear_cache', '.bvfs_update_fv', '.bvfs_delete_fileid', '.setuid', '.ls', '.types', '.query', '.tags']`

### <a name="Bacula--JobType"></a>`Bacula::JobType`

The type of job
Expand Down
32 changes: 10 additions & 22 deletions manifests/director/console.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,16 @@
#
define bacula::director::console (
String[1] $password,
String $conf_dir = $bacula::conf_dir,
String[1] $catalogacl = '*all*',
Array[Enum[
['add'], ['autodisplay'], ['automount'], ['cancel'], ['cloud'], ['create'], ['delete'], ['disable'], ['enable'], ['estimate'],
['exit'], ['gui'], ['help'], ['label'], ['list'], ['llist'], ['messages'], ['memory'], ['mount'], ['prune'], ['purge'], ['query'],
['quit'], ['relabel'], ['release'], ['reload'], ['restart'], ['resume'], ['restore'], ['run'], ['setbandwidth'], ['setdebug'],
['setip'], ['show'], ['sqlquery'], ['status'], ['tag'], ['time'], ['trace'], ['umount'], ['unmount'], ['update'], ['use'], ['var'],
['version'], ['wait'], ['.api'], ['.backups'], ['.clients'], ['.catalogs'], ['.defaults'], ['.die'], ['.dir'], ['.dump'], ['.exit'],
['.events'], ['.filesets'], ['.help'], ['.jobs'], ['.estimate'], ['.jlist'], ['.levels'], ['.messages'], ['.msgs'], ['.pools'],
['.quit'], ['.putfile'], ['.schedule'], ['.sql'], ['.status'], ['.storage'], ['.volstatus'], ['.media'], ['.mediatypes'],
['.locations'], ['.actiononpurge'], ['.bvfs_lsdirs'], ['.bvfs_lsfiles'], ['.bvfs_get_volumes'], ['.bvfs_update'],
['.bvfs_get_jobids'], ['.bvfs_get_jobs'], ['.bvfs_get_bootstrap'], ['.bvfs_get_fileindex'], ['.bvfs_versions'], ['.bvfs_get_delta'],
['.bvfs_restore'], ['.bvfs_cleanup'], ['.bvfs_decode_lstat'], ['.bvfs_clear_cache'], ['.bvfs_update_fv'], ['.bvfs_delete_fileid'],
['.setuid'], ['.ls'], ['.types'], ['.query'], ['.tags'],
]] $commandacl = ['list'],
Optional[String[1]] $jobacl = undef,
Optional[String[1]] $clientacl = undef,
Optional[String[1]] $storageacl = undef,
Optional[String[1]] $scheduleacl = undef,
Optional[String[1]] $poolacl = undef,
Optional[String[1]] $filesetacl = undef,
Optional[String[1]] $whereacl = undef,
String $conf_dir = $bacula::conf_dir,
String[1] $catalogacl = '*all*',
Array[Bacula::Command] $commandacl = ['list'],
Optional[String[1]] $jobacl = undef,
Optional[String[1]] $clientacl = undef,
Optional[String[1]] $storageacl = undef,
Optional[String[1]] $scheduleacl = undef,
Optional[String[1]] $poolacl = undef,
Optional[String[1]] $filesetacl = undef,
Optional[String[1]] $whereacl = undef,
) {
$epp_console_variables = {
name => $name,
Expand Down
104 changes: 104 additions & 0 deletions types/command.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# A Bacula console command
#
# @see https://www.bacula.org/15.0.x-manuals/en/console/Bacula_Enterprise_Console.html
type Bacula::Command = Enum[
# Console Commands
'add',
'autodisplay',
'automount',
'cancel',
'cloud',
'create',
'delete',
'disable',
'enable',
'estimate',
'exit',
'gui',
'help',
'label',
'list',
'llist',
'messages',
'memory',
'mount',
'prune',
'purge',
'query',
'quit',
'relabel',
'release',
'reload',
'restart',
'resume',
'restore',
'run',
'setbandwidth',
'setdebug',
'setip',
'show',
'sqlquery',
'status',
'tag',
'time',
'trace',
'umount',
'unmount',
'update',
'use',
'var',
'version',
'wait',
# Special dot Commands
'.api',
'.backups',
'.clients',
'.catalogs',
'.defaults',
'.die',
'.dir',
'.dump',
'.exit',
'.events',
'.filesets',
'.help',
'.jobs',
'.estimate',
'.jlist',
'.levels',
'.messages',
'.msgs',
'.pools',
'.quit',
'.putfile',
'.schedule',
'.sql',
'.status',
'.storage',
'.volstatus',
'.media',
'.mediatypes',
'.locations',
'.actiononpurge',
'.bvfs_lsdirs',
'.bvfs_lsfiles',
'.bvfs_get_volumes',
'.bvfs_update',
'.bvfs_get_jobids',
'.bvfs_get_jobs',
'.bvfs_get_bootstrap',
'.bvfs_get_fileindex',
'.bvfs_versions',
'.bvfs_get_delta',
'.bvfs_restore',
'.bvfs_cleanup',
'.bvfs_decode_lstat',
'.bvfs_clear_cache',
'.bvfs_update_fv',
'.bvfs_delete_fileid',
'.setuid',
'.ls',
'.types',
'.query',
'.tags',
]

0 comments on commit 493e2bf

Please sign in to comment.