• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python factory.consumer_group_query_manager函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pulp.server.managers.factory.consumer_group_query_manager函数的典型用法代码示例。如果您正苦于以下问题:Python consumer_group_query_manager函数的具体用法?Python consumer_group_query_manager怎么用?Python consumer_group_query_manager使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了consumer_group_query_manager函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: unbind

    def unbind(group_id, repo_id, distributor_id, options):
        """
        Unbind the members of the specified consumer group.
        :param group_id: A consumer group ID.
        :type group_id: str
        :param repo_id: A repository ID.
        :type repo_id: str
        :param distributor_id: A distributor ID.
        :type distributor_id: str
        :param options: Bind options passed to the agent handler.
        :type options: dict
        :return: TaskResult containing the ids of all the spawned tasks & bind errors
        :rtype: TaskResult
        """
        manager = manager_factory.consumer_group_query_manager()
        group = manager.get_group(group_id)

        bind_errors = []
        additional_tasks = []

        for consumer_id in group['consumer_ids']:
            try:
                report = unbind_task(consumer_id, repo_id, distributor_id, options)
                if report:
                    additional_tasks.extend(report.spawned_tasks)
            except PulpException, e:
                # Log a message so that we can debug but don't throw
                _logger.warn(e)
                bind_errors.append(e)
            except Exception, e:
                bind_errors.append(e)
开发者ID:nbetm,项目名称:pulp,代码行数:31,代码来源:cud.py


示例2: POST

 def POST(self, consumer_group_id):
     criteria = Criteria.from_client_input(self.params().get('criteria', {}))
     manager = managers_factory.consumer_group_manager()
     manager.unassociate(consumer_group_id, criteria)
     query_manager = managers_factory.consumer_group_query_manager()
     group = query_manager.get_group(consumer_group_id)
     return self.ok(group['consumer_ids'])
开发者ID:CUXIDUMDUM,项目名称:pulp,代码行数:7,代码来源:consumer_groups.py


示例3: verify_group_resources

def verify_group_resources(group_id, repo_id, distributor_id):
    """
    Confirm the group, repository, and distributor exist.

    :param group_id: The consumer group id to verify the existence of
    :type group_id: str
    :param repo_id: The repository id to confirm the existence of
    :type repo_id: str
    :param distributor_id: The distributor id to confirm the existence of on the repository
    :type distributor_id: str
    :return: A dictionary of the missing resources
    :rtype: dict
    """
    missing_resources = {}
    group_manager = factory.consumer_group_query_manager()
    repo_manager = factory.repo_query_manager()
    distributor_manager = factory.repo_distributor_manager()
    try:
        group_manager.get_group(group_id)
    except pulp_exceptions.MissingResource:
        missing_resources['group_id'] = group_id
    repo = repo_manager.find_by_id(repo_id)
    if repo is None:
        missing_resources['repo_id'] = repo_id
    try:
        distributor_manager.get_distributor(repo_id, distributor_id)
    except pulp_exceptions.MissingResource:
        missing_resources['distributor_id'] = distributor_id
    return missing_resources
开发者ID:credativ,项目名称:pulp,代码行数:29,代码来源:consumer_groups.py


示例4: consumer_group_bind_itinerary

def consumer_group_bind_itinerary(group_id, repo_id, distributor_id, notify_agent, binding_config, agent_options):
    """
    Bind the members of the specified consumer group.
    :param group_id: A consumer group ID.
    :type group_id: str
    :param repo_id: A repository ID.
    :type repo_id: str
    :param distributor_id: A distributor ID.
    :type distributor_id: str
    :param agent_options: Bind options passed to the agent handler.
    :type agent_options: dict
    :param notify_agent: indicates if the agent should be sent a message about the new binding
    :type  notify_agent: bool
    :param binding_config: configuration options to use when generating the payload for this binding
    :type binding_config: dict
    :return: A list of call_requests.
    :rtype list
    """
    call_requests = []
    manager = managers.consumer_group_query_manager()
    group = manager.get_group(group_id)
    for consumer_id in group["consumer_ids"]:
        itinerary = bind_itinerary(
            consumer_id=consumer_id,
            repo_id=repo_id,
            distributor_id=distributor_id,
            notify_agent=notify_agent,
            binding_config=binding_config,
            agent_options=agent_options,
        )
        call_requests.extend(itinerary)
    return call_requests
开发者ID:mccun934,项目名称:pulp,代码行数:32,代码来源:consumer_group.py


示例5: POST

 def POST(self, consumer_group_id):
     criteria = Criteria.from_client_input(self.params().get('criteria', {}))
     manager = managers_factory.consumer_group_manager()
     tags = [resource_tag(dispatch_constants.RESOURCE_CONSUMER_GROUP_TYPE, consumer_group_id),
             action_tag('consumer_group_unassociate')]
     call_request = CallRequest(manager.unassociate,
                                [consumer_group_id, criteria],
                                tags=tags)
     call_request.updates_resource(dispatch_constants.RESOURCE_CONSUMER_GROUP_TYPE, consumer_group_id)
     execution.execute(call_request)
     query_manager = managers_factory.consumer_group_query_manager()
     group = query_manager.get_group(consumer_group_id)
     return self.ok(group['consumer_ids'])
开发者ID:kbotc,项目名称:pulp,代码行数:13,代码来源:consumer_groups.py


示例6: uninstall_content

def uninstall_content(consumer_group_id, units, options):
    """
    Create an itinerary for consumer group content uninstallation.
    :param consumer_group_id: unique id of the consumer group
    :type consumer_group_id: str
    :param units: units to uninstall
    :type units: list or tuple
    :param options: options to pass to the uninstall manager
    :type options: dict or None
    :return: Details of the subtasks that were executed
    :rtype: TaskResult
    """
    consumer_group = managers.consumer_group_query_manager().get_group(consumer_group_id)
    agent_manager = managers.consumer_agent_manager()

    return _process_group(consumer_group, PLP0022, {'group_id': consumer_group_id},
                          agent_manager.uninstall_content, units, options)
开发者ID:preethit,项目名称:pulp-1,代码行数:17,代码来源:consumer_group.py


示例7: update_content

    def update_content(consumer_group_id, units, options):
        """
        Create an itinerary for consumer group content update.
        :param consumer_group_id: unique id of the consumer group
        :type consumer_group_id: str
        :param units: units to update
        :type units: list or tuple
        :param options: options to pass to the update manager
        :type options: dict or None
        :return: Details of the subtasks that were executed
        :rtype: TaskResult
        """
        consumer_group = manager_factory.consumer_group_query_manager().get_group(consumer_group_id)
        agent_manager = manager_factory.consumer_agent_manager()

        return ConsumerGroupManager.process_group(consumer_group, error_codes.PLP0021,
                                                  {'group_id': consumer_group_id},
                                                  agent_manager.update_content, units, options)
开发者ID:nbetm,项目名称:pulp,代码行数:18,代码来源:cud.py


示例8: post

    def post(self, request, consumer_group_id):
        """
        Unassociate a consumer from the group.

        :param request: WSGI request object
        :type request: django.core.handlers.wsgi.WSGIRequest
        :param consumer_group_id: id for the requested group
        :type consumer_group_id: str
        :return: Response containing consumers bound to the group
        :rtype: django.http.HttpResponse
        """
        params = request.body_as_json
        criteria = Criteria.from_client_input(params.get('criteria', {}))
        manager = factory.consumer_group_manager()
        manager.unassociate(consumer_group_id, criteria)
        query_manager = factory.consumer_group_query_manager()
        group = query_manager.get_group(consumer_group_id)
        return generate_json_response_with_pulp_encoder(group['consumer_ids'])
开发者ID:credativ,项目名称:pulp,代码行数:18,代码来源:consumer_groups.py


示例9: consumer_group_content_uninstall_itinerary

def consumer_group_content_uninstall_itinerary(consumer_group_id, units, options):
    """
    Create an itinerary for consumer group content uninstallation.
    :param consumer_group_id: unique id of the consumer group
    :type consumer_group_id: str
    :param units: units to uninstall
    :type units: list or tuple
    :param options: options to pass to the uninstall manager
    :type options: dict or None
    :return: list of call requests
    :rtype: list
    """
    consumer_group = managers.consumer_group_query_manager().get_group(consumer_group_id)
    consumer_group_call_requests_list = []
    for consumer_id in consumer_group['consumer_ids']:
        consumer_call_requests = consumer_content_uninstall_itinerary(consumer_id, units, options)
        consumer_group_call_requests_list.extend(consumer_call_requests)
 
    return consumer_group_call_requests_list
开发者ID:bartwo,项目名称:pulp,代码行数:19,代码来源:consumer_group.py


示例10: consumer_group_unbind_itinerary

def consumer_group_unbind_itinerary(group_id, repo_id, distributor_id, options):
    """
    Unbind the members of the specified consumer group.
    :param group_id: A consumer group ID.
    :type group_id: str
    :param repo_id: A repository ID.
    :type repo_id: str
    :param distributor_id: A distributor ID.
    :type distributor_id: str
    :param options: Bind options passed to the agent handler.
    :type options: dict
    :return: A list of call_requests.
    :rtype list
    """
    call_requests = []
    manager = managers.consumer_group_query_manager()
    group = manager.get_group(group_id)
    for consumer_id in group["consumer_ids"]:
        itinerary = unbind_itinerary(consumer_id, repo_id, distributor_id, options)
        call_requests.extend(itinerary)
    return call_requests
开发者ID:mccun934,项目名称:pulp,代码行数:21,代码来源:consumer_group.py


示例11: bind

    def bind(group_id, repo_id, distributor_id, notify_agent, binding_config, agent_options):
        """
        Bind the members of the specified consumer group.

        :param group_id:       A consumer group ID.
        :type group_id:        str
        :param repo_id:        A repository ID.
        :type repo_id:         str
        :param distributor_id: A distributor ID.
        :type distributor_id:  str
        :param agent_options:  Bind options passed to the agent handler.
        :type agent_options:   dict
        :param notify_agent:   indicates if the agent should be sent a message about the new binding
        :type  notify_agent:   bool
        :param binding_config: configuration options to use when generating the payload for this
                               binding
        :type binding_config:  dict
        :return:               Details of the subtasks that were executed
        :rtype:                TaskResult
        """
        manager = manager_factory.consumer_group_query_manager()
        group = manager.get_group(group_id)

        bind_errors = []
        additional_tasks = []

        for consumer_id in group['consumer_ids']:
            try:
                report = bind_task(consumer_id, repo_id, distributor_id, notify_agent,
                                   binding_config, agent_options)
                if report.spawned_tasks:
                    additional_tasks.extend(report.spawned_tasks)
            except PulpException, e:
                # Log a message so that we can debug but don't throw
                _logger.debug(e)
                bind_errors.append(e)
            except Exception, e:
                _logger.exception(e)
                # Don't do anything else since we still want to process all the other consumers
                bind_errors.append(e)
开发者ID:nbetm,项目名称:pulp,代码行数:40,代码来源:cud.py


示例12: __init__

 def __init__(self):
     super(ConsumerGroupSearch, self).__init__(
         managers_factory.consumer_group_query_manager().find_by_criteria)
开发者ID:CUXIDUMDUM,项目名称:pulp,代码行数:3,代码来源:consumer_groups.py



注:本文中的pulp.server.managers.factory.consumer_group_query_manager函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python factory.consumer_history_manager函数代码示例发布时间:2022-05-25
下一篇:
Python factory.consumer_group_manager函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap