# Path: amonagent/settings.py
# class Settings(object):
# 	def __init__(self):


	import json
	import simplejson as json
import requests 
import logging
from amonagent.settings import settings
log = logging.getLogger(__name__)

class ConnectionException(Exception):
	" Raised when the Amon Web interface is not responding"


class Remote(object):

	def __init__(self):
		self.server_key = settings.SERVER_KEY
		self.host = settings.HOST

		self.host = self.host.rstrip("/")


	headers = {"Content-type": "application/json"}
	errors = {'connection': 'Could not establish connection to the Amon API.'}

	def to_json(self, data):
		return json.dumps(data)

	def _post(self, url, data, headers=None):

		headers = headers if headers else self.headers


		try:
			r = requests.post(url, data, headers=headers, timeout=10, 
				stream=False, 
				verify=False

# Path: amonagent/settings.py
# class Settings(object):
# 	def __init__(self):


# Path: amonagent/remote.py
	import json
	import simplejson as json
import requests 
import logging
from amonagent.settings import settings

log = logging.getLogger(__name__)

class ConnectionException(Exception):
	" Raised when the Amon Web interface is not responding"


class Remote(object):

	def __init__(self):
		self.server_key = settings.SERVER_KEY
		self.host = settings.HOST

		self.host = self.host.rstrip("/")


	headers = {"Content-type": "application/json"}
	errors = {'connection': 'Could not establish connection to the Amon API.'}

	def to_json(self, data):
		return json.dumps(data)

	def _post(self, url, data, headers=None):

		headers = headers if headers else self.headers


		try:
			r = requests.post(url, data, headers=headers, timeout=10, 
				stream=False, 
				verify=False

			)