Return object for virtual parameter

I see a question was asked quite a while ago about using virtual parameters for Hosts objects i.e I have devices that use both InternetGatewayDevice and Device models.

So I want to be able to return an object from a virtual parameter.

Without this it’s pretty hard to support both device models.

Is this possible yet?



This is not directly supported. The work around is to JSON.stringify and JSON.parse the data.

Are you trying to display the device host list in a third party app? If so, I recommend putting the logic in there for data model v1 and v2. The data models in a lot of areas are so drastically different that trying to abstract all the logic away behind vparams is a losing proposition.

Here area few screenshots from our subscriber mgmt platform showing roughly the same info for data model v1 (InternetGatewayDevice.) and v2 (Device.) devices:



Thanks for the response Dan.

I want to be able to display the device hosts list in genieacs under the “device” section.

I think what I will end up doing is having two genieacs instances, one for each model. The TR098 server will be the primary, and if a device informs using TR181, it will shunt them off to the other server.

You’re right - vparams work great until you need to store an object in the device model.

To me, this is quite a big issue. (being able to display / interact with data from different device models)

There is already a built in way of displaying hosts that abstracts away device v1 and v2.

I’m not sure where you put this in GenieACS v1.2, but in v1.1 in our summary_paramters.yml file I have this:

    _object: InternetGatewayDevice.LANDevice.1.Hosts.Host
    Host name: HostName
    IP: IPAddress
    Source: AddressSource
    Active: Active
    IFace: InterfaceType
    MAC: MACAddress

    _object: Device.Hosts.Host
    Host name: HostName
    IP: IPAddress
    Source: AddressSource
    Active: Active
    IFace: Layer1Interface
    MAC: PhysAddress



That is awesome! Didn’t know that. Thank you very much :slight_smile: