]> git.sur5r.net Git - bacula/docs/commitdiff
baculum: Add chapter about config Bacula resource via api
authorMarcin Haba <marcin.haba@bacula.pl>
Sun, 12 Nov 2017 17:26:26 +0000 (18:26 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Sun, 12 Nov 2017 17:27:51 +0000 (18:27 +0100)
docs/manuals/en/console/baculum.tex

index 261f6f2443225a05667037b180e48c45562dd60b..da22a50af3ce0c8f9782e77116440425a184edc3 100644 (file)
@@ -619,7 +619,21 @@ GET /api/jobs/ - get records all jobs.
 
 GET /api/jobs/limit/20 - get records first 20 jobs.
 
-GET /jobs/8 - get records only for job with jobid equal 8.
+GET /api/jobs/8 - get records only for job with jobid equal 8.
+
+GET /api/jobs/tasks/ - get job names for all directors
+
+GET /api/jobs/tasks/type/B - get backup job names
+
+GET /api/jobs/tasks/type/R/limit/5 - get first 5 restore job names
+
+GET /api/jobs/recent/myjob/client/myclient-fd/filesetid/62/ - get most
+recent job identifiers for job "myjob", client "myclient-fd" and fileset
+with filesetid 62
+
+GET /api/jobs/recent/myjob/clientid/31/filesetid/62/ - get most
+recent job identifiers for job "myjob", client with clientid 21 and fileset
+with filesetid 62
 
 POST /jobs/estimate/ - call estimate action on a job.
 
@@ -663,7 +677,7 @@ POST /jobs/estimate/ - call estimate action on a job.
 * - required field
 \end{verbatim}
 
-POST /jobs/run/ - call run action on job (run job).
+POST /api/jobs/run/ - call run action on job (run job).
 
 \begin{verbatim}
 +-----------------------------------------------------------------------------+
@@ -723,7 +737,7 @@ POST /jobs/run/ - call run action on job (run job).
 * - required field
 \end{verbatim}
 
-POST /jobs/restore/ - call restore action.
+POST /api/jobs/restore/ - call restore action.
 
 \begin{verbatim}
 +-----------------------------------------------------------------------------+
@@ -734,9 +748,6 @@ POST /jobs/restore/ - call restore action.
 | create[rpath] *   | string  | Bvfs temporary table name for restore purpose |
 |                   |         | in form: b2[0-9]+                             |
 +-------------------+---------+-----------------------------------------------+
-| create[fileset] * | string  | FileSet resource name                         |
-|                   |         |                                               |
-+-------------------+---------+-----------------------------------------------+
 | create[clientid] *| integer | Client identifier                             |
 |                   |         | (used instead of client name)                 |
 +-------------------+---------+-----------------------------------------------+
@@ -756,11 +767,14 @@ POST /jobs/restore/ - call restore action.
 |                   |         | - ifnewer                                     |
 |                   |         | - always                                      |
 +-------------------+---------+-----------------------------------------------+
+| create[restorejob]| string  | Restore job name                              |
+| *                 |         |                                               |
++-------------------+---------+-----------------------------------------------+
 
 * - required field
 \end{verbatim}
 
-DELETE /jobs/8 - delete by bconsole job with jobid equal 8.\\
+DELETE /api/jobs/8 - delete by bconsole job with jobid equal 8.\\
 
 Errors:
 
@@ -874,7 +888,7 @@ POST /api/bvfs/restore/ - preparing Bvfs paths for restore command.
 +-----------------------------------------------------------------------------+
 |                      /api/bvfs/restore/ POST request                        |
 +-------------------+---------+-----------------------------------------------+
-| Name             |  Type   |    Description                                |
+| Name              |  Type   |    Description                                |
 +-------------------+---------+-----------------------------------------------+
 | create[jobids] *  | string  | job identifiers comma separated               |
 |                   |         |                                               |
@@ -919,6 +933,59 @@ Errors:
 
 1000 - Internal error.
 
+\subsection{Config}
+
+To configure the Bacula resources is used request in the following URL form:\\
+
+PUT /api/config/COMPONENT\_TYPE/RESOURCE\_TYPE/RESOURCE\_NAME
+
+\begin{itemize}
+\item COMPONENT\_TYPE: dir for Director, sd for Storage Daemon, fd for
+ File Daemon and bcons for Consoles
+\item RESOURCE\_TYPE: Job, Client, Pool, Messages, Schedule, Storage...etc.
+\item RESOURCE\_NAME: Resource name from 'Name' resource directive like
+ 'My Client 123', 'Device-01', 'Pool-Incremental-2' ...etc.
+\end{itemize}
+
+Example config URLs:\\
+
+PUT /api/config/dir/Client/myclient-fd - editing client 'myclient-fd'. If
+ the Client doesn't exist, it is created in config.
+
+PUT /api/config/sd/Device/Drive-01 - editing device 'Drive-01'. If
+ the Device doesn't exist, it is created in config.
+
+\begin{verbatim}
++-----------------------------------------------------------------------------+
+|    /api/config/component_type/resource_type/resource_name/ PUT request      |
++-------------------+---------+-----------------------------------------------+
+| Name              |  Type   |    Description                                |
++-------------------+---------+-----------------------------------------------+
+| update[config] *  | string  | Bacula config in JSON format.                 |
+|                   | (JSON)  |                                               |
+|                   |         | In versions lower than 9.0.6 instead of JSON  |
+|                   |         | string there was used serialized associative  |
+|                   |         | PHP array                                     |
++-------------------+---------+-----------------------------------------------+
+
+* - required field
+\end{verbatim}
+
+Example cURL commands to test:
+
+\begin{verbatim}
+curl -X PUT -d update["config"]='{"AutoPrune":false,"Catalog":"MyCatalog",
+"FdPort":9102,"MaximumConcurrentJobs":5,"Name":"easystar-fd","Address":
+"172.16.10.12","Password":"mypass"}'
+ http://user:pass@apihost:9096/api/config/dir/Client/easystar-fd
+
+curl -X PUT -d update["config"]='{"RemovableMedia":true,"RandomAccess":false,
+"AutomaticMount":true,"AlwaysOpen":true,"OfflineOnUnmount":true,"DeviceType":
+"Tape","Name":"TapeDrive","MediaType":"LTO5","ArchiveDevice":"/dev/nst0",
+"SpoolDirectory":"/mnt/backup","MaximumOpenWait":300}'
+ http://user:pass@apihost:9096/api/config/sd/Device/TapeDrive
+\end{verbatim}
+
 \section{Installation from the Source Tar File}
 
 You may also install Baculum from the source bacula-gui tar archive.