Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

API offering health metrics for the ``django-server-guardian`` app.

Project Description

API offering health metrics for the Django Server Guardian app.

Installation and Usage

To get the latest stable release from PyPi

pip install django-server-guardian-api

To get the latest commit from GitHub

pip install -e git+git://github.com/bitmazk/django-server-guardian-api.git#egg=server_guardian_api

Add server_guardian_api to your INSTALLED_APPS

INSTALLED_APPS = (
    ...,
    'server_guardian_api',
)

Add the server_guardian_api URLs to your urls.py

urlpatterns = [
    url(r'^server-guardian-api/', include('server_guardian_api.urls')),
]

As a simple auth method add the security token as described in the README of the Django Server Guardian to your settings as SERVER_GUARDIAN_SECURITY_TOKEN

SERVER_GUARDIAN_SECURITY_TOKEN = 'asd0hb42t92-example-token-39gh1g3-91hfosj325'

Add the SERVER_GUARDIAN_PROCESSORS setting where you’re endpoint metrics are defined.

SERVER_GUARDIAN_PROCESSORS = (
    'server_guardian_api.endpoints.mailer_mail',
    'myapp.mymodule.myfunction',
)

The functions defined in this setting must return a dictionary in the following format

{
    'status': 'OK', # must be one of: "OK", "WARNING", "DANGER"
    'info': 'additional text describing the status. e.g. type of error',
}

That mean, your API endpoint will, if all is correct, return something like this

[
    {
        'label': 'mail_queue',
        'status': 'OK',
        'info': "No deferred email queued. That's great!",
    },
    {
        'label': 'other_metric',
        ...
    },
]

Contribute

If you want to contribute to this project, please perform the following steps

# Fork this repository
# Clone your fork
mkvirtualenv -p python2.7 django-server-guardian-api
make develop

git co -b feature_branch master
# Implement your feature and tests
git add . && git commit
git push -u origin feature_branch
# Send us a pull request for your feature branch

In order to run the tests, simply execute tox. This will install two new environments (for Django 1.8 and Django 1.9) and run the tests against both environments.

Release History

Release History

This version
History Node

0.1.2

History Node

0.1.1

History Node

0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-server-guardian-api-0.1.2.tar.gz (7.8 kB) Copy SHA256 Checksum SHA256 Source May 2, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting