Provisioning scripts

Dan Morphis dan at milkcarton.com
Wed Mar 8 14:29:23 EST 2017


On Wed, Mar 8, 2017 at 10:16 AM, Zaid Abdulla <zaid at genieacs.com> wrote:

>
> > Second, is there an easier way of declaring values on an instance
> > than the approach I'm using?
> > //Ensure we have a WANPPPConnection instance
> > declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANP
> > PPConnection.*", null, {path: 1});
> > //Set the connection values
> > declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANP
> > PPConnection.*.Name", {value: now}, {value: "Internet"});
> > declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANP
> > PPConnection.*.ConnectionType", {value: now}, {value: "IP_Routed"});
> > declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANP
> > PPConnection.*.X_BROADCOM_COM_IfName", {value: now}, {value:
> > "ppp0.1"});
> > declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANP
> > PPConnection.*.NATEnabled", {value: now}, {value: true});
> > declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANP
> > PPConnection.*.X_BROADCOM_COM_FirewallEnabled", {value: now}, {value:
> > true});
> > declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANP
> > PPConnection.*.Enable", {value: now}, {value: true});
> > declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANP
> > PPConnection.*.PPPoEServiceName", {value: now}, {value:
> > "broadband"});
>
> No, sorry :) I don't see how it can be made easier. Do you have
> something in mind?
>
> How about something like this:
 let instance =
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.*",
null, {path: 1});
instance.Name = {value: "Internet", _timestamp: Date.now()};
instance.NATEnabled = {value: true, _timestamp: Date.now()};
...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genieacs.com/pipermail/users/attachments/20170308/1352e793/attachment.html>


More information about the Users mailing list