Skip to main content

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


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)

Uploaded Source

Built Distribution

catops-0.0.5-py2.py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page