本文整理汇总了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)
示例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()
示例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)
示例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)
示例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)
示例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))
示例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))
示例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)
示例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 = {}
示例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)
示例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)