I have a need to temporarily store arbitrary data about a CPE in GenieACS. Right now, I’m using Tags and splitting on the _ in the tag name to encode multiple pieces of information. This works, but is kind of hacky. Now I also need to store the date of the event and so I end up with a really long and ugly Tag: Diag_Download_CAF_2019-01-17T17-48-47Z
The pieces of information I need to store are event type (Diagnostic), diagnostic to be performed (Download), initiator of the diagnostic event (CAF) and the time the event was requested. I need to store the time so I can know when a diagnostic event has not completed in the expected time and do the appropriate action.
So I guess my request would be for either a better way to externally add structured information to a device instance, or maybe turning Tags into first class citizens in the data model by making them full objects with _timestamp, _type, _value, etc.
You got a fault because the returned value after the set operation doesn’t match the declared value, so it kept trying.
This works for me using latest master:
// args: [{declare timestamps}, {declare values}, {current timestamps}, {current values}]
let value;
if ("value" in args[1]) // Set declared value
value = args[1].value;
else if ("value" in args[3]) // No declared value, keep current value
value = args[3].value;
else // No current value, use default
value = ["default value", "xsd:string"];
return {"writable": true, "value": value};
You’re welcome! On your original suggestion, I have been thinking of replacing tags with a ‘metadata’ structure which is a flat key-value map. Just like tags, this structure can be updated through the API without having to reach the device. Does that sound like what you originally had in mind?
If the value can be complex, I.e. and object, then it would work perfectly for me.
Speaking of reaching the device, I notice when I update the vparam via SPV, genie does a connection request to the CPE, but doesn’t do any other actions on the device. Probably an artifact of how things work under the covers, and not a huge deal.
The more I think about this, while JSON would work, it create a lot of extra work from the perspective that I then have to manage the entire JSON payload. I.e., instead of doing a deleteObject for some sub-item (Metadata.Diagnostics.DSL.Line1), I would have to manage all of that in my app, and make sure I don’t collide with another session (i.e., read all of the Metadata.Diagnostics data in, decode the JSON, add/delete/modify anything I need to, then do a SPF).
I don’t know how difficult it would be to make the Metadata structure be able to complex object (much like the rest of the TR-069 data model), but if its not a lot of work, that would be my preference.
It sounds like you’d be better off storing that in its own database and integrate using an extension. Because even if this metadata idea comes to fruition it’ll probably be a simple key-value map.