Showing posts with label API. Show all posts
Showing posts with label API. Show all posts

Thursday, June 2, 2011

A C++ Boost client for the Vyatta REST api

Here's a Vyatta REST client I modifed from a stock Boost https client example. In some tests a while back I found that using a remote command line client implemented in C++/c was significantly faster than using a scripted Perl implementation, which makes sense when latency isn't the overwhelming factor in the latency of the response. And as I alluded to, with claims of performance there are other important criteria that come into play, such as latency, jitter, response time on the server, etc. Needless to say I my queue (somewhere) a pending post to quantify this performance difference using different client implementations.

You can see from the help that the executable requires the target, url (i.e. command), and optionally password/username to run.

Usage: vyatta_boost   [options]
  -h  host name or ip
  -c  rest api command path
  -m  HTTP method (i.e. GET, DELETE, POST, PUT)
  -u  username
  -p  password

And running this command:

Thursday, March 31, 2011

Session support in the Vyatta REST API

While it may not be exactly faithful to RESTful principals, it is a good feature/option that further enhances security.

Authentication in the Vyatta REST API uses standard HTTP basic authentication (and has since day one). Vyatta uses https so the basic authentication parameters (i.e. username and password) are encapsulated within the https protocol to provide a secure channel. Since the auth is contained within each request the server is not required to maintain state (or track a session), as the username and password are presumably good forever.

The downside of this approach is that maintaining a username and password for access can be risky (see this post)

Thursday, February 3, 2011

Growing a REST API, Part 2 of 2

OK, let's jump back into the fray here with part 2 (part 1 is here) of our discussion on the REST API for the Vyatta Appliance thingy. Now, we've already covered the API up to and including the Configuration mode. And found out that commands are relatively simple to construct. What's left you ask? The operational side of things and the weird red headed step-child interface: App mode.

Without further ado then...

Thursday, January 27, 2011

Growing a REST API, Part I of 2

This REST API that I had a hand in (more like both hands in) for the Vyatta router (also known as the Vyatta Remote Access API) was a complete rewrite of a more traditional XML state-aware API (and which replaced an even earlier version).

In retrospect, given the progression of versions it was with REST that the simplest HTTP based API was designed. I'd even say that the work was well focused due to REST constraints applied to the design of the interface.