예제 #1
0
 def _query(zk):
     responses = fire(zk, token, 'info')
     return {
         key: hints
         for key, (_, hints, code) in responses.items()
         if code == 200
     }
예제 #2
0
 def _query(zk):
     responses = fire(zk, '*', 'info')
     return {
         key: hints['process']
         for key, (_, hints, code) in responses.items()
         if code == 200
     }
예제 #3
0
 def _query(zk):
     responses = fire(zk, cluster, 'info')
     return {
         key:
         '%d\t\t%s' % (hints['ports'][port], hints['public'])
         for key, (_, hints, code) in responses.items()
         if code == 200 and port in hints['ports']
     }
예제 #4
0
                        def _query(zk):
                            out = {}
                            responses = fire(zk, token, 'info')
                            for pod, (_, hints, code) in responses.items():
                                if code == 200:
                                    out[pod] = '[%s / %s] @ %s (%s)' % \
                                               (hints['state'], hints['process'], hints['node'], hints['public'])

                            return len(responses), out
예제 #5
0
            def _query(zk):

                #
                # - this closure will run in our zookeeper proxy actor
                # - in this case we'll HTTP POST a /info query to all our pods (you can use a glob pattern)
                # - fire() will figure out where the pods are running from and what their control port is
                # - we simply return the number of pods who answered with HTTP 200
                # - please note all the I/O is done on parallel for each pod and the outcome aggregated for you
                #
                responses = fire(zk, '*', 'info')
                return sum(1 for key, (_, _, code) in responses.items() if code == 200)
예제 #6
0
파일: port.py 프로젝트: d2e/ochopod
 def _query(zk):
     responses = fire(zk, cluster, 'info')
     return {key: '%d\t\t%s' % (hints['ports'][port], hints['public'])
             for key, (_, hints, code) in responses.items() if code == 200 and port in hints['ports']}
예제 #7
0
파일: ls.py 프로젝트: d2e/ochopod
 def _query(zk):
     responses = fire(zk, '*', 'info')
     return {key: hints['process'] for key, (_, hints, code) in responses.items() if code == 200}
예제 #8
0
 def _query(zk):
     return fire(zk, token, 'control/off')
예제 #9
0
 def _query(zk):
     return fire(zk, token, 'reset')
예제 #10
0
 def _query(zk):
     return fire(zk, token, 'log')