本文整理汇总了Python中pulp.server.managers.factory.content_orphan_manager函数的典型用法代码示例。如果您正苦于以下问题:Python content_orphan_manager函数的具体用法?Python content_orphan_manager怎么用?Python content_orphan_manager使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了content_orphan_manager函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: POST
def POST(self):
orphans = self.params()
orphan_manager = factory.content_orphan_manager()
tags = [action_tag('delete_orphans'),
resource_tag(dispatch_constants.RESOURCE_CONTENT_UNIT_TYPE, 'orphans')]
call_request = CallRequest(orphan_manager.delete_orphans_by_id, [orphans], tags=tags, archive=True)
return execution.execute_async(self, call_request)
开发者ID:jlsherrill,项目名称:pulp,代码行数:7,代码来源:contents.py
示例2: DELETE
def DELETE(self, content_type, content_id):
orphan_manager = factory.content_orphan_manager()
orphan_manager.get_orphan(content_type, content_id)
ids = [{'content_type_id': content_type, 'unit_id': content_id}]
tags = [resource_tag(dispatch_constants.RESOURCE_CONTENT_UNIT_TYPE, 'orphans')]
call_request = CallRequest(orphan_manager.delete_orphans_by_id, [ids], tags=tags, archive=True)
return execution.execute_async(self, call_request)
开发者ID:jlsherrill,项目名称:pulp,代码行数:7,代码来源:contents.py
示例3: GET
def GET(self, content_type):
orphan_manager = factory.content_orphan_manager()
# NOTE this can still potentially stomp on memory, but hopefully the
# _with_unit_keys methods will reduce the foot print enough that
# we'll never see this bug again
orphans = list(orphan_manager.generate_orphans_by_type_with_unit_keys(content_type))
map(lambda o: o.update(serialization.link.child_link_obj(o['_id'])), orphans)
return self.ok(orphans)
开发者ID:cliffy94,项目名称:pulp,代码行数:8,代码来源:contents.py
示例4: delete
def delete(self, request, content_type):
"""
Dispatch a delete_orphans_by_type task.
:param request: WSGI request object
:type request: django.core.handlers.wsgi.WSGIRequest
:param content_type: restrict the list of orphans to be deleted to this content type
:type content_type: str
:raises: OperationPostponed when an async operation is performed
"""
orphan_manager = factory.content_orphan_manager()
orphan_manager.validate_type(content_type)
task_tags = [tags.resource_tag(tags.RESOURCE_CONTENT_UNIT_TYPE, "orphans")]
async_task = content_orphan.delete_orphans_by_type.apply_async((content_type,), tags=task_tags)
raise OperationPostponed(async_task)
开发者ID:credativ,项目名称:pulp,代码行数:16,代码来源:content.py
示例5: get
def get(self, request, content_type, unit_id):
"""
Return a serialized object representing the requested orphan
:param request: WSGI request object
:type request: django.core.handlers.wsgi.WSGIRequest
:param content_type: content type of the requested orphan
:type content_type: str
:param unit_id: id of the requested unit
:type unit_id: str
:return: response conainting a serialized dict of the requested orphan
:rtype : django.http.HttpResponse
"""
orphan_manager = factory.content_orphan_manager()
orphan_dict = orphan_manager.get_orphan(content_type, unit_id)
orphan_dict["_href"] = request.get_full_path()
return generate_json_response(orphan_dict)
开发者ID:credativ,项目名称:pulp,代码行数:18,代码来源:content.py
示例6: test_factory
def test_factory(self):
try:
manager_factory.content_orphan_manager()
except:
self.fail(traceback.format_exc())
开发者ID:domcleal,项目名称:pulp,代码行数:5,代码来源:test_content_orphan_manager.py
示例7: GET
def GET(self, content_type, content_id):
orphan_manager = factory.content_orphan_manager()
orphan = orphan_manager.get_orphan(content_type, content_id)
orphan.update(serialization.link.current_link_obj())
return self.ok(orphan)
开发者ID:jlsherrill,项目名称:pulp,代码行数:5,代码来源:contents.py
示例8: clean_orphans
def clean_orphans(self):
"""
Exposes the ability to clean up this unit as an orphan.
"""
orphan_manger = factory.content_orphan_manager()
orphan_manger.delete_orphan_content_units_by_type(self._content_type_id, self.id)
开发者ID:BrnoPCmaniak,项目名称:pulp,代码行数:6,代码来源:__init__.py
注:本文中的pulp.server.managers.factory.content_orphan_manager函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论