Mailing List Archive

Prototype REST code
Hi folks,

I just added the first bit of prototype REST code to the system. Its
purpose it to provide an interface for JavaScript UI code yet to be
written ;-).

It uses the Flask library to provide the http support.

There is currently only one interesting URL supported by the code:
doquery/<queryname>

So, you perform a query by sending an http request to the
doquery/<queryname> URL.

Parameters to the query are supplied in the usual ? format.

Here are a few examples of queries:

http://localhost:5000/doquery/GetAllQueries
retrieve information (metadata) about all valid queries

http://localhost:5000/doquery/GetAQuery?queryname=<somequeryname>:*
get detailed information about a particular query (metadata)

http://localhost:5000/doquery/ListDrones
lists all known machinesand their status (in detail)

http://localhost:5000/doquery/DownDrones
lists all known machines which are currently down for any reason


http://localhost:5000/doquery/CrashedDrones
lists all known machines which are currently down because
they crashed


Also, there is a hack in the code, where it reads some data from a
location that needs to be installed -- but isn't yet. So it's hardwired
to a pathname on my machine. That'll get fixed tomorrow.

But the cool thing is that it works, and that it spits out what looks to
me like good JSON.

Lots to be tested, but it's a reasonable start (a minor milestone).

The main other thing that comes to mind is to allow a client to
subscribe to changes to things.

But before that it would be cool to have any kind of a primitive piece
of code that used this interface.




--
Alan Robertson <alanr@unix.sh> - @OSSAlanR

"Openness is the foundation and preservative of friendship... Let me claim from you at all times your undisguised opinions." - William Wilberforce
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/