Create Static API Documentation Site

We recommend using bootprint for this, which converts any OpenAPI-Specification into a static HTML-page.

This is done in 5 steps:

Install Node.js and npm the, Node.js package manager

See the offical Note.js site.

For Linux this is done as follows:

sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm

Install Bootprint

npm install -g bootprint
npm install -g bootprint-openapi

Get a JWT to interact with OpenvCloud

First create an API key in the Settings page of your ItsYou.online profile page:

First copy the generated values of Application ID and Secret in the CLIENT_ID and SECRET environment variables:

CLIENTID="..."
SECRET="..."

Get the JWT into another environment variable:

JWT=$(curl -d 'grant_type=client_credentials&client_id='"$CLIENTID"'&client_secret='"$SECRET"'&response_type=id_token' https://itsyou.online/v1/oauth/access_token)

Get the OpenAPI specification from your OpenvCloud environment

G8="https://be-gen-1.demo.greenitglobe.com"
curl -o openAPI.json -H 'Authorization: Bearer '$JWT $G8/restmachine/system/docgenerator/prepareCatalog?actors=&group=cloudapi&format=jsonraw

Press ctrl+c.

Generate the static HTML page with Bootprint

First create a target directory for the static HTML web page:

mkdir html

Generate the static web page:

PACKAGE_DIR=$(npm config get prefix)
$PACKAGE_DIR/bin/bootprint openapi openAPI.json html

Check the result in your browser of choice, here in Chrome:

open -a "/Applications/Google Chrome.app" html2/index.html

Or make it available as an archive, here using tar:

tar -cvzf G8_CloudAPI_Doc.tar.gz html

For details about the Bootprint command line parameters, refer to the documentation of Bootprint.