本文整理汇总了Python中pyon.util.containers.DotDict.asset_id方法的典型用法代码示例。如果您正苦于以下问题:Python DotDict.asset_id方法的具体用法?Python DotDict.asset_id怎么用?Python DotDict.asset_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyon.util.containers.DotDict
的用法示例。
在下文中一共展示了DotDict.asset_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _make_associations
# 需要导入模块: from pyon.util.containers import DotDict [as 别名]
# 或者: from pyon.util.containers.DotDict import asset_id [as 别名]
def _make_associations(self):
"""
create one of each resource and association used by OMS
to guard against problems in ion-definitions
"""
#raise unittest.SkipTest("https://jira.oceanobservatories.org/tasks/browse/CISWCORE-41")
"""
the tree we're creating (observatory, sites, platforms, instruments)
rows are lettered, colums numbered.
- first row is implied a
- first column is implied 1
- site Z, just because
O--Sz
|
S--S2--P3--I4
|
Sb-Pb2-Ib3
|
P--I2 <- PlatformDevice, InstrumentDevice2
|
Pb <- PlatformDevice b
|
I <- InstrumentDevice
"""
org_id = self.OMS.create_marine_facility(any_old(RT.Org))
def create_under_org(resource_type, extra_fields=None):
obj = any_old(resource_type, extra_fields)
if RT.InstrumentDevice == resource_type:
resource_id = self.IMS.create_instrument_device(obj)
else:
resource_id, _ = self.RR.create(obj)
self.OMS.assign_resource_to_observatory_org(resource_id=resource_id, org_id=org_id)
return resource_id
#stuff we control
observatory_id = create_under_org(RT.Observatory)
subsite_id = create_under_org(RT.Subsite)
subsite2_id = create_under_org(RT.Subsite)
subsiteb_id = create_under_org(RT.Subsite)
subsitez_id = create_under_org(RT.Subsite)
platform_site_id = create_under_org(RT.PlatformSite)
platform_siteb_id = create_under_org(RT.PlatformSite)
platform_siteb2_id = create_under_org(RT.PlatformSite)
platform_site3_id = create_under_org(RT.PlatformSite)
instrument_site_id = create_under_org(RT.InstrumentSite)
instrument_site2_id = create_under_org(RT.InstrumentSite)
instrument_siteb3_id = create_under_org(RT.InstrumentSite)
instrument_site4_id = create_under_org(RT.InstrumentSite)
#stuff we associate to
instrument_device_id = create_under_org(RT.InstrumentDevice)
instrument_device2_id = create_under_org(RT.InstrumentDevice)
platform_device_id = create_under_org(RT.PlatformDevice)
platform_deviceb_id = create_under_org(RT.PlatformDevice)
instrument_model_id, _ = self.RR.create(any_old(RT.InstrumentModel))
platform_model_id, _ = self.RR.create(any_old(RT.PlatformModel))
deployment_id, _ = self.RR.create(any_old(RT.Deployment))
# marine tracking resources
asset_id = create_under_org(RT.Asset)
asset_type_id = create_under_org(RT.AssetType)
event_duration_id = create_under_org(RT.EventDuration)
event_duration_type_id = create_under_org(RT.EventDurationType)
#observatory
self.RR.create_association(observatory_id, PRED.hasSite, subsite_id)
self.RR.create_association(observatory_id, PRED.hasSite, subsitez_id)
#site
self.RR.create_association(subsite_id, PRED.hasSite, subsite2_id)
self.RR.create_association(subsite_id, PRED.hasSite, subsiteb_id)
self.RR.create_association(subsite2_id, PRED.hasSite, platform_site3_id)
self.RR.create_association(subsiteb_id, PRED.hasSite, platform_siteb2_id)
self.RR.create_association(subsiteb_id, PRED.hasSite, platform_site_id)
#platform_site(s)
self.RR.create_association(platform_site3_id, PRED.hasSite, instrument_site4_id)
self.RR.create_association(platform_siteb2_id, PRED.hasSite, instrument_siteb3_id)
self.RR.create_association(platform_site_id, PRED.hasSite, instrument_site2_id)
self.RR.create_association(platform_site_id, PRED.hasSite, platform_siteb_id)
self.RR.create_association(platform_siteb_id, PRED.hasSite, instrument_site_id)
self.RR.create_association(platform_siteb_id, PRED.hasDevice, platform_deviceb_id)
#test network parent link
self.OMS.assign_device_to_network_parent(platform_device_id, platform_deviceb_id)
self.RR.create_association(platform_site_id, PRED.hasModel, platform_model_id)
self.RR.create_association(platform_site_id, PRED.hasDevice, platform_device_id)
self.RR.create_association(platform_site_id, PRED.hasDeployment, deployment_id)
#.........这里部分代码省略.........
开发者ID:edwardhunter2,项目名称:coi-services,代码行数:103,代码来源:test_observatory_management_service_integration.py