add namespace to all apis

This commit is contained in:
tifayuki 2016-11-16 14:24:50 -08:00
commit 256de5d2cc
27 changed files with 248 additions and 204 deletions

View file

@ -13,11 +13,14 @@ logger = logging.getLogger("python-dockercloud")
class Events(StreamingAPI):
def __init__(self):
def __init__(self, namespace=""):
endpoint = "events"
if dockercloud.namespace:
if not namespace:
namespace = dockercloud.namespace
if namespace:
url = "/".join([dockercloud.stream_host.rstrip("/"), "api", "audit", self._api_version,
dockercloud.namespace, endpoint.lstrip("/")])
namespace, endpoint.lstrip("/")])
else:
url = "/".join([dockercloud.stream_host.rstrip("/"), "api", "audit", self._api_version,
endpoint.lstrip("/")])