本文整理汇总了Python中interface.services.coi.iorg_management_service.OrgManagementServiceClient.enroll_member方法的典型用法代码示例。如果您正苦于以下问题:Python OrgManagementServiceClient.enroll_member方法的具体用法?Python OrgManagementServiceClient.enroll_member怎么用?Python OrgManagementServiceClient.enroll_member使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类interface.services.coi.iorg_management_service.OrgManagementServiceClient
的用法示例。
在下文中一共展示了OrgManagementServiceClient.enroll_member方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestObservatoryManagementServiceIntegration
# 需要导入模块: from interface.services.coi.iorg_management_service import OrgManagementServiceClient [as 别名]
# 或者: from interface.services.coi.iorg_management_service.OrgManagementServiceClient import enroll_member [as 别名]
#.........这里部分代码省略.........
dp_obj = IonObject(RT.DataProduct,
name='the parsed data',
description='ctd stream test',
temporal_domain = tdom,
spatial_domain = sdom)
data_product_id1 = self.dpclient.create_data_product(data_product=dp_obj,
stream_definition_id=parsed_stream_def_id)
self.damsclient.assign_data_product(input_resource_id=stuff.instrument_device_id,
data_product_id=data_product_id1)
#Create a user to be used as regular member
member_actor_obj = IonObject(RT.ActorIdentity, name='org member actor')
member_actor_id,_ = self.RR.create(member_actor_obj)
assert(member_actor_id)
member_actor_header = get_actor_header(member_actor_id)
member_user_obj = IonObject(RT.UserInfo, name='org member user')
member_user_id,_ = self.RR.create(member_user_obj)
assert(member_user_id)
self.RR.create_association(subject=member_actor_id, predicate=PRED.hasInfo, object=member_user_id)
#Build the Service Agreement Proposal to enroll a user actor
sap = IonObject(OT.EnrollmentProposal,consumer=member_actor_id, provider=stuff.org_id )
sap_response = self.org_management_service.negotiate(sap, headers=member_actor_header )
#enroll the member without using negotiation
self.org_management_service.enroll_member(org_id=stuff.org_id, actor_id=member_actor_id)
#--------------------------------------------------------------------------------
# Get the extended Site (platformSite)
#--------------------------------------------------------------------------------
try:
extended_site = self.OMS.get_site_extension(stuff.platform_site_id)
except:
log.error('failed to get extended site', exc_info=True)
raise
log.debug("extended_site: %r ", extended_site)
self.assertEqual(1, len(extended_site.platform_devices))
self.assertEqual(1, len(extended_site.platform_models))
self.assertEqual(stuff.platform_device_id, extended_site.platform_devices[0]._id)
self.assertEqual(stuff.platform_model_id, extended_site.platform_models[0]._id)
log.debug("verify that PlatformDeviceb is linked to PlatformDevice with hasNetworkParent link")
associations = self.RR.find_associations(subject=stuff.platform_deviceb_id, predicate=PRED.hasNetworkParent, object=stuff.platform_device_id, id_only=True)
self.assertIsNotNone(associations, "PlatformDevice child not connected to PlatformDevice parent.")
#--------------------------------------------------------------------------------
# Get the extended Org
#--------------------------------------------------------------------------------
#test the extended resource
extended_org = self.OMS.get_marine_facility_extension(stuff.org_id)
log.debug("test_observatory_org_extended: extended_org: %s ", str(extended_org))
#self.assertEqual(2, len(extended_org.instruments_deployed) )
#self.assertEqual(1, len(extended_org.platforms_not_deployed) )
self.assertEqual(2, extended_org.number_of_platforms)
self.assertEqual(2, len(extended_org.platform_models) )