Welcome, Guest. Please login or register.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - nvon001

Pages: [1]
1
Database / Re: API query.php syntax
« on: April 09, 2020, 08:18:31 PM »
Sorry to keep prodding at this, but I am able to do some workarounds with the API, but am getting stuck now with whitespaces:

https://1.1.1.1:8443/query.php?t=interfaces&q=ifdesc+=+Ethernet1/1 LAG:Po500

I am trying to tie a portchannel to actual physical interfaces by using the 'ifdesc' field, but having that white space between 'Ethernet1/1 LAG:Po500' isn't getting read correctly.  I've tried %20 to replace the whitespace, also tried quotes, but it seems the query is only reading the string before the white space.

2
Database / Re: API query.php syntax
« on: March 13, 2020, 02:05:52 PM »
I appreciate the response.  Looking forward to the documentation, and keep up the good work!

3
Database / Re: API query.php syntax
« on: February 10, 2020, 07:58:15 PM »
An additional question on the API.  Can I refine my API query for example, if I only wanted to display the Serial number of a specific device, or do I need to use a sql client to further my searches?

Example, I want to only show the serial number for a specific device using SQL queries:

SELECT serial FROM devices  WHERE device = 'devicea_test'

Using Postman:
https://1.1.1.1:8443/query.php?t=devices&q=device+=+devicea_test&q=serial+=+*

The postman query above won't work because I obviously don't know the syntax to only display serial number for the devicea_test device.  The SQL client queries seem for me anyways easier.  Do you have information on the syntax involved in different types of queries using the API, or is it one of those things where I need to open up a PHP book, and start reading. 
Only other thing I can do is to pull all the data down for the device and parse it via python for the serial number to display, or just use the SQL client to get at the specific piece of data.

4
Database / Re: API query.php syntax
« on: February 10, 2020, 03:44:00 PM »
Perfect thank you, appreciate the quick response!

I got it to work with using what you sent, and removing the quotes:

https://1.1.1.1:8443/query.php?t=devices&q=device+=+devicea_test

5
Database / Re: API query.php syntax
« on: February 08, 2020, 01:14:36 AM »
Some more information.  I think I found the place where the error gets triggered located in the query.php file.  I get a "ERR :400 Invalid query!" message.

 }else{
                                        $q = explode(' ',$query);
                                        if( preg_match('/\W/',$q[0]) or !preg_match('/^([=~<>&|]|LIKE)$/',$q[1]) ){
                                        #if( preg_match('/\W/',$q[0]) {
                                                echo "ERR :400 Invalid query!";
                                                die;
                                        }else{
                                                if( $q[1] == '~' ) $q[1] = $dbregexp;
                                                $query = " WHERE $q[0] $q[1] '".DbEscapeString($link,$q[2])."'";
                                        }
                                }

6
Database / API query.php syntax
« on: February 07, 2020, 08:08:28 PM »
Hello, I am hoping to get some ideas/assistance with the API access.  I am using postman and curl to get data on all devices for example, but am unable to query a specific device:
Good Query:
https://1.1.1.1:8443/query.php?t=devices

Bad Query
https://1.1.1.1:8443/query.php?t=devices&q=device="devicea_test"

I receive a ERR :400 Invalid Query.

I can use the sql queries also that gets me the specific device data.  I am not sure how to troubleshoot the API and php.  I am using Mariadb as my database engine.

Thanks for any guidance you can give me on this.

7
Discovery / Re: VRF Discovery on Nexus 7k
« on: October 28, 2019, 03:52:40 PM »
Thanks you!  Looking forward to the update. 

8
Discovery / VRF Discovery on Nexus 7k
« on: September 18, 2019, 11:58:58 PM »
Hi all, I am looking to see if anyone has figured out a way to show VRFs for Cisco Nexus 7ks.  It would be helpful when looking at the routing table of each VRF.  The only routing table I do see in Nedi right now is for the default VRF routing table.

Thanks for any input!

Pages: [1]