コード例 #1
0
        def build_network_definition(map):
            """
            Returns the root NNode according to self._platform_id and the OMS'
            getPlatformMap response.
            """
            nodes = NNode.create_network(map)
            if not self._platform_id in nodes:
                msg = "platform map does not contain entry for %r" % self._platform_id
                log.error(msg)
                raise PlatformException(msg=msg)

            return nodes[self._platform_id]
コード例 #2
0
ファイル: oms_simple.py プロジェクト: kerfoot/coi-services
        except Exception, e:
            print "error generating diagrams: %s" % str(e)

    uri = os.getenv("OMS", "http://*****:*****@10.180.80.10:9021/")

    #####
    import re

    if re.search("simulator", uri):
        from ion.agents.platform.oms.oms_client_factory import OmsClientFactory

        oms = OmsClientFactory.create_instance(uri)
        print "ping() = %s" % oms.ping()
        map = oms.getPlatformMap()
        print "getPlatformMap() = %s" % map
        nodes = NNode.create_network(map)
        if not "" in nodes:
            print "platform map does not include '' to indicate root platforms."
        else:
            dummy_root = nodes[""]
            gen_diagrams("sim_topology", dummy_root)
        sys.exit()
    #####

    proxy = xmlrpclib.ServerProxy(uri)

    retval = proxy.hello.ping()
    print "ping() = %s" % retval

    retval = proxy.config.getPlatformMap()
    print "getPlatformMap() = %s" % retval