API query returning all devices.
Dan Morphis
dan at milkcarton.com
Fri Mar 3 13:03:00 EST 2017
In v1.1, the query param for /devices changes from "device" to "_id"
Remember to url encode your query:
/devices?query=%7B%22_id%22%3A%22EC4F82-ONT-CXNK00309984%22%7D&projection=
InternetGatewayDevice.LANDevice
On Fri, Mar 3, 2017 at 8:53 AM, Scott Miller <cubicalmonkey at gmail.com>
wrote:
> Was wondering if anyone else is seeing this or if I'm simply doing
> something wierd.
>
> Using GenieACS 1.1 When I query by ID or WAN Mac address via API, Im
> returning all devices.
> FWIW This was working as expected in version 1.0.
>
> Query by MAC:
> query={"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.1.
> WANIPConnection./^\\d+$/.MACAddress" :"'. _MAC($mac) .'"}&projection=
> InternetGatewayDevice.LANDevice
>
> Query by ID:
> query={"device":"EC4F82-ONT-CXNK00309984"}&projection=
> InternetGatewayDevice.LANDevice
>
>
> Returned Data:
> {
> '_id' => 'EC4F82-ONT-CXNK0030C7A5',
> 'InternetGatewayDevice' => {
> 'LANDevice' => {
> *** SNIP ***
> }
> } },
> {
> '_id' => '0000CA-DG2470A-G5UBSY89A600319'
> },
> {
> '_id' => 'EC4F82-ONT-CXNK00309998',
> 'InternetGatewayDevice' => {
> 'LANDevice' => {
> *** SNIP ***
> }
> }
> }
>
>
> _______________________________________________
> Users mailing list
> Users at lists.genieacs.com
> http://lists.genieacs.com/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genieacs.com/pipermail/users/attachments/20170303/b76d10ec/attachment.html>
More information about the Users
mailing list