当前位置: 首页>>代码示例>>Python>>正文


Python CIOMSClientFactory.destroy_instance方法代码示例

本文整理汇总了Python中ion.agents.platform.rsn.oms_client_factory.CIOMSClientFactory.destroy_instance方法的典型用法代码示例。如果您正苦于以下问题:Python CIOMSClientFactory.destroy_instance方法的具体用法?Python CIOMSClientFactory.destroy_instance怎么用?Python CIOMSClientFactory.destroy_instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ion.agents.platform.rsn.oms_client_factory.CIOMSClientFactory的用法示例。


在下文中一共展示了CIOMSClientFactory.destroy_instance方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: disconnect

# 需要导入模块: from ion.agents.platform.rsn.oms_client_factory import CIOMSClientFactory [as 别名]
# 或者: from ion.agents.platform.rsn.oms_client_factory.CIOMSClientFactory import destroy_instance [as 别名]
 def disconnect(self):
     """
     Stops event dispatch and destroys the CIOMSClient instance.
     """
     self._stop_event_dispatch()
     CIOMSClientFactory.destroy_instance(self._rsn_oms)
     self._rsn_oms = None
     log.debug("%r: CIOMSClient instance destroyed", self._platform_id)
开发者ID:ateranishi,项目名称:coi-services,代码行数:10,代码来源:rsn_platform_driver.py

示例2: setUp

# 需要导入模块: from ion.agents.platform.rsn.oms_client_factory import CIOMSClientFactory [as 别名]
# 或者: from ion.agents.platform.rsn.oms_client_factory.CIOMSClientFactory import destroy_instance [as 别名]
    def setUp(self):
        self._start_container()

        self.container.start_rel_from_url('res/deploy/r2deploy.yml')

        self.RR   = ResourceRegistryServiceClient(node=self.container.node)
        self.IMS  = InstrumentManagementServiceClient(node=self.container.node)
        self.DAMS = DataAcquisitionManagementServiceClient(node=self.container.node)
        self.DP   = DataProductManagementServiceClient(node=self.container.node)
        self.PSC  = PubsubManagementServiceClient(node=self.container.node)
        self.PDC  = ProcessDispatcherServiceClient(node=self.container.node)
        self.DSC  = DatasetManagementServiceClient()
        self.IDS  = IdentityManagementServiceClient(node=self.container.node)
        self.RR2  = EnhancedResourceRegistryClient(self.RR)

        self.org_id = self.RR2.create(any_old(RT.Org))
        log.debug("Org created: %s", self.org_id)

        # Use the network definition provided by RSN OMS directly.
        rsn_oms = CIOMSClientFactory.create_instance(DVR_CONFIG['oms_uri'])
        self._network_definition = RsnOmsUtil.build_network_definition(rsn_oms)
        CIOMSClientFactory.destroy_instance(rsn_oms)

        # get serialized version for the configuration:
        self._network_definition_ser = NetworkUtil.serialize_network_definition(self._network_definition)
        log.trace("NetworkDefinition serialization:\n%s", self._network_definition_ser)

        # set attributes for the platforms:
        self._platform_attributes = {}
        for platform_id in self._network_definition.pnodes:
            pnode = self._network_definition.pnodes[platform_id]
            dic = dict((attr.attr_id, attr.defn) for attr in pnode.attrs.itervalues())
            self._platform_attributes[platform_id] = dic
        log.trace("_platform_attributes: %s", self._platform_attributes)

        # set ports for the platforms:
        self._platform_ports = {}
        for platform_id in self._network_definition.pnodes:
            pnode = self._network_definition.pnodes[platform_id]
            dic = {}
            for port_id, port in pnode.ports.iteritems():
                dic[port_id] = dict(port_id=port_id,
                                    network=port.network)
            self._platform_ports[platform_id] = dic
        log.trace("_platform_ports: %s", self._platform_attributes)

        self._async_data_result = AsyncResult()
        self._data_subscribers = []
        self._samples_received = []
        self.addCleanup(self._stop_data_subscribers)

        self._async_event_result = AsyncResult()
        self._event_subscribers = []
        self._events_received = []
        self.addCleanup(self._stop_event_subscribers)
        self._start_event_subscriber()
开发者ID:mbarry02,项目名称:coi-services,代码行数:58,代码来源:base_test_platform_agent_with_rsn.py

示例3: setUp

# 需要导入模块: from ion.agents.platform.rsn.oms_client_factory import CIOMSClientFactory [as 别名]
# 或者: from ion.agents.platform.rsn.oms_client_factory.CIOMSClientFactory import destroy_instance [as 别名]
    def setUp(self):

        # Use the network definition provided by RSN OMS directly.
        rsn_oms = CIOMSClientFactory.create_instance(DVR_CONFIG["oms_uri"])
        network_definition = RsnOmsUtil.build_network_definition(rsn_oms)
        CIOMSClientFactory.destroy_instance(rsn_oms)

        if log.isEnabledFor(logging.DEBUG):
            network_definition_ser = NetworkUtil.serialize_network_definition(network_definition)
            log.debug("NetworkDefinition serialization:\n%s", network_definition_ser)

        platform_id = self.PLATFORM_ID
        pnode = network_definition.pnodes[platform_id]
        self._plat_driver = RSNPlatformDriver(pnode, self.evt_recv)
开发者ID:jamie-cyber1,项目名称:coi-services,代码行数:16,代码来源:test_rsn_platform_driver.py

示例4: disconnect

# 需要导入模块: from ion.agents.platform.rsn.oms_client_factory import CIOMSClientFactory [as 别名]
# 或者: from ion.agents.platform.rsn.oms_client_factory.CIOMSClientFactory import destroy_instance [as 别名]
    def disconnect(self, recursion=None):
        """
        Stops event dispatch and destroys the CIOMSClient instance.
        """
        self._stop_event_dispatch()

        # power off all ports with connected devices
        if recursion:
            for port in self._active_ports:
                log.debug('disconnect power port: %s', port)
                self.turn_off_port(port)


        CIOMSClientFactory.destroy_instance(self._rsn_oms)
        self._rsn_oms = None
        log.debug("%r: CIOMSClient instance destroyed", self._platform_id)
开发者ID:edwardhunter,项目名称:coi-services,代码行数:18,代码来源:rsn_platform_driver.py

示例5: disconnect

# 需要导入模块: from ion.agents.platform.rsn.oms_client_factory import CIOMSClientFactory [as 别名]
# 或者: from ion.agents.platform.rsn.oms_client_factory.CIOMSClientFactory import destroy_instance [as 别名]
    def disconnect(self, recursion=None):
        """
        Stops event dispatch and destroys the CIOMSClient instance.
        """
        self._stop_event_dispatch()

        # TODO(OOIION-1495) review the following. Only change is the use
        # of self._pnode.ports instead of self._active_ports,
        # while we address the "active ports" concept mentioned above.
        # BTW, is it OK to turn off ports in this "disconnect driver" operation?

        # power off all ports with connected devices
        if recursion:
            for port in self._pnode.ports:
                log.debug('disconnect power port: %s', port)
                self.turn_off_port(port)

        CIOMSClientFactory.destroy_instance(self._rsn_oms)
        self._rsn_oms = None
        log.debug("%r: CIOMSClient instance destroyed", self._platform_id)
开发者ID:lukecampbell,项目名称:coi-services,代码行数:22,代码来源:rsn_platform_driver.py

示例6: tearDownClass

# 需要导入模块: from ion.agents.platform.rsn.oms_client_factory import CIOMSClientFactory [as 别名]
# 或者: from ion.agents.platform.rsn.oms_client_factory.CIOMSClientFactory import destroy_instance [as 别名]
 def tearDownClass(cls):
     CIOMSClientFactory.destroy_instance(cls.oms)
     event_notifications = OmsTestMixin.stop_http_server()
     log.info("event_notifications = %s" % str(event_notifications))
开发者ID:jamie-cyber1,项目名称:coi-services,代码行数:6,代码来源:test_oms_client.py

示例7: done

# 需要导入模块: from ion.agents.platform.rsn.oms_client_factory import CIOMSClientFactory [as 别名]
# 或者: from ion.agents.platform.rsn.oms_client_factory.CIOMSClientFactory import destroy_instance [as 别名]
 def done():
     CIOMSClientFactory.destroy_instance(self.oms)
     event_notifications = OmsTestMixin.stop_http_server()
     log.info("event_notifications = %s" % str(event_notifications))
开发者ID:Bobfrat,项目名称:coi-services,代码行数:6,代码来源:test_rsn_platform_instrument.py

示例8: tearDown

# 需要导入模块: from ion.agents.platform.rsn.oms_client_factory import CIOMSClientFactory [as 别名]
# 或者: from ion.agents.platform.rsn.oms_client_factory.CIOMSClientFactory import destroy_instance [as 别名]
 def tearDown(self):
     CIOMSClientFactory.destroy_instance(self._rsn_oms)
开发者ID:pkediyal,项目名称:coi-services,代码行数:4,代码来源:test_oms_util.py

示例9: setUp

# 需要导入模块: from ion.agents.platform.rsn.oms_client_factory import CIOMSClientFactory [as 别名]
# 或者: from ion.agents.platform.rsn.oms_client_factory.CIOMSClientFactory import destroy_instance [as 别名]
    def setUp(self):
        self._start_container()

        self.container.start_rel_from_url('res/deploy/r2deploy.yml')

        self.RR   = ResourceRegistryServiceClient(node=self.container.node)
        self.IMS  = InstrumentManagementServiceClient(node=self.container.node)
        self.DAMS = DataAcquisitionManagementServiceClient(node=self.container.node)
        self.DP   = DataProductManagementServiceClient(node=self.container.node)
        self.PSC  = PubsubManagementServiceClient(node=self.container.node)
        self.PDC  = ProcessDispatcherServiceClient(node=self.container.node)
        self.DSC  = DatasetManagementServiceClient()
        self.IDS  = IdentityManagementServiceClient(node=self.container.node)
        self.RR2  = EnhancedResourceRegistryClient(self.RR)

        self.org_id = self.RR2.create(any_old(RT.Org))
        log.debug("Org created: %s", self.org_id)

        # Create InstrumentModel
        # TODO create multiple models as needed; for the moment assuming all
        # used instruments are the same model here.
        instModel_obj = IonObject(RT.InstrumentModel,
                                  name='SBE37IMModel',
                                  description="SBE37IMModel")
        self.instModel_id = self.IMS.create_instrument_model(instModel_obj)
        log.debug('new InstrumentModel id = %s ', self.instModel_id)

        # Use the network definition provided by RSN OMS directly.
        rsn_oms = CIOMSClientFactory.create_instance(DVR_CONFIG['oms_uri'])
        self._network_definition = RsnOmsUtil.build_network_definition(rsn_oms)
        CIOMSClientFactory.destroy_instance(rsn_oms)

        if log.isEnabledFor(logging.TRACE):
            # show serialized version for the network definition:
            network_definition_ser = NetworkUtil.serialize_network_definition(self._network_definition)
            log.trace("NetworkDefinition serialization:\n%s", network_definition_ser)

        # set attributes for the platforms:
        self._platform_attributes = {}
        for platform_id in self._network_definition.pnodes:
            pnode = self._network_definition.pnodes[platform_id]
            dic = dict((attr.attr_id, attr.defn) for attr in pnode.attrs.itervalues())
            self._platform_attributes[platform_id] = dic
        log.trace("_platform_attributes: %s", self._platform_attributes)

        # set ports for the platforms:
        self._platform_ports = {}
        for platform_id in self._network_definition.pnodes:
            pnode = self._network_definition.pnodes[platform_id]
            dic = {}
            for port_id, port in pnode.ports.iteritems():
                dic[port_id] = dict(port_id=port_id,
                                    network=port.network)
            self._platform_ports[platform_id] = dic
        log.trace("_platform_ports: %s", self._platform_attributes)

        self._async_data_result = AsyncResult()
        self._data_subscribers = []
        self._samples_received = []
        self.addCleanup(self._stop_data_subscribers)

        self._async_event_result = AsyncResult()
        self._event_subscribers = []
        self._events_received = []
        self.addCleanup(self._stop_event_subscribers)
        self._start_event_subscriber(sub_type="platform_event")

        # instruments that have been set up: instr_key: i_obj
        self._setup_instruments = {}
开发者ID:jamie-cyber1,项目名称:coi-services,代码行数:71,代码来源:base_test_platform_agent_with_rsn.py

示例10: done

# 需要导入模块: from ion.agents.platform.rsn.oms_client_factory import CIOMSClientFactory [as 别名]
# 或者: from ion.agents.platform.rsn.oms_client_factory.CIOMSClientFactory import destroy_instance [as 别名]
 def done():
     CIOMSClientFactory.destroy_instance(self.oms)
开发者ID:Bobfrat,项目名称:coi-services,代码行数:4,代码来源:test_oms_client.py

示例11: tearDownClass

# 需要导入模块: from ion.agents.platform.rsn.oms_client_factory import CIOMSClientFactory [as 别名]
# 或者: from ion.agents.platform.rsn.oms_client_factory.CIOMSClientFactory import destroy_instance [as 别名]
 def tearDownClass(cls):
     CIOMSClientFactory.destroy_instance(cls.oms)
开发者ID:Bobfrat,项目名称:coi-services,代码行数:4,代码来源:test_oms_simulator.py


注:本文中的ion.agents.platform.rsn.oms_client_factory.CIOMSClientFactory.destroy_instance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。