#213 NHaystack service : walk me through a site to discover all available points using HTTP GETs only,

Chase Turner Mon 22 Sep 2014

In the following, assume I have an HTTP client only and my goal is to explore a Niagara AX 3.6.406.5 site where the latest JAR from NHaystack is deployed as a service.

My initial walk begins with http://foobar.com/haystack/nav and a verification of what operations are available via http://foobar.com/haystack/ops

After that, I'm lost as to how to compose successive URLs to "navigate" sub-hierarchy of the site to discover all the points & datums within.

What I am seeking in this posting are two items:

a) A live reference site with a NHaystack service running; and

b) Examples (given the site's published documentation of what is there) of how to compose the HTTP GET requests so as to "walk" the site's structure (e.g., cycle of "what is available at this level?" followed by "get me these leafs" or "descend to this next sub-level and see what is there").

NOTE: My ultimate objective is to use www.wolfram.com/mathematica as the HTTP client -- running Mathematica code -- that will actively crawl a NHaystack site to identify what datums are available, and from there, conduct queries to pull relevant data slices.

Jason Briggs Mon 22 Sep 2014

Chase Turner wrote

a) A live reference site with a NHaystack service running; and

We currently don't have a live site running where someone can hit it, but if you have a server and you wanted to do that, that would be great :}

Chase Turner wrote

b) Examples (given the site's published documentation of what is there) of 
   how to compose the HTTP GET requests so as to "walk" the site's 
   structure (e.g.,   cycle "what is available at this level?" 
   followed by "get me these leafs" or "descend   to this next   
   sub-level and see what is there").

Here are some examples on how you can read things out of Niagara. http://localhost/haystack/read?filter=axType == "kitControl:Ramp"

Read a History

http://localhost:85/haystack/[email protected]&range=today

Walk the tree using nav Op "nav","Navigate record tree"

http://10.10.10.107/haystack/nav

The above will return this

ver:"2.0"
navId,dis
"slot:/","ComponentSpace"
"his:/","HistorySpace"
"sep:/","Site"

The nav op takes a navId parameter, so now you can walk the tree by picking which tree you want to walk. Let's pick the sep:/ tree below.

http://10.10.10.107/haystack/nav?navId=sep:/

So now you know how to walk the tree, you just do the same thing by passing in the navId as the parameter using the nav op.

Christian Tremblay Mon 22 Sep 2014

I'm actually working on a Python module to browse a haystack servers. It's actually really beta but I did complete login feature to authenticate on Niagara AX and get every histories as Dataframe.

It may be possible to use python from Mathematica (?)... my goal is to use Pandas.

As I said, it's actually really beta (it's in fact a learning project), there's a lot of work to make it really nice but I really want it to be open source (and get help from others :0)

I may share if you are interested.

Login or Signup to reply.