GithubHelp home page GithubHelp logo

retlawrose / httpmi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yahoo/httpmi

0.0 0.0 0.0 27 KB

An HTTP proxy for IPMI commands.

License: Apache License 2.0

Python 95.87% Dockerfile 4.13%

httpmi's Introduction

httpmi

An HTTP proxy for IPMI commands.

Build Status

IPMI is an unencrypted protocol that works over UDP. httpmi provides an HTTP proxy to arbitrary IPMI hosts, as securing HTTP is well-understood. This provides infrastructure operators the ability to perform IPMI control between locations more securely.

Table of Contents

Background

Oath runs a number of edge sites which we wish to control from a central location. Instead of keeping credentials in the edge site and controlling servers from there, we use httpmi to proxy credentials and commands into the site.

Install

Install httpmi via pip. As it isn't currently on PyPI, just clone the repository and run pip install . from the root.

We recommend running the app with uWSGI, which looks something like::

$ uwsgi --http 127.0.0.1:5000 --wsgi httpmi.api --callable app --master

For whatever reason, this doesn't currently work from inside the repository, so cd somewhere else first.

Usage

Every API call uses form data for command parameters and credentials. Every API call must pass the BMC IP address and credentials in the keys bmc, user, and password. Some API calls have additional parameters.

  • GET /power - returns the current power state of the machine. No additional parameters required. Example response:

    {"state": "on"}
    

    Response value may be "on" or "off".

  • POST /power - set the power state for the machine. Returns immediately with the pending power state of the machine if it is changing, or the current state if the machine is already in the requested state. Takes one parameter, "state", which may be "on" or "off". Example response:

    {"state": "on"}
    

    Response value may be "on" or "off".

Some examples in curl::

$ curl -X POST \
       --form user=admin --form password=password \
       --form bmc=10.88.209.247 --form port=6230
       --form state=off \
       http://localhost:5000/power

{"state":"off"}

$ curl -X GET \
       --form user=admin --form password=password \
       --form bmc=10.88.209.247 --form port=6230 \
       http://localhost:5000/power

{"state":"off"}

$ curl -X POST \
       --form user=admin --form password=password \
       --form bmc=10.88.209.247 --form port=6230 \
       --form device=hd \
       http://localhost:5000/boot-device

{"device":"hd"}

$ curl -X GET \
       --form user=admin --form password=password \
       --form bmc=10.88.209.247 --form port=6230 \
       http://localhost:5000/boot-device

{"device":"hd"}

Contribute

Please refer to the contributing.md file for information about how to get involved. We welcome issues, questions, and pull requests. Pull Requests are welcome.

License

This project is licensed under the terms of the Apache 2.0 open source license. Please refer to LICENSE for the full terms.

httpmi's People

Contributors

jimrollenhagen 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.