OPNsense Forum

English Forums => Development and Code Review => Topic started by: darsen on June 07, 2021, 08:53:03 am

Title: Data Grids in OPNSense - Where is data stored ?
Post by: darsen on June 07, 2021, 08:53:03 am
Hi Everyone,

I am developing a service plugin and I would like to integrate a Grid form in it.  :D

I am using the following documentation page as a reference (Using grids module & plugin): https://docs.opnsense.org/development/examples/using_grids.html

Everything is clear, but I don't understand two things.

# First Question
Where are the settings saved ? - When calling the API /api/gridexample/settings/searchItem from where are the items fetched ?
I was expecting a ".conf" ini file somewhere in the filesystem containing all the data but I cannot see it anywhere.

# Second Question
How do I retrieve the settings data from my backend application (eg python script) ?

Thanks a lot for clarification!

Aleksandar
Title: Re: Data Grids in OPNSense - Where is data stored ?
Post by: franco on June 07, 2021, 10:11:14 am
Settings are stored in /conf/config.xml naturally.

Backend data is read/created via https://docs.opnsense.org/development/backend/configd.html and can be read via:

$stats = trim((new Backend())->configdRun('compinentname dataprovider'));


Cheers,
Franco