GithubHelp home page GithubHelp logo

mozilla / build-slaveapi Goto Github PK

View Code? Open in Web Editor NEW
0.0 15.0 7.0 1.35 MB

INACTIVE - http://mzl.la/ghe-archive - Part of releng tooling

License: Mozilla Public License 2.0

Python 100.00%
inactive unmaintained

build-slaveapi's Introduction

slaveapi

Running Slaveapi ++++++++++++++++

First, copy slaveapi.ini.sample to slaveapi.ini and put it somewhere that config files belong. Edit the file to customize your settings. You probably want to adjust the [server] port and [secrets] credentials_file parameters, at least.

Credentials File

The credentials file should be a JSON file with the following keys:

  • inventory -- the password for inventory access
  • ipmi -- the IPMI password
  • bugzilla -- the Bugzilla API password
  • ssh -- a mapping of usernames to lists of passwords for those usernames; the passwords will be tried sequentially.
  • snmp_community -- snmp_community string used for PDU reboots

Example:

{ "inventory": "sekrit1", "ipmi": "sekrit2", "bugzilla": "sekrit3", "ssh": { "foobld": [ "new", "old", "older", "oldest" ], "administrator": [ "New", "Old", "Older", "Oldest" ] } }

Developing Slaveapi +++++++++++++++++++

Setting up a Development Environment

To set up a dev environment, install slaveapi into a virtualenv using pip -e, then copy the slaveapi.ini as described above. Create credentials.json in the current directory as well, based on the example above, and set the path in slaveapi.ini to an unqualified "credentials.json". Make sure [server] daemonize is set to false in the config file, then run

python slaveapi-server.py start slaveapi.ini

Adding New Actions

If you're creating a new action that doesn't require any new data gathering or other support code, the process is as follows:

  • Create a new action in slaveapi/actions. Your action can make use of any of the clients in slaveapi/clients if desired/helpful.
  • Create a new endpoint that makes use of your action. ** Actions that generally take more than a short amount of time to run should be pushed onto the work queue. Actions that are generally quick may wait on a result before returning. slaveapi/web/slave.py has examples of both. ** Your endpoint should generally accept at least GET and POST. POSTs should be used to accept new action requests. GETs will look up the status of existing actions, generally by requestid.
  • Hook your endpoint up to the application in slaveapi/web/init.py.

If SlaveAPI doesn't already gather the information you need to do create your action, you may need to touch some of the client code (eg, if you need extra information from Inventory) or the Slave class (eg, if you need to compute new things from existing data).

build-slaveapi's People

Contributors

alinselagea avatar bhearsum avatar callek avatar ccooper avatar djmitche avatar jhopkinsmoz avatar kmoir avatar lundjordan avatar petemoore avatar theharshest avatar

Watchers

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