Metadata-Version: 2.1
Name: centreonapi
Version: 0.1.6
Summary: Centreon Api for use Webservice in Centreon Web 2.8.0 or later
Home-page: https://github.com/guillaumewatteeux/centreon-sdk-python
Author: Guillaume Watteeux
Author-email: g@15x.fr
License: Apache-2.0
Keywords: centreonapi
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Requires-Dist: requests
Requires-Dist: bs4

=============================
Centreon SDK Python
=============================

.. image:: https://badge.fury.io/py/centreonapi.png
    :target: http://badge.fury.io/py/centreonapi

.. image:: https://travis-ci.com/guillaumewatteeux/centreon-sdk-python.svg?branch=master
    :target: https://travis-ci.org/guillaumewatteeux/centreon-sdk-python

Make a Python LIB for Centreon API

Forked from https://github.com/centreon/centreon-sdk-python

Install
-------

.. code-block:: shell

    $ pip install centreonapi

Usages
------

* Connect to Centreon platform

.. code-block:: python

    from centreonapi.centreon import Webservice
    centreon = centreon("https://centreon.mydomain.tld, "admin", "centreon")

* List all hosts on Centreon platform

.. code-block:: python

    centreon.hosts.list()
    >>>
    {
      'Centeon-central': Centeon-central,
      'server1': myserver1
    }


* Add new host

.. code-block:: python

    centreon.hosts.add(
      name='server1',
      alias='DBServ',
      ip=127.0.0.1,
      template="DB-Host-Template",
      hg="DB Servers"
      )

* Get host

.. code-block:: python

    _, myhost = centreon.hosts.get('server1')
    myhost.name
    >>>
    server1

* Macros

Get macros

.. code-block:: python

    _, macros = myhost.getmacro()
    macros
    >>>
    {
      '$_HOSTMODULESTATSFILE$': $_HOSTMODULESTATSFILE$,
      '$_HOSTMYSQLPASSWORD$': $_HOSTMYSQLPASSWORD$,
      '$_HOSTMYSQLPORT$': $_HOSTMYSQLPORT$,
    }

    mymacro = macros.get('$_HOSTMYSQLPORT$')
    mymacro.value
    >>>
    3306

Set Macros

.. code-block:: python

    myhost.setmacro('SECRETMACRO', 'pass', 1, 'secret macro pass')

* HostTemplate on host

.. code-block:: python

    myhost.gettemplate()
    >>>
    {
      'App-Monitoring-Centreon-Central-custom': App-Monitoring-Centreon-Central-custom,
      'App-Monitoring-Centreon-Database-custom': App-Monitoring-Centreon-Database-custom,
      'App-Monitoring-Centreon-Poller-custom': App-Monitoring-Centreon-Poller-custom
    }


Documentation
-------------

Complete documentation here_

.. _here: https://centreonapi.readthedocs.io/

Features
--------

* TODO




Documentation
-------------

The full documentation is at http://centreonapi.rtfd.org.



History
-------

0.1.5 (2019-02-16)
++++++++++++++++++

* Beta version

0.1.0 (2018-12-14)
++++++++++++++++++

* First release on PyPI.


