- Requests
- urllib3
- logging
- json
URLCHOICES => a list of uris that are used to switch between the different objects that icinga2 provides
"host": "/v1/objects/hosts",
.
.
.
"users": "/v1/objects/users",
Does not take any parameters.
Sets the default logger for debugging.
Creates a Session object that is used as the single connection to Icinga2.
Updates the Session Headers to include 'Accept': 'application/json'
Disables the urllib3 warning for self-signed certificates.
Parameters taken:
- username
- password
- url
Sets the baseurl as well as the username and Password needed for authentication.
WARNING: This function is deprecated and will be removed in a later version
Parameters taken:
- uri
Uses HTTP-GET to retrieve data from baseurl + uri. Returns a dictionary that is parsed from json.
Parameters taken:
- uri
Uses HTTP-DELETE to remove objects from icinga2 Returns a dictionary that is parsed from json.
Parameters taken:
- uri
- data
Uses HTTP-PUT to create new objects in Icinga2 Returns a dictionary that is parsed from json.
Parameters taken:
- uri
- data
Uses HTTP-PUT to create new objects in Icinga2 Returns a dictionary that is parsed from json.