Writable table as VirtualParameter

George Chelidze george.chelidze at magticom.ge
Sat Apr 14 04:21:01 EDT 2018


Hi Dan,

I have several questions, please find them under the quoted text:

> //Staticly define the data for demonstration purposes. In production,
> I fetch the data from another server.
Do you fetch the data using ext. script?

> What will happen here is on the first run of this script, the port
> mapping will be created. On subsequent runs, in Genie's internal state
> it will first delete all object instances, but then see that the
> desired state at the end is to have a single port mapping, with a name
> of "192.168.1.113:9308 <http://192.168.1.113:9308/> to 9308 (UDP)",
> protocol of UDP, etc. And so no change will be made.
>
> If on subsequent runs, you change any of the parameters, the previous
> instance will be deleted, and a new instance will be created with the
> given values.
You approach is clear, but what I don't like is that you clear the whole
table at the beginning and then create instances according to your
current state. So, if you have for instance 10 port mappings active and
you want to add one more, you first delete these 10 and then create
these 10 again plus one new instance, which is much more work than required.

Two questions to give it a try:

1. When and how do you execute this preset? In my case the trigger for
action should be an API call with whatever parameters will be required,
how can I run a preset triggered by  an API call, not an event from
network (BOOT, INFORM, etc)?

2. Even if I use your solution I still don't understand how can I output
PortMapping table on device summary page. That was my second point when
I explained why I bet for virtual parameter approach. Any ideas?

At the end, thank you very much for your input, it really helps.

Best regards,

George Chelidze
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genieacs.com/pipermail/users/attachments/20180414/794d721d/attachment.html>


More information about the Users mailing list