本文整理汇总了Python中pulp.server.dispatch.call.CallRequest.deletes_resource方法的典型用法代码示例。如果您正苦于以下问题:Python CallRequest.deletes_resource方法的具体用法?Python CallRequest.deletes_resource怎么用?Python CallRequest.deletes_resource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pulp.server.dispatch.call.CallRequest
的用法示例。
在下文中一共展示了CallRequest.deletes_resource方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DELETE
# 需要导入模块: from pulp.server.dispatch.call import CallRequest [as 别名]
# 或者: from pulp.server.dispatch.call.CallRequest import deletes_resource [as 别名]
def DELETE(self, repo_group_id):
manager = managers_factory.repo_group_manager()
tags = [resource_tag(dispatch_constants.RESOURCE_REPOSITORY_GROUP_TYPE, repo_group_id)]
call_request = CallRequest(manager.delete_repo_group,
[repo_group_id],
tags=tags)
call_request.deletes_resource(dispatch_constants.RESOURCE_REPOSITORY_GROUP_TYPE, repo_group_id)
return execution.execute_ok(self, call_request)
示例2: DELETE
# 需要导入模块: from pulp.server.dispatch.call import CallRequest [as 别名]
# 或者: from pulp.server.dispatch.call.CallRequest import deletes_resource [as 别名]
def DELETE(self, consumer_group_id):
manager = managers_factory.consumer_group_manager()
tags = [resource_tag(dispatch_constants.RESOURCE_CONSUMER_GROUP_TYPE, consumer_group_id)]
call_request = CallRequest(manager.delete_consumer_group,
[consumer_group_id],
tags=tags)
call_request.deletes_resource(dispatch_constants.RESOURCE_CONSUMER_GROUP_TYPE, consumer_group_id)
return execution.execute_ok(self, call_request)
示例3: DELETE
# 需要导入模块: from pulp.server.dispatch.call import CallRequest [as 别名]
# 或者: from pulp.server.dispatch.call.CallRequest import deletes_resource [as 别名]
def DELETE(self, id):
manager = managers.consumer_manager()
tags = [
resource_tag(dispatch_constants.RESOURCE_CONSUMER_TYPE, id),
action_tag('delete'),
]
call_request = CallRequest(
manager.unregister,
[id],
tags=tags)
call_request.deletes_resource(dispatch_constants.RESOURCE_CONSUMER_TYPE, id)
return self.ok(execution.execute(call_request))
示例4: DELETE
# 需要导入模块: from pulp.server.dispatch.call import CallRequest [as 别名]
# 或者: from pulp.server.dispatch.call.CallRequest import deletes_resource [as 别名]
def DELETE(self, role_id):
manager = managers.role_manager()
tags = [resource_tag(dispatch_constants.RESOURCE_CONSUMER_TYPE, role_id),
action_tag('delete')]
call_request = CallRequest(manager.delete_role,
[role_id],
tags=tags)
call_request.deletes_resource(dispatch_constants.RESOURCE_ROLE_TYPE, role_id)
return self.ok(execution.execute(call_request))
示例5: DELETE
# 需要导入模块: from pulp.server.dispatch.call import CallRequest [as 别名]
# 或者: from pulp.server.dispatch.call.CallRequest import deletes_resource [as 别名]
def DELETE(self, repo_id, importer_id):
importer_manager = manager_factory.repo_importer_manager()
tags = [resource_tag(dispatch_constants.RESOURCE_REPOSITORY_TYPE, repo_id),
resource_tag(dispatch_constants.RESOURCE_REPOSITORY_IMPORTER_TYPE, importer_id),
action_tag('delete_importer')]
call_request = CallRequest(importer_manager.remove_importer,
[repo_id],
tags=tags,
archive=True)
call_request.updates_resource(dispatch_constants.RESOURCE_REPOSITORY_TYPE, repo_id)
call_request.deletes_resource(dispatch_constants.RESOURCE_REPOSITORY_IMPORTER_TYPE, importer_id)
result = execution.execute(call_request)
return self.ok(result)
示例6: distributor_delete_itinerary
# 需要导入模块: from pulp.server.dispatch.call import CallRequest [as 别名]
# 或者: from pulp.server.dispatch.call.CallRequest import deletes_resource [as 别名]
def distributor_delete_itinerary(repo_id, distributor_id):
"""
Get the itinerary for deleting a repository distributor.
1. Delete the distributor on the sever.
2. Unbind any bound consumers.
@param repo_id: A repository ID.
@type repo_id: str
@return: A list of call_requests known as an itinerary.
@rtype list
"""
call_requests = []
# delete distributor
manager = managers.repo_distributor_manager()
tags = [
resource_tag(dispatch_constants.RESOURCE_REPOSITORY_TYPE, repo_id),
resource_tag(dispatch_constants.RESOURCE_REPOSITORY_DISTRIBUTOR_TYPE, distributor_id),
action_tag('remove_distributor')
]
delete_request = CallRequest(
manager.remove_distributor,
[repo_id, distributor_id],
tags=tags,
archive=True)
delete_request.updates_resource(dispatch_constants.RESOURCE_REPOSITORY_TYPE, repo_id)
delete_request.deletes_resource(dispatch_constants.RESOURCE_REPOSITORY_DISTRIBUTOR_TYPE, distributor_id)
call_requests.append(delete_request)
# append unbind itineraries foreach bound consumer
options = {}
manager = managers.consumer_bind_manager()
for bind in manager.find_by_distributor(repo_id, distributor_id):
unbind_requests = unbind_itinerary(
bind['consumer_id'],
bind['repo_id'],
bind['distributor_id'],
options)
if unbind_requests:
unbind_requests[0].depends_on(delete_request.id)
call_requests.extend(unbind_requests)
return call_requests
示例7: DELETE
# 需要导入模块: from pulp.server.dispatch.call import CallRequest [as 别名]
# 或者: from pulp.server.dispatch.call.CallRequest import deletes_resource [as 别名]
def DELETE(self, consumer_id, schedule_id):
consumer_manager = managers.consumer_manager()
consumer_manager.get_consumer(consumer_id)
schedule_manager = managers.schedule_manager()
tags = [resource_tag(dispatch_constants.RESOURCE_CONSUMER_TYPE, consumer_id),
resource_tag(dispatch_constants.RESOURCE_SCHEDULE_TYPE, schedule_id),
action_tag('delete_unit_update_schedule')]
call_request = CallRequest(schedule_manager.delete_unit_update_schedule,
[consumer_id, schedule_id],
tags=tags,
archive=True)
call_request.reads_resource(dispatch_constants.RESOURCE_CONSUMER_TYPE, consumer_id)
call_request.deletes_resource(dispatch_constants.RESOURCE_SCHEDULE_TYPE, schedule_id)
result = execution.execute(call_request)
return self.ok(result)
示例8: DELETE
# 需要导入模块: from pulp.server.dispatch.call import CallRequest [as 别名]
# 或者: from pulp.server.dispatch.call.CallRequest import deletes_resource [as 别名]
def DELETE(self, login):
manager = managers.user_manager()
tags = [resource_tag(dispatch_constants.RESOURCE_USER_TYPE, login),
action_tag('delete')]
call_request = CallRequest(manager.delete_user,
[login],
tags=tags)
call_request.deletes_resource(dispatch_constants.RESOURCE_USER_TYPE, login)
result = execution.execute(call_request)
# Delete any existing user permissions given to the creator of the user
user_link = serialization.link.current_link_obj()['_href']
if Permission.get_collection().find_one({'resource' : user_link}):
Permission.get_collection().remove({'resource' : user_link}, safe=True)
return self.ok(result)
示例9: DELETE
# 需要导入模块: from pulp.server.dispatch.call import CallRequest [as 别名]
# 或者: from pulp.server.dispatch.call.CallRequest import deletes_resource [as 别名]
def DELETE(self, repo_group_id, distributor_id):
params = self.params()
force = params.get('force', False)
distributor_manager = managers_factory.repo_group_distributor_manager()
tags = [resource_tag(dispatch_constants.RESOURCE_REPOSITORY_GROUP_TYPE, repo_group_id),
resource_tag(dispatch_constants.RESOURCE_REPOSITORY_GROUP_DISTRIBUTOR_TYPE, distributor_id),
action_tag('remove_distributor')
]
call_request = CallRequest(distributor_manager.remove_distributor,
args=[repo_group_id, distributor_id],
kwargs={'force' : force},
tags=tags,
archive=True)
call_request.updates_resource(dispatch_constants.RESOURCE_REPOSITORY_GROUP_TYPE, repo_group_id)
call_request.deletes_resource(dispatch_constants.RESOURCE_REPOSITORY_GROUP_DISTRIBUTOR_TYPE, distributor_id)
execution.execute(call_request)
return self.ok(None)