예제 #1
0
    def info(self, service_id):
        service = BaseClient.info(self, service_id)

        print 'persistent:', service['persistent']
        print 'osd_volume_size:', service['osd_volume_size']

        nodes = self.callmanager(service['sid'], "list_nodes", False, {})
        if 'error' in nodes:
            return

        print nodes

        for role in ('dir', 'mrc', 'osd'):
            print "\n", role.upper(), "nodes:"

            for node in nodes[role]:
                params = {'serviceNodeId': node}
                details = self.callmanager(service['sid'], "get_node_info",
                                           False, params)

                if 'error' in details:
                    print node, details['error']
                    continue

                if role == 'dir':
                    port = 30638

                if role == 'osd':
                    port = 30640

                if role == 'mrc':
                    port = 30636

                print "http://%s:%s" % (details['serviceNode']['ip'], port)
예제 #2
0
파일: xtreemfs.py 프로젝트: dzeno/conpaas
    def info(self, service_id):
        service = BaseClient.info(self, service_id)

        print 'persistent:', service['persistent']
        print 'osd_volume_size:', service['osd_volume_size']

        nodes = self.callmanager(service['sid'], "list_nodes", False, {})
        if 'error' in nodes:
            return

        print nodes

        for role in ( 'dir', 'mrc', 'osd' ):
            print "\n", role.upper(), "nodes:"

            for node in nodes[role]:
                params = { 'serviceNodeId': node }
                details = self.callmanager(service['sid'], "get_node_info", False, params)

                if 'error' in details:
                    print node, details['error']
                    continue

                if role == 'dir':
                    port = 30638

                if role == 'osd':
                    port = 30640
                    
                if role == 'mrc':
                    port = 30636

                print "http://%s:%s" % (details['serviceNode']['ip'], port)
예제 #3
0
파일: htc.py 프로젝트: ConPaaS-team/conpaas
    def info(self, service_id):
        service = BaseClient.info(self, service_id)
        nodes = self.callmanager(service['sid'], "list_nodes", False, {})
    	print type(nodes)    
        for n in nodes:
            print n + "	:	" +str(nodes[n])

        if 'dict' in service:
            print service['dict']
예제 #4
0
    def info(self, service_id):
        service = BaseClient.info(self, service_id)

        nodes = self.callmanager(service['sid'], "list_nodes", False, {})
        if not 'error' in nodes:
            for node in nodes['helloworld']:
                params = { 'serviceNodeId': node }
                details = self.callmanager(service['sid'], "get_node_info", False, params)
                print "helloworld agent:", details['serviceNode']['ip']
예제 #5
0
    def info(self, service_id):
        service = BaseClient.info(self, service_id)

        nodes = self.callmanager(service['sid'], "list_nodes", False, {})
        if not 'error' in nodes:
            for node in nodes['helloworld']:
                params = {'serviceNodeId': node}
                details = self.callmanager(service['sid'], "get_node_info",
                                           False, params)
                print "helloworld agent:", details['serviceNode']['ip']
예제 #6
0
 def info(self, service_id):
     service = BaseClient.info(self, service_id)
     
     nodes = self.callmanager(service['sid'], "list_nodes", False, {})
     if 'node' in nodes:
         # Multiple nodes
         for node in nodes['node']:
             params = { 'serviceNodeId': node }
             details = self.callmanager(service['sid'], "get_node_info", False, params)
             print "node url:", "http://%s:3306" % details['serviceNode']['ip']
예제 #7
0
    def info(self, service_id):
        service = BaseClient.info(self, service_id)

        nodes = self.callmanager(service['sid'], "list_nodes", False, {})
        if 'scalaris' in nodes:
            for node in nodes['scalaris']:
                params = { 'serviceNodeId': node }
                details = self.callmanager(service['sid'], 
                    "get_node_info", False, params)

                print "management server url:",
                print "http://%s:8000" % details['serviceNode']['ip']
예제 #8
0
    def info(self, service_id):
        service = BaseClient.info(self, service_id)

        nodes = self.callmanager(service['sid'], "list_nodes", False, {})
        if 'scalaris' in nodes:
            for node in nodes['scalaris']:
                params = {'serviceNodeId': node}
                details = self.callmanager(service['sid'], "get_node_info",
                                           False, params)

                print "management server url:",
                print "http://%s:8000" % details['serviceNode']['ip']
예제 #9
0
    def info(self, service_id):
        service = BaseClient.info(self, service_id)
        
        nodes = self.callmanager(service['sid'], "list_nodes", False, {})

        for node in nodes['masters']:
            params = { 'serviceNodeId': node }
            details = self.callmanager(service['sid'], "get_node_info", False, params)
            print "master url:", "mysql://%s:3306" % details['serviceNode']['ip']

        for node in nodes['slaves']:
            params = { 'serviceNodeId': node }
            details = self.callmanager(service['sid'], "get_node_info", False, params)
            print "slave url: ", "mysql://%s:3306" % details['serviceNode']['ip']
예제 #10
0
    def info(self, service_id):
        service = BaseClient.info(self, service_id)

        nodes = self.callmanager(service['sid'], "list_nodes", False, {})
        if 'error' in nodes:
            return 

        for what in 'proxy', 'web', 'backend':
            print what,
            for proxy in nodes[what]:
                params = { 'serviceNodeId': proxy }
                details = self.callmanager(service['sid'], "get_node_info", False, params)
                print details['serviceNode']['ip'],

            print
예제 #11
0
    def info(self, service_id):
        service = BaseClient.info(self, service_id)

        nodes = self.callmanager(service["sid"], "list_nodes", False, {})

        for node in nodes["nodes"]:
            params = {"serviceNodeId": node}
            details = self.callmanager(service["sid"], "get_node_info", False, params)
            node_info = details["serviceNode"]
            print "node: ip=%s cloud=%s vmid=%s" % (node_info["ip"], node_info["cloud"], node_info["vmid"])

        for node in nodes["glb_nodes"]:
            params = {"serviceNodeId": node}
            details = self.callmanager(service["sid"], "get_node_info", False, params)
            node_info = details["serviceNode"]
            print "glb node: ip=%s cloud=%s vmid=%s" % (node_info["ip"], node_info["cloud"], node_info["vmid"])
예제 #12
0
    def info(self, service_id):
        service = BaseClient.info(self, service_id)

        nodes = self.callmanager(service['sid'], "list_nodes", False, {})
        if 'master' in nodes and nodes['master']:
            # Only one master
            master = nodes['master'][0]
            params = { 'serviceNodeId': master }
            details = self.callmanager(service['sid'], "get_node_info", False, params)
            print "master:", details['serviceNode']['ip']

        if 'node' in nodes:
            # Multiple nodes
            for node in nodes['node']:
                params = { 'serviceNodeId': node }
                details = self.callmanager(service['sid'], "get_node_info", False, params)
                print "node:", details['serviceNode']['ip']
예제 #13
0
    def info(self, service_id):
        service = BaseClient.info(self, service_id)

        nodes = self.callmanager(service['sid'], "list_nodes", False, {})
        if 'masters' in nodes:
            for master in nodes['masters']:
                params = { 'serviceNodeId': master }
                details = self.callmanager(service['sid'], 
                    "get_node_info", False, params)

                print "master namenode url:", 
                print "http://%s:50070" % details['serviceNode']['ip']

                print "master job tracker url:", 
                print "http://%s:50030" % details['serviceNode']['ip']

                print "master HUE url:", 
                print "http://%s:8088" % details['serviceNode']['ip']
예제 #14
0
    def info(self, service_id):
        service = BaseClient.info(self, service_id)

        nodes = self.callmanager(service['sid'], "list_nodes", False, {})
        if 'masters' in nodes:
            for master in nodes['masters']:
                params = {'serviceNodeId': master}
                details = self.callmanager(service['sid'], "get_node_info",
                                           False, params)

                print "master namenode url:",
                print "http://%s:50070" % details['serviceNode']['ip']

                print "master job tracker url:",
                print "http://%s:50030" % details['serviceNode']['ip']

                print "master HUE url:",
                print "http://%s:8088" % details['serviceNode']['ip']
예제 #15
0
    def info(self, service_id):
        service = BaseClient.info(self, service_id)
        
        nodes = self.callmanager(service['sid'], "list_nodes", False, {})
        if 'hub' in nodes and nodes['hub']:
            # Only one HUB
            hub = nodes['hub'][0]
            params = { 'serviceNodeId': hub }
            details = self.callmanager(service['sid'], "get_node_info", False, params)
            print "hub url: ", "http://%s:4444" % details['serviceNode']['ip'], "\tVMid: %s" % details['serviceNode']['id'] 
            print "node url:", "http://%s:3306" % details['serviceNode']['ip'], "\tVMid: %s" % details['serviceNode']['id']

        if 'node' in nodes:
            # Multiple nodes
            for node in nodes['node']:
                params = { 'serviceNodeId': node }
                details = self.callmanager(service['sid'], "get_node_info", False, params)
                print "node url:", "http://%s:3306" % details['serviceNode']['ip'], "\tVMid: %s" % details['serviceNode']['id']
예제 #16
0
파일: taskfarm.py 프로젝트: dzeno/conpaas
    def info(self, service_id):
        service = BaseClient.info(self, service_id)

        # This call gives a urllib2.URLError "Connection reset by peer" quite
        # often...
        res = self.callmanager(service['sid'], "get_service_info", False, {})

        #data = simplejson.dumps(res);
        # print "data:", data 
        print "mode:", res['mode']
        print "phase:", res['phase']
        print "total tasks:", res['noTotalTasks']
        print "completed tasks:", res['noCompletedTasks']
        print "money spent sampling:", res['moneySpentSampling']
        print "money spent:", res['moneySpent']
        if res['noCompletedTasks'] > 0:     # 
            if res['state'] != 'RUNNING':
                print "Busy %s, please wait..." % res['phase']
                return
            sres = self.callmanager(service_id, "get_sampling_results", False, {}) # in json format
            sdata = simplejson.loads(sres)
            if 'timestamp' in sdata:        # Sampling is ready, check if bag is ready, or if we have to choose a schedule
                ts = sdata['timestamp']
                print strftime("Bag sampled on %a %d %b %Y at %H:%M:%S %Z", localtime(ts/1000))
                if 'schedules' in sdata:
                    #sch = sdata['schedules']
                    #ss = simplejson.dumps(sch)
                    # print "schedules: ", ss
                    if len(sdata['schedules']) == 0:
                        print "Bag finished during sampling phase"
                        return
                    if res['noTotalTasks'] == res['noCompletedTasks']:
                        print "Taskfarm finished"
                        return
                    count = 0
                    print "Schedules to choose from:"
                    print "%s\t%6.6s\t%6.6s" % ('Sched#','Time', 'Cost')
                    for sched in sdata['schedules']:
                        count = count + 1
                        print "%s:\t%6.6s\t%6.6s" % ( count, sched['time'], sched['cost'] )
                return
            print "error in samplingresults: ", sdata 
예제 #17
0
    def info(self, service_id):
        service = BaseClient.info(self, service_id)

        # This call gives a urllib2.URLError "Connection reset by peer" quite
        # often...
        res = self.callmanager(service['sid'], "get_service_info", False, {})

        #data = simplejson.dumps(res);
        # print "data:", data 
        print "mode:", res['mode']
        print "phase:", res['phase']
        print "total tasks:", res['noTotalTasks']
        print "completed tasks:", res['noCompletedTasks']
        print "money spent sampling:", res['moneySpentSampling']
        print "money spent:", res['moneySpent']
        if res['noCompletedTasks'] > 0:     # 
            if res['state'] != 'RUNNING':
                print "Busy %s, please wait..." % res['phase']
                return
            sres = self.callmanager(service_id, "get_sampling_results", False, {}) # in json format
            sdata = simplejson.loads(sres)
            if 'timestamp' in sdata:        # Sampling is ready, check if bag is ready, or if we have to choose a schedule
                ts = sdata['timestamp']
                print strftime("Bag sampled on %a %d %b %Y at %H:%M:%S %Z", localtime(ts/1000))
                if 'schedules' in sdata:
                    #sch = sdata['schedules']
                    #ss = simplejson.dumps(sch)
                    # print "schedules: ", ss
                    if len(sdata['schedules']) == 0:
                        print "Bag finished during sampling phase"
                        return
                    if res['noTotalTasks'] == res['noCompletedTasks']:
                        print "Taskfarm finished"
                        return
                    count = 0
                    print "Schedules to choose from:"
                    print "%s\t%6.6s\t%6.6s" % ('Sched#','Time', 'Cost')
                    for sched in sdata['schedules']:
                        count = count + 1
                        print "%s:\t%6.6s\t%6.6s" % ( count, sched['time'], sched['cost'] )
                return
            print "error in samplingresults: ", sdata 
예제 #18
0
    def info(self, service_id):
        service = BaseClient.info(self, service_id)

        nodes = self.callmanager(service['sid'], "list_nodes", False, {})
        if 'hub' in nodes and nodes['hub']:
            # Only one HUB
            hub = nodes['hub'][0]
            params = {'serviceNodeId': hub}
            details = self.callmanager(service['sid'], "get_node_info", False,
                                       params)
            print "hub url: ", "http://%s:4444" % details['serviceNode']['ip']
            print "node url:", "http://%s:3306" % details['serviceNode']['ip']

        if 'node' in nodes:
            # Multiple nodes
            for node in nodes['node']:
                params = {'serviceNodeId': node}
                details = self.callmanager(service['sid'], "get_node_info",
                                           False, params)
                print "node url:", "http://%s:3306" % details['serviceNode'][
                    'ip']
예제 #19
0
파일: web.py 프로젝트: dzeno/conpaas-1
    def info(self, service_id):
        service = BaseClient.info(self, service_id)

        nodes = self.callmanager(service['sid'], "list_nodes", False, {})
        if 'error' in nodes:
            return 

        errmsg = ''

        for what in 'proxy', 'web', 'backend':
            print what,
            for proxy in nodes[what]:
                params = { 'serviceNodeId': proxy }
                details = self.callmanager(service['sid'], "get_node_info", False, params)
                if 'error' in details:
                    errmsg = errmsg + details['error'] + "\n"
                else:
                    print details['serviceNode']['ip'],

            print

        if errmsg:
            print 'WARNING: %s' % errmsg
예제 #20
0
파일: web.py 프로젝트: mehulsbhatt/conpaas
    def info(self, service_id):
        service = BaseClient.info(self, service_id)

        nodes = self.callmanager(service["sid"], "list_nodes", False, {})
        if "error" in nodes:
            return

        errmsg = ""

        for what in "proxy", "web", "backend":
            print what,
            for proxy in nodes[what]:
                params = {"serviceNodeId": proxy}
                details = self.callmanager(service["sid"], "get_node_info", False, params)
                if "error" in details:
                    errmsg = errmsg + details["error"] + "\n"
                else:
                    print details["serviceNode"]["ip"],

            print

        if errmsg:
            print "WARNING: %s" % errmsg
예제 #21
0
 def info(self, service_id):
     service = BaseClient.info(self, service_id)
     nodes = self.callmanager(service['sid'], "list_nodes", False, {})
     print type(nodes)
     for n in nodes:
         print n + "	:	" + str(nodes[n])