Highly trained cats for managing servers.
Project description
CatOps
Highly trained cats for managing servers.
What is CatOps?
CatOps is a very simple NoOps framework for deploying your own ChatOps bot.
Commands you wish to add to your CatOps implementation are added to a plugins folder in the same directory, and will then be automatically imported and callable using the function name.
Features
Completely NoOps.
Easily extensible.
Pay per invocation.
Provider agnostic.
Example
Python handler
from catops import dispatch
import json
def endpoint(event, context):
# event = {'command':['meow', 'hi']} # example event passed to lambda
params = event['command']
try:
s = dispatch(params)
except Exception as err:
s = str(err)
response = {
"statusCode": 200,
"body": json.dumps(s)
}
return response
Example plugin
"""example.py - example plugin for ChatOps."""
def hi(self):
return "Meow!"
Serverless configuration
service: CatOps
package:
include:
- handler.py
- plugins/**
custom:
pythonRequirements:
slim: true
provider:
name: aws
runtime: python3.6
profile: serverless
functions:
dispatcher:
handler: handler.endpoint
events:
- http:
path: ping
method: get
plugins:
- serverless-python-requirements
Deploy and Test
serverless deploy
serverless invoke --function dispatcher --path /path/to/json/data --log
See examples for more.
Installation
sudo apt-get install npm # install node
sudo npm install -g serverless # install serverless
npm install serverless-python-requirements # install serverless-python-requirements in the same directory as serverless.yml
pip install catops
FAQ
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
catops-0.0.5.tar.gz
(6.1 kB
view hashes)
Built Distribution
Close
Hashes for catops-0.0.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f85af411b886fbfa4bd12e0d6d81a0ddfaf59da3745d4c27fb24bd4ba567329 |
|
MD5 | 0b7f695848b0001977bde3e45618b0b7 |
|
BLAKE2b-256 | e123016f6d42337724987aa8a9bb9279b2b99b4040559355a45df855eb5d1a72 |