Newton Cloud Hub APIs

Gianluca Cornetta Apr 20, 2018

NEWTON fab labs are a complex distributed system. The networked fab labs need to be integrated and seamlessly managed with a unique and flexible interface that must expose all the underlying infrastructure as a web service and provide the developers with tools to expand and enhance the software infrastructure. This design goal can be easily accomplished using APIs (Application Program Interfaces). Unlike legacy integration techniques like middleware and enterprise service buses, APIs are built with cloud computing in mind and hence are particularly appealing for a hybrid multicloud environment like NEWTON fab labs, where public and private clouds are interconnected with private enterprise LANs. However, API technology is not just limited to cloud set-ups and can be successfully deployed also in on-premise IT systems to allow seamless integration and communications between applications.

API Interfacing

NEWTON fab lab APIs adhere to widely accepted industrial standards. If you have a look to the project GitHub repository shown in Fig. 1, you will see a swagger.yaml file. This file is a textual description of the cloud API features using Swagger 2.0 (now Open API). Swagger specification is an API description format for REST APIs that allows you to describe:

  1. The available endpoints and the HTTP verb to use.

  2. Operation parameters (e.g. query strings), inputs and outputs for each operation.

  3. Authentication.

NEWTON Connector GitHub Repository

Fig. 1: The cloudhubAPI GitHub repository.

You can use the API specifications either to test the APIs or to generate a REST client for your target platform or language using Swagger Hub. If you don't want to create a Swagger Hub account, you can also access the Swagger code generator at this url.

NEWTON Swagger Editor

Fig. 2: The Swagger editor interface.

Fig.2 shows the Swagger Editor window. The tool parses the APIs specifications on the left-hand side and outputs the APIs documentation on the right-hand side. You can navigate through the documentation and even test the API endpoints. The tool also provides a code generation feature that automatically delivers either client-side or server-side code from the YAML file with the specifications. You can use this feature to generate the client code to connect to the fab lab APIs.

Gianluca Cornetta

Node.js and JavaScript enthusiast.