Filesystem API
The /filesystem endpoint exposes a restricted view of editable configuration files under $OPENNMS_HOME/etc.
All operations require the FILESYSTEM EDITOR role; editing users.xml additionally requires the ADMIN role.
Only files with one of the following extensions are accessible: xml, properties, boot, cfg, drl, groovy, bsh, dcb, and a file must reside within etc (search depth 4).
GETs (reading data)
| Resource | Description |
|---|---|
|
Lists the accessible files. Optional query parameter |
|
Lists the supported file extensions. Produces |
|
Returns Markdown help for a file. Query parameter |
|
Returns the contents of a file. Query parameter |
POSTs (Creating Data)
POST consumes multipart/form-data and produces text/html.
| Resource | Description |
|---|---|
|
Uploads (creates or overwrites) a file.
XML files are validated before being written. |
DELETEs (Removing Data)
DELETE produces text/html.
| Resource | Description |
|---|---|
|
Deletes a file. Query parameter |
Examples using cURL
curl -u admin:admin "http://127.0.0.1:8980/opennms/rest/filesystem"
curl -u admin:admin "http://127.0.0.1:8980/opennms/rest/filesystem?changedFilesOnly=true"
curl -u admin:admin "http://127.0.0.1:8980/opennms/rest/filesystem/contents?f=discovery-configuration.xml"
curl -u admin:admin -F "upload=@discovery-configuration.xml" \
"http://127.0.0.1:8980/opennms/rest/filesystem/contents?f=discovery-configuration.xml"
curl -u admin:admin -X DELETE "http://127.0.0.1:8980/opennms/rest/filesystem/contents?f=obsolete.xml"