# Return object for virtual parameter

**URL:** <https://forum.genieacs.com/t/return-object-for-virtual-parameter/1888>\
**Category:** Uncategorized\
**Created:** [July 27, 2021, 12:04am UTC](https://forum.genieacs.com/t/return-object-for-virtual-parameter/1888 "2021-07-27T00:04:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavidReubenWhite](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/davidreubenwhite/32/157_2.png) [@DavidReubenWhite](https://forum.genieacs.com/u/DavidReubenWhite)\
**Post date:** [July 27, 2021, 12:04am UTC](https://forum.genieacs.com/t/return-object-for-virtual-parameter/1888/1 "2021-07-27T00:04:20Z")

</div>

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?

 ![Screen Shot 2021-07-27 at 12.10.31 PM](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/1X/ba6f56996bce3ed108422e183959292b47474584.png)

Thanks,

David.

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [July 27, 2021, 7:40pm UTC](https://forum.genieacs.com/t/return-object-for-virtual-parameter/1888/2 "2021-07-27T19:40:45Z")

</div>

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:

v1  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/1X/70657816d42ae55e3a1a1fbd28132d86c1cf6661.png)

v2

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/1X/9f76714aa64334b3e9757da9d2c3aa72c7da1ec8.png)  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/1X/a57794f9a149ca78c048f938132d59960d3c2eea.png)

---

<div class="post-metadata">

**Author:** ![DavidReubenWhite](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/davidreubenwhite/32/157_2.png) [@DavidReubenWhite](https://forum.genieacs.com/u/DavidReubenWhite)\
**Post date:** [July 27, 2021, 9:00pm UTC](https://forum.genieacs.com/t/return-object-for-virtual-parameter/1888/3 "2021-07-27T21:00:19Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [July 27, 2021, 9:18pm UTC](https://forum.genieacs.com/t/return-object-for-virtual-parameter/1888/4 "2021-07-27T21:18:01Z")

</div>

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:

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

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

```

v1:  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/1X/9f854883429279c8283ccc565ac99d0f1fcaf61c.png)

v2:

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/1X/871d59470af15824d70f85ecdd9c2ef3c2d091ef.png)

---

<div class="post-metadata">

**Author:** ![DavidReubenWhite](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/davidreubenwhite/32/157_2.png) [@DavidReubenWhite](https://forum.genieacs.com/u/DavidReubenWhite)\
**Post date:** [July 27, 2021, 9:29pm UTC](https://forum.genieacs.com/t/return-object-for-virtual-parameter/1888/5 "2021-07-27T21:29:30Z")

</div>

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