How declare statement will work


In password update provision we are having below declare statement

declare(“Device.ManagementServer.Password”, {value: 1}, {value: password});

This will execute whenever 0 BOOTSTRAP received from device.

So i want to understand what this declare statement will do on both device and server side.

Sets the value of the given parameter on the CPE.

Thank you for your reply.

Yes we understood that it will send the parameter towards CPE to set that value . But we also need to know is whether this declare function will update anything on our DB

Yes. GenieACS caches the values in the Mongo DB.

when GenieACS will update the MongoDB, whether it will update after setparameter request sent to CPE or before setparameter request or after set parameter response received from CPE?

You would need to read the code to confirm, but I believe the values are committed to the db after the CPE acknowledges the SPV.

In the debug logs files,

event: incoming HTTP request

timestamp: 2024-05-09T04:15:22.402Z

connection: 2024-05-09T04:15:22.402Z

this above timestamp timestamp: 2024-05-09T04:15:22.402Z is setparameter response value received from device

but i have checked Database device table password updated time is 2024-05-09T04:15:22.102Z

debuglogs will have exact time of session connection or data wil write in DB after session completed.