Package Products :: Package Zuul :: Package routers :: Module host
[hide private]
[frames] | no frames]

Source Code for Module Products.Zuul.routers.host

 1  ############################################################################## 
 2  # 
 3  # Copyright (C) Zenoss, Inc. 2013, all rights reserved. 
 4  # 
 5  # This content is made available according to terms specified in 
 6  # License.zenoss under the directory where your Zenoss product is installed. 
 7  # 
 8  ############################################################################## 
 9   
10   
11  import logging 
12   
13  from Products import Zuul 
14  from Products.Zuul.routers import DirectRouter 
15  from Products.ZenUtils.Ext import DirectResponse 
16  from Products.Zuul.interfaces import IInfo 
17   
18  log = logging.getLogger('zen.ApplicationRouter') 
19   
20   
21 -class HostRouter(DirectRouter):
22 """ 23 """ 24
25 - def _getFacade(self):
26 return Zuul.getFacade('hosts', self.context)
27
28 - def getAllHosts(self):
29 """ 30 Returns a list of host identifiers. 31 @rtype: DirectResponse 32 @return: B{Properties}: 33 - data: ([String]) List of hosts identifiers 34 """ 35 hosts = self._getFacade().query() 36 nodes = dict((host.id, host) for host in hosts) 37 return DirectResponse.succeed(data=Zuul.marshal(nodes))
38