Configure Category
This conf category enables to configure the Bacula configuration
resources via the Bacula REST API interface. Before using it, it is
required to install and configure the BWeb Management Suite.
Note
The conf category can be used only when the OAuth2 authorization is
enabled.
You must configure the BConfig URI, the web auth option the
BConfig User and the BConfig Password. These fields are
highlighted by the red arrows on the screen shot below.
REST API BWeb configuration
In general, the conf category request format consists in four items:
component type (director, storage, filedaemon, console),
component name (ex. mydirector-dir, storage-sd …etc.),
resource type (ex. job, client, pool, storage …etc.),
resource name (ex. MyJob123, FavClient …etc.).
The conf category request has the following form:
/conf/<component_type>/<component_name>/<resource_type>/<resource_name>/
There are two conf request methods available:
PUTmethod to update resource configuration. If resource doesn’t exist it is created.DELETEmethod to delete resource.
Example request to update configuration job “MyJob”:
PUT /conf/director/mysystem-dir/job/MyJob/
{
"Name": "MyJob",
"Type": "Backup",
"Client": "MyClient",
"Fileset": "MyFileset",
"Pool": "MyPool",
"Schedule": "MySchedule",
"Storage": "MyStorage",
"Messages": "MyMessages"
}
Example request to delete job “MyJob” configuration:
DELETE /conf/director/mysystem-dir/job/MyJob/
After changing configuration it can be useful to commit these changes in the BWeb workset by the following request:
DELETE /conf/director/mysystem-dir/job/MyJob/
with POST param:
commit=1
It is also possible to reload the Bacula Director by:
GET /restart?reload_dir=1
or restart a component by:
GET /restart?restart_dir=1
GET /restart?restart_sd=1
GET /restart?restart_fd=1
See also
Previous articles:
Next articles:
Go back to: REST API.