class NamespaceApp(object): def __init__(self): self._ns_manager = NamespaceManager() def list_namespaces(self): return self._ns_manager.get_all_namespaces() def get_namespace(self, namespace): return self._ns_manager.get_namespace(namespace) def list_namespaces_ips(self): return self._ns_manager.get_all_namespaces_ips()
class NamespaceApp(StateLessBaseApp): NAME = "NAMESPACE" def __init__(self): self._ns_manager = NamespaceManager() @exposed def list_namespaces(self): return self._ns_manager.get_all_namespaces() @exposed def get_namespace(self, namespace): return self._ns_manager.get_namespace(namespace) @exposed def list_namespaces_ips(self): return self._ns_manager.get_all_namespaces_ips()