Skip to content

Commit

Permalink
bumped orochi version
Browse files Browse the repository at this point in the history
  • Loading branch information
mlakewood committed Jul 7, 2015
1 parent 51ad744 commit 1c5bf85
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
Binary file not shown.
25 changes: 22 additions & 3 deletions orochi_python/orochi.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Orochi(object):

def __init__(self, path=None, port=None):
if path == None:
jar_name = 'orochi-0.1.0.jar'
jar_name = 'orochi-0.1.1.jar'
path = os.path.join(os.path.dirname(__file__), "binary/{}".format(jar_name))

if port == None:
Expand Down Expand Up @@ -36,7 +36,26 @@ def start(self, timeout=5):
break
return self.orochi

def add_proxy(self, name, backend, front_port, command):
def add_pass_through_proxy(self, name, backend, front_port, command):
typed_backend = {"type": "proxy",
"payload": backend
}

self._add_proxy(name, typed_backend, front_port, command)

def add_mock_proxy(self, name, backend, front_port, command):
typed_backend = {"type": "mock-request",
"payload": backend
}
self._add_proxy(name, typed_backend, front_port, command)

def add_web_hook_proxy(self, name, backend, front_port, command):
typed_backend = {"type": "web-hook",
"payload": backend
}
self._add_proxy(name, typed_backend, front_port, command)

def _add_proxy(self, name, backend, front_port, command):
request = {"name": name,
"backend": backend,
"front-port": front_port,
Expand All @@ -50,7 +69,7 @@ def get_proxy(self, name):
if response.status_code == 200:
data = json.loads(response.content)
return data
return false
return False


def shutdown_proxies(self):
Expand Down

0 comments on commit 1c5bf85

Please sign in to comment.