Writable table as VirtualParameter

Dan Morphis dan at milkcarton.com
Sun Apr 15 18:25:48 EDT 2018



-dan

> On Apr 14, 2018, at 11:28 PM, George Chelidze <george.chelidze at magticom.ge> wrote:
> 
> Hi Dan,
> 
> Please see my comments below.
> 
>> The 10 entries aren’t actually deleted. Genie tracks the desired
>> state, sees that there is no change to the 10 entries, doesn’t mess
>> with them. It will only create the new entry.
> Hm, Can you explain how the following declare won't delete everything
> under the basePath?
Because nothing is actually done until the end. When you do declares, you are declaring the desired state. Nothing actually happens to the CPE unless it needs to. 

> 
> declare(basePath + ".[]", null, {path: 0}); // Tell Genie we want to
> delete everything, this won't actually happen unless the instances don't
> match up (i.e. an instance was deleted)
> 
>> Genie doesn’t have that capability yet. So I fake it :). I create a
>> tag on the device called NeedsPortMappings. Then I have a preset with
>> the trigger being said tag name which initiates the provision script.
>> Then to get the preset to fire I initiate a connection request to the
>> CPE. Not ideal, but it works.
> Makes sense as far as it works.
> 
>> Look in the parameters.yml file in the GUI. It does the same type of
>> thing for device hosts. Remember to restart the GUI after making
>> changes to the file.
> Do you mean the following example in summary_parameters.yml?
Yes
> 
> Hosts:
>     _object: InternetGatewayDevice.LANDevice.1.Hosts.Host
>     Host name: HostName
>     IP: IPAddress
>     MAC: MACAddress
> 
> If yes, then it's a bad example as it contains a particular instance {1}
> of LANDevice. What I am looking for is something like this:
> 
> _object: InternetGatewayDevice.LANDevice.*.Hosts.Host
> 
> or
> 
> _object: InternetGatewayDevice.LANDevice.[0-9]+.Hosts.Host
> 
> Then I could adapt it for PortMapping path:
> InternetGatewayDevice.WANDevice.{i}.WANConnectionDevice.{i}.WANIPConnection.{i}.PortMappingas
> we have no idea that instances will be used on one particular device.
Then you will need to write code to make it work. You can write GUI functions. I don’t recall the exact syntax to configure them.
> 
> I agree that my original approach is complicated and it might not be
> following the Genie's style of doing things, but I still wonder whether
> it's possible or not to define virtual parameter which is a writable table.
> 
> Best regards,
> 
> George Chelidze
> _______________________________________________
> Users mailing list
> Users at lists.genieacs.com
> http://lists.genieacs.com/mailman/listinfo/users


More information about the Users mailing list