API query returning all devices.

Scott Miller cubicalmonkey at gmail.com
Fri Mar 3 13:28:16 EST 2017


Thanks!   I missed the param change from device to _id.
That was my problem.

On Fri, Mar 3, 2017 at 1:03 PM, Dan Morphis <dan at milkcarton.com> wrote:

> 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.WANConnectionDevic
>> e.1.WANIPConnection./^\\d+$/.MACAddress" :"'. _MAC($mac)
>> .'"}&projection=InternetGatewayDevice.LANDevice
>>
>> Query by ID:
>> query={"device":"EC4F82-ONT-CXNK00309984"}&projection=Intern
>> etGatewayDevice.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
>>
>>
>
> _______________________________________________
> 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/9c4a4229/attachment-0001.html>


More information about the Users mailing list