Next: , Up: /conf   [Contents][Index]


C.2.1 /conf/files

Request: GET /conf/files

Return list of configuration files. On success, a JSON array is returned. Each array element is an object with two attributes:

Attr: string file

Pathname of the configuration file.

Attr: string syntax

Configuration file syntax (see Syntax).

For example:

GET /conf/files ⇒
[{"file":"/etc/pies.conf", "syntax":"pies"},
 {"file":"/etc/inetd.conf", "syntax":"inetd"}]
Request: POST /conf/files

Adds a new configuration file. The body must be a JSON object with ‘file’ and ‘syntax’ attributes, as described above. The ‘file’ value must contain a pathname of a configuration file written in a syntax supplied by the ‘syntax’ attribute (see Syntax).

This request returns 201 code on success. To actually parse and load the added configuration file, send a ‘PUT’ request to ‘/conf/runtime’ (see /conf/runtime).

Request: DELETE /conf/files/true

Clears all previously configured configuration files. Responds with:

{ "message":"file list cleared", "status":"OK" }
Request: DELETE /conf/files/[list]

Removes files named in the list from the list of configuration files.

The ‘DELETE’ response is 200 on success. To actually update the configuration of the running process, send a ‘PUT’ request to ‘/conf/runtime’ (see /conf/runtime).