本文整理匯總了Python中pyon.ion.resource.ExtendedResourceContainer.set_service_requests方法的典型用法代碼示例。如果您正苦於以下問題:Python ExtendedResourceContainer.set_service_requests方法的具體用法?Python ExtendedResourceContainer.set_service_requests怎麽用?Python ExtendedResourceContainer.set_service_requests使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pyon.ion.resource.ExtendedResourceContainer
的用法示例。
在下文中一共展示了ExtendedResourceContainer.set_service_requests方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: prepare_resource_support
# 需要導入模塊: from pyon.ion.resource import ExtendedResourceContainer [as 別名]
# 或者: from pyon.ion.resource.ExtendedResourceContainer import set_service_requests [as 別名]
def prepare_resource_support(self, resource_type='', resource_id=''):
"""Returns a structured dict with information to help create/update a resource
@param resource_type str
@param resource_id str
@retval resource_data GenericPrepareSupport
@throws BadRequest A parameter is missing
@throws NotFound An object with the specified resource_id does not exist
"""
if not resource_type:
raise BadRequest("The resource_type parameter is required")
extended_resource_handler = ExtendedResourceContainer(self, self)
resource_data = extended_resource_handler.create_prepare_resource_support(resource_id=resource_id, prepare_resource_type=OT.GenericPrepareSupport, origin_resource_type=resource_type)
#Fill out service request information for creating a instrument device
extended_resource_handler.set_service_requests(resource_data.create_request, 'resource_registry',
'create', { "object": "$(object)" })
#Fill out service request information for creating a instrument device
extended_resource_handler.set_service_requests(resource_data.update_request, 'resource_registry',
'update', { "object": "$(object)" })
return resource_data