本文整理汇总了Python中interface.services.sa.iinstrument_management_service.InstrumentManagementServiceClient.deploy_as_primary_instrument_device_to_logical_instrument方法的典型用法代码示例。如果您正苦于以下问题:Python InstrumentManagementServiceClient.deploy_as_primary_instrument_device_to_logical_instrument方法的具体用法?Python InstrumentManagementServiceClient.deploy_as_primary_instrument_device_to_logical_instrument怎么用?Python InstrumentManagementServiceClient.deploy_as_primary_instrument_device_to_logical_instrument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类interface.services.sa.iinstrument_management_service.InstrumentManagementServiceClient
的用法示例。
在下文中一共展示了InstrumentManagementServiceClient.deploy_as_primary_instrument_device_to_logical_instrument方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _process_cmd_deploy_prim
# 需要导入模块: from interface.services.sa.iinstrument_management_service import InstrumentManagementServiceClient [as 别名]
# 或者: from interface.services.sa.iinstrument_management_service.InstrumentManagementServiceClient import deploy_as_primary_instrument_device_to_logical_instrument [as 别名]
def _process_cmd_deploy_prim(resource_id, res_obj=None):
li_id = get_arg("deploy_prim")
from interface.services.sa.iinstrument_management_service import InstrumentManagementServiceClient
ims_cl = InstrumentManagementServiceClient()
ims_cl.deploy_as_primary_instrument_device_to_logical_instrument(resource_id, li_id)
return "OK"
示例2: TestIMSDeployAsPrimaryDevice
# 需要导入模块: from interface.services.sa.iinstrument_management_service import InstrumentManagementServiceClient [as 别名]
# 或者: from interface.services.sa.iinstrument_management_service.InstrumentManagementServiceClient import deploy_as_primary_instrument_device_to_logical_instrument [as 别名]
#.........这里部分代码省略.........
#-------------------------------
# Create Logical Instrument
#-------------------------------
logicalInstrument_obj = IonObject(RT.LogicalInstrument, name='logicalInstrument1', description="SBE37IMLogicalInstrument" )
try:
logicalInstrument_id = self.observatoryclient.create_logical_instrument(logical_instrument=logicalInstrument_obj, parent_logical_platform_id='')
except BadRequest as ex:
self.fail("failed to create new LogicalInstrument: %s" %ex)
print 'test_deployAsPrimaryDevice: new logicalInstrument id = ', logicalInstrument_id
self.observatoryclient.assign_instrument_model_to_logical_instrument(instModel_id, logicalInstrument_id)
#-------------------------------
# Create Old InstrumentDevice
#-------------------------------
instDevice_obj = IonObject(RT.InstrumentDevice, name='SBE37IMDeviceYear1', description="SBE37IMDevice for the FIRST year of deployment", serial_number="12345" )
try:
oldInstDevice_id = self.imsclient.create_instrument_device(instrument_device=instDevice_obj)
self.imsclient.assign_instrument_model_to_instrument_device(instModel_id, oldInstDevice_id)
except BadRequest as ex:
self.fail("failed to create new InstrumentDevice: %s" %ex)
print 'test_deployAsPrimaryDevice: new Year 1 InstrumentDevice id = ', oldInstDevice_id
# deploy this device to the logical slot
self.imsclient.deploy_instrument_device_to_logical_instrument(oldInstDevice_id, logicalInstrument_id)
self.rrclient.execute_lifecycle_transition(oldInstDevice_id, LCE.DEPLOY)
self.rrclient.execute_lifecycle_transition(oldInstDevice_id, LCE.ENABLE)
# set this device as the current primary device
self.imsclient.deploy_as_primary_instrument_device_to_logical_instrument(oldInstDevice_id, logicalInstrument_id)
#-------------------------------
# Create InstrumentAgentInstance for OldInstrumentDevice to hold configuration information
# cmd_port=5556, evt_port=5557, comms_method="ethernet", comms_device_address=CFG.device.sbe37.host, comms_device_port=CFG.device.sbe37.port,
#-------------------------------
instAgentInstance_obj = IonObject(RT.InstrumentAgentInstance, name='SBE37IMAgentInstanceYear1', description="SBE37IMAgentInstance Year 1", svr_addr="localhost",
driver_module="ion.services.mi.drivers.sbe37_driver", driver_class="SBE37Driver",
cmd_port=5556, evt_port=5557, comms_method="ethernet", comms_device_address="localhost", comms_device_port=4001,
comms_server_address="localhost", comms_server_port=8888)
oldInstAgentInstance_id = self.imsclient.create_instrument_agent_instance(instAgentInstance_obj, instAgent_id, oldInstDevice_id)
#-------------------------------
# Create CTD Parsed as the Year 1 data product
#-------------------------------
# create a stream definition for the data from the ctd simulator
ctd_stream_def = SBE37_CDM_stream_definition()
ctd_stream_def_id = self.pubsubclient.create_stream_definition(container=ctd_stream_def)
print 'test_deployAsPrimaryDevice: new Stream Definition id = ', ctd_stream_def_id
print 'Creating new CDM data product with a stream definition'
dp_obj = IonObject(RT.DataProduct,name='ctd_parsed_year1',description='ctd stream test year 1')
try:
ctd_parsed_data_product_year1 = self.dataproductclient.create_data_product(dp_obj, ctd_stream_def_id)
except BadRequest as ex:
self.fail("failed to create new data product: %s" %ex)
print 'new ctd_parsed_data_product_id = ', ctd_parsed_data_product_year1
self.damsclient.assign_data_product(input_resource_id=oldInstDevice_id, data_product_id=ctd_parsed_data_product_year1)