API: Fix an error in the jvm api definition

List is not a supported type. Use Array for list of elements.
Error in the API causes the httpserver code generation to fail.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Http Server: Add json path support

Path information is defined in the Swagger API definition file.  This include
the url path (e.g. /os/version) the method (GET/POST) and a nickname.

A patch in the API is mapped to a path_description object and is stored in a
hash so it can be located by its nickname.

The actuall mapping of the json to c++ code is done by an extenrnal json script
during the compilation

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Http Server: Support Json objects

Json objects are struct that inherit from json_base and that all their
members are json_element.

To be able to format a json object, each of its member has a name and a
flag that mark if it is set or not.

All json element inherit from json_base_element that holds the set bit a
name and a flag that specify if it is mandatory or optional.

Most json element will instantiate the json_element template with a
type.

A specific json_element implementation handles list.  A json list is set
(and will be part of the result) if a value was pushed to it.

The json_base, a base class to all json objects, holds a vector of
elements, an inherit class will set its member in the base class vector.
This mimic reflection functionality, allowing to iterate over the class
members.

The ability to iterate over the class member is used by the format
method and the verify method

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Http Server: Expend the formatter

The formatter, format various data types to json.

This patch adds support for two additional types: unsigned long used in
the os.json swagger file and json objects.

If obj is a json object, to get a string representation of it, it should
be possible to call:

formatter::to_json(obj);

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Http Server: Routes can be configure with a json path

The json_path object are initilized with information taken from the
swagger definition file.

Route defintion can use a json_path object to set a route to a handler.
If os_version is a pointer to a handler and "getOSversion" is a nickname
of the operation, it should be possible to call:

routes.add_path("getOSversion", os_version);

to set the path

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Http Server: auto code generation script

The python script creates json objects and json path from the json
swagger definitions.  For each json file there a header file which
contain any object definition, and a source file which contain the path
initilization, that can later be used to declare a path in the route
object

The script is run from the makefile during the compilation

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Http Server: Makefile support code generation

The Makefile uses dependcy rules to create cc/hh files from json files.
Temporary source files are kept to allow code brawsing.

make clean will delete the autogen code as well

This patch also contains the removal of libraries dependencies from the
linkage of the so file object

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Http Server: Initilize the route from the json path definition

The json_path is initilized based on the Swagger json API definition
setting the route to match the os version operation is done by the
operation nickname.

In this situation, if the API will be modified the path will be changed
accordingly without any changes to the code.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>