Giter Site home page Giter Site logo

gateway's Introduction

Swagger generated server

Overview

This server was generated by the swagger-codegen project. By using the OpenAPI-Spec from a remote server, you can easily generate a server stub. This is an example of building a swagger-enabled Flask server.

This example uses the Connexion library on top of Flask.

Requirements

Python 3.5.2+

Running with Docker

The certificate of the emulab user must be downloaded first and put under local directory such as .bssw similar to geni-lib documentation.

To run the server on a Docker container, please execute the following from the root directory:

# building the image
docker build -t swagger_server .

# starting up a container
docker run --rm -it \
    --env-file .env \
    -p 127.0.0.1:8888:8080 \
    -v /var/log/:/var/log/ \
    -v ~/.bssw/ssh/id_emulab_rsa:/root/.ssh/id_rsa:ro \
    -v ~/.bssw/ssh/config:/root/.ssh/config:ro \
    -v ~/.bssw/geni-emulab:/root/.bssw/geni/ \
    -d \
    swagger_server

and open your browser to here:

http://127.0.0.1:8888/aerpawgateway/1.0.0/ui/

Your Swagger definition lives here:

http://127.0.0.1:8888/aerpawgateway/1.0.0/swagger.json

logging file: /var/log/aerpaw-gateway.log

Usage without docker

To run the server, please execute the following from the root directory:

pip3 install -r requirements.txt
pip3 install werkzeug==0.16.1
cd geni-lib
python3 setup.py install
cd ..
# cp perl/* <somewhere> and make sure .env points to here
source .env
python3 -m swagger_server

To launch the integration tests, use tox:

sudo pip install tox
tox

gateway's People

Contributors

efu39 avatar yufengxin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.