Send Netdot-devel mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://osl.uoregon.edu/mailman/listinfo/netdot-devel
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Netdot-devel digest..."


Today's Topics:

   1. [Netdot - Support #1892] Help with API ([email protected])
   2. [Netdot - Support #1892] (Closed) Help with API
      ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Sat, 7 May 2016 12:00:12 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Support #1892] Help with API
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1892 has been updated by Carlos Vicente.


Hello Mark,

Mark Shetka wrote:
> Greetings,
> 
> I am just getting started with Netdot and it's API and am hung up on a few 
> things.
> 
> 1) Is there a way to search by mac address? Seems like this should do it
> "dhcpscope?physaddr=0026B98D9FFE"
> but throws an error. My workaround is to get the entire dhcpscope table and 
> search through the results.

In that case you are searching for DhcpScope, in which the MAC address is a 
foreign key. Try looking up the PhysAddr object first, and use the id of the 
PhysAddr record in the DhcpScope search.


> 2) What is the syntax for wildcards in a search. For example, give me all 
> hostnames that match "*-sw-*".

I think that this is not supported currently. The handle_resource method in 
REST.pm passes the search arguments to search() and not search_like. Perhaps a 
change could be made to detect wildcards in the query string and make that 
decision. 

> 
> 3) How can I join multiple tables in one query. For example, return the 
> hostname and IP address for everything where "monitored=true" (join Ipblock 
> and rraddr).

You can't do that with simple REST queries. You can, however, write a special 
REST resource to do more complex operations (and of course, contribute it back 
to the project)
 
> 4) Is there a way to limit the fields returned? For example, given a hostname 
> just return it's IP address.

There is not.

> 
> As I said, I'm new to Netdot and using an API (normally I would query a 
> database directly). Any help and/or API examples beyond what is in the 
> documentation would be appreciated. I am using Netdot::Client::REST with Perl.
> 

Patches to code and documentation are always welcome.

Best,

cv
----------------------------------------
Support #1892: Help with API
https://osl.uoregon.edu/redmine/issues/1892#change-3344

Author: Mark Shetka
Status: New
Priority: Normal
Assignee: 
Category: 
Target version: 
Resolution: 


Greetings,

I am just getting started with Netdot and it's API and am hung up on a few 
things.

1) Is there a way to search by mac address? Seems like this should do it
"dhcpscope?physaddr=0026B98D9FFE"
but throws an error. My workaround is to get the entire dhcpscope table and 
search through the results.

2) What is the syntax for wildcards in a search. For example, give me all 
hostnames that match "*-sw-*".

3) How can I join multiple tables in one query. For example, return the 
hostname and IP address for everything where "monitored=true" (join Ipblock and 
rraddr).

4) Is there a way to limit the fields returned? For example, given a hostname 
just return it's IP address.

As I said, I'm new to Netdot and using an API (normally I would query a 
database directly). Any help and/or API examples beyond what is in the 
documentation would be appreciated. I am using Netdot::Client::REST with Perl.

Thanks,

Mark


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://osl.uoregon.edu/redmine/my/account


------------------------------

Message: 2
Date: Sat, 7 May 2016 12:00:35 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Support #1892] (Closed) Help with
        API
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1892 has been updated by Carlos Vicente.

Status changed from New to Closed


----------------------------------------
Support #1892: Help with API
https://osl.uoregon.edu/redmine/issues/1892#change-3345

Author: Mark Shetka
Status: Closed
Priority: Normal
Assignee: 
Category: 
Target version: 
Resolution: 


Greetings,

I am just getting started with Netdot and it's API and am hung up on a few 
things.

1) Is there a way to search by mac address? Seems like this should do it
"dhcpscope?physaddr=0026B98D9FFE"
but throws an error. My workaround is to get the entire dhcpscope table and 
search through the results.

2) What is the syntax for wildcards in a search. For example, give me all 
hostnames that match "*-sw-*".

3) How can I join multiple tables in one query. For example, return the 
hostname and IP address for everything where "monitored=true" (join Ipblock and 
rraddr).

4) Is there a way to limit the fields returned? For example, given a hostname 
just return it's IP address.

As I said, I'm new to Netdot and using an API (normally I would query a 
database directly). Any help and/or API examples beyond what is in the 
documentation would be appreciated. I am using Netdot::Client::REST with Perl.

Thanks,

Mark


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://osl.uoregon.edu/redmine/my/account


------------------------------

_______________________________________________
Netdot-devel mailing list
[email protected]
https://osl.uoregon.edu/mailman/listinfo/netdot-devel


End of Netdot-devel Digest, Vol 110, Issue 3
********************************************

Reply via email to