Coder Social home page Coder Social logo

webpy's Introduction

Webpy

A Simple python web service for IT automation

使用

安装依赖

pip install -r requirements.txt

启动server

cd webpy/web
python app.py <port> # 启动server并在port上监听

handler例子-Jdk7Installer

访问: curl http://<server_url>:/Jdk7Installer?host=&host=

扩展handler

在handlers里面创建任意的xxxHandler.py文件, 在里面定义好Handler类和Handler的name即可

name = xxx

class xxHandler(Handler):
  pass # define your content
  

访问: curl <server_url>:/${custom_handler_name}, 如果handler想接受参数,参考Jdk7Installer

NOTE: ${custom_handler_name} 是在XXXHandler里面的name指定的名字

后续计划

考虑增加查询命令,查询帮助等的api

webpy's People

Watchers

James Cloos avatar PengchengLiu 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.