Skip to main content

This Django app serves as the REST API for Salt.

Project description

This Django app serves as a REST API for Salt. It is basically a very thing wrapper around the salt-api package.

The main motivation behind creating a Django package to interface with Salt is that Django is already in our software stack. And secondly, from our tests it seems that salt-api is taking a few percent CPU all the time, even when supposedly idle. Perhaps that will be fixed in a future release of salt-api but for now this package is a good workaround for us.

This package comes with some caveats. This app compared to salt-api:

  • this app only supports x-www-form-urlencoded data input for the API wrapper or input snarfed from the URL, whereas salt-api supports other data formats

  • this app only supports JSON data output

Installation

  1. Add django_saltapi to your INSTALLED_APPS setting in your project settings.py:

    INSTALLED_APPS = (
        [...]
        'django_saltapi',
    )
  2. Add Salt settings in your project settings.py:

    SALT_CONFIG = {
        'master_config': '/etc/salt/master',
    }
  1. Include the package URLconf in your project urls.py like so:

    url(r'^api/salt/', include('django_saltapi.urls')),

Usage

  1. Visit http://salt/api/salt/ to view the default static HTML page.

  2. Issue a Salt ping to all minions via the API wrapper:

    django-saltapi '*' test.ping
  3. Issue a Salt ping via explicitly exposed functions:

    django-saltapi-ping all
    django-saltapi-echo all x

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

django-saltapi-0.7.5.tar.gz (5.1 kB view hashes)

Uploaded Source

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