This module provide a specific HTTP interface for a Arbiter.
Bases: alignak.http.generic_interface.GenericInterface
Interface for HA Arbiter. The Slave/Master arbiter can get /push conf
Master tells to slave to not run (HTTP GET) Master will ignore this call
Returns: | None |
---|
Return all the data of satellites
Returns: | dict containing satellites data |
---|
Output looks like this
{'arbiter' : [{'schedproperty1':'value1' ..}, {'pollerproperty1', 'value11' ..}, ..],
‘scheduler’: [..], ‘poller’: [..], ‘reactionner’: [..], ‘receiver’: [..],
‘broker: [..]’
}
Return type: | dict |
---|
Get the managed configuration (internal) (HTTP GET)
Returns: | Currently managed configuration |
---|---|
Return type: | object |
‘Dump all objects of the type in [hosts, services, contacts, commands, hostgroups, servicegroups]
Parameters: | table (str) – table name |
---|---|
Returns: | list all properties of all objects |
Return type: | list |
Get the satellite names sorted by type (HTTP GET)
Parameters: | daemon_type (str) – daemon type to filter |
---|---|
Returns: | dict with key daemon_type and value list of daemon name |
Example
{'poller': ['Poller1', 'Poller2']}
Return type: | dict |
---|
Does the daemon got a configuration (internal) (HTTP GET)
Parameters: | magic_hash (int) – magic hash of configuration |
---|---|
Returns: | True if the arbiter has the specified conf, False otherwise |
Return type: | bool |
HTTP POST to the arbiter with the new conf (master send to slave)
Parameters: | conf – pickled the new configuration |
---|---|
Returns: | None |
This module provide a specific HTTP interface for a Broker.
Bases: alignak.http.generic_interface.GenericInterface
This class provides specific HTTP functions for Broker.
This module provide extension functions for Cherrypy in order to parse specific HTTP content type See http://cherrypy.readthedocs.org/en/latest/pkg/cherrypy.html#module-cherrypy._cpreqbody for details about custom processors in Cherrypy
This module provides HTTPClient class. Used by daemon to connect to HTTP servers (other daemons)
Bases: object
HTTPClient class use python request to communicate over HTTP Basically used to get / post to other daemons
Get timeout depending on wait time
Parameters: | wait (int) – wait is short or long (else) |
---|---|
Returns: | self.timeout if wait is short, self.data_timeout otherwise |
Return type: | int |
Create uri from path
Parameters: | path (str) – path to make uri |
---|---|
Returns: | self.uri + path |
Return type: | str |
Do a POST HTTP request
Parameters: | |
---|---|
Returns: | Content of the HTTP response if server returned 200 |
Return type: | str |
Bases: exceptions.Exception
Simple HTTP Exception
This module provide the HTTP daemon for Alignak inter daemon communication. It is mostly based on Cherrypy
Bases: object
HTTP Server class. Mostly based on Cherrypy It uses CherryPyWSGIServer and daemon http_interface as Application
Bases: exceptions.Exception
Exception raised when daemon workdir is invalid
Bases: exceptions.Exception
Exception raised when port is already used by another application
This module provide a generic HTTP interface for all satellites. Any Alignak satellite have at least those functions exposed over network See : http://cherrypy.readthedocs.org/en/latest/tutorials.html for Cherrypy basic HTPP apps.
Bases: object
Interface for inter satellites communications
List the methods available on the daemon
Returns: | a list of methods available |
---|---|
Return type: | list |
List the api methods and their parameters
Returns: | a list of methods and parameters |
---|---|
Return type: | dict |
Get broks from the daemon
Returns: | Brok list serialized and b64encoded |
---|---|
Return type: | str |
Get the external commands from the daemon (internal) Use a lock for this call (not a global one, just for this method)
Returns: | Pickled external command list |
---|---|
Return type: | str |
Get the current log level in [NOTSET, DEBUG, INFO, WARNING, ERROR, CRITICAL, UNKNOWN]
Returns: | current log level |
---|---|
Return type: | str |
Get actions returns (serialized) for the scheduler with _id = sched_id
Parameters: | sched_id (int) – id of the scheduler |
---|---|
Returns: | serialized list |
Return type: | str |
‘Get the current running id of the daemon (scheduler)’
Returns: | running_ig |
---|---|
Return type: | int |
Get the daemon cur_conf state
Returns: | boolean indicating if the daemon has a conf |
---|---|
Return type: | bool |
Test the connection to the daemon. Returns: pong
Returns: | string ‘pong’ |
---|---|
Return type: | str |
Get new actions from scheduler(internal)
Parameters: |
---|
:return:None
Send a new configuration to the daemon (internal)
Parameters: | conf – new conf to send |
---|---|
Returns: | None |
Remove a scheduler connection (internal)
Parameters: | sched_id (int) – scheduler id to remove |
---|---|
Returns: | None |
Set the current log level in [NOTSET, DEBUG, INFO, WARNING, ERROR, CRITICAL, UNKNOWN]
Parameters: | loglevel (str) – a value in one of the above |
---|---|
Returns: | None |
This module provide a specific HTTP interface for a Receiver.
Bases: alignak.http.generic_interface.GenericInterface
This class provides specific HTTP functions for Receiver.
This module provide a specific HTTP interface for a SCheduler.
Bases: alignak.http.generic_interface.GenericInterface
This module provide a specific HTTP interface for a Scheduler.
Get initial_broks type broks from scheduler, used by brokers Do not send broks, only make scheduler internal processing
Parameters: | bname (str) – broker name, used to filter broks |
---|---|
Returns: | None |
TODO: Maybe we should check_last time we did it to prevent DDoS
Get checks from scheduler, used by brokers
Parameters: | bname (str) – broker name, used to filter broks |
---|---|
Returns: | 64 zlib compress pickled brok list |
Return type: | str |
Get checks from scheduler, used by poller or reactionner (active ones)
Parameters: |
|
---|---|
Returns: | base64 zlib compress pickled check/action list |
Return type: | str |
Get raw stats from the daemon:
* nb_scheduled: number of scheduled checks (to launch in the future)
* nb_inpoller: number of check take by the pollers
* nb_zombies: number of zombie checks (should be close to zero)
* nb_notifications: number of notifications+event handlers
* latency: avg,min,max latency for the services (should be <10s)
Returns: | stats for scheduler |
---|---|
Return type: | dict |
Post conf to scheduler (from arbiter)
Parameters: | conf (dict) – new configuration to load |
---|---|
Returns: | None |
Put results to scheduler, used by poller and reactionners
Parameters: | results – results to handle |
---|---|
Returns: | True or ?? (if lock acquire fails) |
Return type: | bool |
This module provide all class for Alignak HTTP communation. Most of files are for server side HTTP. Only client.py is for client side http