From b082e74524a3bf74c55f15f1690f9ea139df0682 Mon Sep 17 00:00:00 2001 From: Henning Jacobs Date: Mon, 12 Dec 2016 21:12:06 +0100 Subject: [PATCH] bootstrap --- .gitignore | 3 +++ app.py | 24 ++++++++++++++++++++++++ swagger.yaml | 22 ++++++++++++++++++++++ templates/index.html | 8 ++++++++ 4 files changed, 57 insertions(+) create mode 100644 .gitignore create mode 100755 app.py create mode 100644 swagger.yaml create mode 100644 templates/index.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..33d2034 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +__pycache__ +*.swp +*.pyc diff --git a/app.py b/app.py new file mode 100755 index 0000000..52837d2 --- /dev/null +++ b/app.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 + +import gevent.monkey +gevent.monkey.patch_all() + +import connexion +import flask +from gevent.wsgi import WSGIServer + + +app = connexion.App(__name__) + +@app.app.route('/') +def index(): + return flask.render_template('index.html') + + +def get_clusters(): + pass + +app.add_api('swagger.yaml') + +if __name__ == '__main__': + app.run(port=8080, server='gevent') diff --git a/swagger.yaml b/swagger.yaml new file mode 100644 index 0000000..3d007a7 --- /dev/null +++ b/swagger.yaml @@ -0,0 +1,22 @@ +swagger: "2.0" +info: + title: Kubernetes Operational View + version: "1.0" +produces: + - application/json +paths: + /kubernetes-clusters: + get: + summary: Get Kubernetes clusters + operationId: app.get_clusters + responses: + "200": + description: List of Kubernetes clusters + schema: + type: object + properties: + kubernetes_clusters: + type: object + properties: + api_server_url: + type: string diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..bd6f04b --- /dev/null +++ b/templates/index.html @@ -0,0 +1,8 @@ + + + Kubernetes Operational View + + + + +