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

Python resource_helper.build_plural_mappings函数代码示例

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

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



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

示例1: get_resources

 def get_resources(cls):
     plural_mappings = resource_helper.build_plural_mappings(
         {}, RESOURCE_ATTRIBUTE_MAP)
     attr.PLURALS.update(plural_mappings)
     return resource_helper.build_resource_info(plural_mappings,
                                                RESOURCE_ATTRIBUTE_MAP,
                                                constants.SERVICECHAIN)
开发者ID:yapengwu,项目名称:group-based-policy,代码行数:7,代码来源:servicechain.py


示例2: get_resources

    def get_resources(cls):
        """Returns Ext Resources."""
        plural_mappings = resource_helper.build_plural_mappings(
            {}, RESOURCE_ATTRIBUTE_MAP)
        attr.PLURALS.update(plural_mappings)
        resources = resource_helper.build_resource_info(
            plural_mappings,
            RESOURCE_ATTRIBUTE_MAP,
            constants.FLAVORS)
        plugin = manager.NeutronManager.get_service_plugins()[
            constants.FLAVORS]
        for collection_name in SUB_RESOURCE_ATTRIBUTE_MAP:
            # Special handling needed for sub-resources with 'y' ending
            # (e.g. proxies -> proxy)
            resource_name = collection_name[:-1]
            parent = SUB_RESOURCE_ATTRIBUTE_MAP[collection_name].get('parent')
            params = SUB_RESOURCE_ATTRIBUTE_MAP[collection_name].get(
                'parameters')

            controller = base.create_resource(collection_name, resource_name,
                                              plugin, params,
                                              allow_bulk=True,
                                              parent=parent)

            resource = extensions.ResourceExtension(
                collection_name,
                controller, parent,
                path_prefix=FLAVORS_PREFIX,
                attr_map=params)
            resources.append(resource)

        return resources
开发者ID:cloudbase,项目名称:neutron,代码行数:32,代码来源:flavors.py


示例3: get_resources

 def get_resources(cls):
     """Returns Ext Resources."""
     plural_mappings = resource_helper.build_plural_mappings({}, RESOURCE_ATTRIBUTE_MAP)
     plural_mappings["sfcs"] = "sfc"
     return resource_helper.build_resource_info(
         plural_mappings, RESOURCE_ATTRIBUTE_MAP, SFC_EXT, register_quota=True
     )
开发者ID:igordcard,项目名称:networking-sfc,代码行数:7,代码来源:sfc.py


示例4: get_resources

    def get_resources(cls):
        """Returns Ext Resources."""
        plural_mappings = resource_helper.build_plural_mappings(
            {}, apidef.RESOURCE_ATTRIBUTE_MAP)
        resources = resource_helper.build_resource_info(
            plural_mappings,
            apidef.RESOURCE_ATTRIBUTE_MAP,
            constants.FLAVORS)
        plugin = directory.get_plugin(constants.FLAVORS)
        for collection_name in apidef.SUB_RESOURCE_ATTRIBUTE_MAP:
            # Special handling needed for sub-resources with 'y' ending
            # (e.g. proxies -> proxy)
            resource_name = collection_name[:-1]
            parent = apidef.SUB_RESOURCE_ATTRIBUTE_MAP[collection_name].get(
                'parent')
            params = apidef.SUB_RESOURCE_ATTRIBUTE_MAP[collection_name].get(
                'parameters')

            controller = base.create_resource(collection_name, resource_name,
                                              plugin, params,
                                              allow_bulk=True,
                                              parent=parent)

            resource = extensions.ResourceExtension(
                collection_name,
                controller, parent,
                path_prefix=apidef.API_PREFIX,
                attr_map=params)
            resources.append(resource)

        return resources
开发者ID:cubeek,项目名称:neutron,代码行数:31,代码来源:flavors.py


示例5: get_resources

 def get_resources(cls):
     """Returns Ext Resources."""
     plural_mappings = resource_helper.build_plural_mappings({}, RESOURCE_ATTRIBUTE_MAP)
     plural_mappings["flow_classifiers"] = "flow_classifier"
     return resource_helper.build_resource_info(
         plural_mappings, RESOURCE_ATTRIBUTE_MAP, FLOW_CLASSIFIER_EXT, register_quota=True
     )
开发者ID:igordcard,项目名称:networking-sfc,代码行数:7,代码来源:flowclassifier.py


示例6: get_resources

    def get_resources(cls):
        """Returns Ext Resources."""
        special_mappings = {"policies": "policy"}
        plural_mappings = resource_helper.build_plural_mappings(
            special_mappings, itertools.chain(RESOURCE_ATTRIBUTE_MAP, SUB_RESOURCE_ATTRIBUTE_MAP)
        )
        attr.PLURALS.update(plural_mappings)

        resources = resource_helper.build_resource_info(
            plural_mappings, RESOURCE_ATTRIBUTE_MAP, constants.QOS, translate_name=True, allow_bulk=True
        )

        plugin = manager.NeutronManager.get_service_plugins()[constants.QOS]
        for collection_name in SUB_RESOURCE_ATTRIBUTE_MAP:
            resource_name = collection_name[:-1]
            parent = SUB_RESOURCE_ATTRIBUTE_MAP[collection_name].get("parent")
            params = SUB_RESOURCE_ATTRIBUTE_MAP[collection_name].get("parameters")

            controller = base.create_resource(
                collection_name,
                resource_name,
                plugin,
                params,
                allow_bulk=True,
                parent=parent,
                allow_pagination=True,
                allow_sorting=True,
            )

            resource = extensions.ResourceExtension(
                collection_name, controller, parent, path_prefix=QOS_PREFIX, attr_map=params
            )
            resources.append(resource)

        return resources
开发者ID:electrocucaracha,项目名称:neutron,代码行数:35,代码来源:qos.py


示例7: get_resources

    def get_resources(cls):
        plural_mappings = resource_helper.build_plural_mappings(
            {}, RESOURCE_ATTRIBUTE_MAP)
        plural_mappings['health_monitors_status'] = 'health_monitor_status'
        attr.PLURALS.update(plural_mappings)
        action_map = {'pool': {'stats': 'GET'}}
        resources = resource_helper.build_resource_info(plural_mappings,
                                                        RESOURCE_ATTRIBUTE_MAP,
                                                        constants.LOADBALANCER,
                                                        action_map=action_map)
        plugin = manager.NeutronManager.get_service_plugins()[
            constants.LOADBALANCER]
        for collection_name in SUB_RESOURCE_ATTRIBUTE_MAP:
            # Special handling needed for sub-resources with 'y' ending
            # (e.g. proxies -> proxy)
            resource_name = collection_name[:-1]
            parent = SUB_RESOURCE_ATTRIBUTE_MAP[collection_name].get('parent')
            params = SUB_RESOURCE_ATTRIBUTE_MAP[collection_name].get(
                'parameters')

            controller = base.create_resource(collection_name, resource_name,
                                              plugin, params,
                                              allow_bulk=True,
                                              parent=parent)

            resource = extensions.ResourceExtension(
                collection_name,
                controller, parent,
                path_prefix=constants.COMMON_PREFIXES[constants.LOADBALANCER],
                attr_map=params)
            resources.append(resource)

        return resources
开发者ID:actus10,项目名称:neutron,代码行数:33,代码来源:loadbalancer.py


示例8: get_resources

 def get_resources(cls):
     special_mappings = {'firewall_policies': 'firewall_policy'}
     plural_mappings = resource_helper.build_plural_mappings(
         special_mappings, firewall.RESOURCE_ATTRIBUTE_MAP)
     return resource_helper.build_resource_info(
         plural_mappings, firewall.RESOURCE_ATTRIBUTE_MAP,
         fwaas_constants.FIREWALL, action_map=firewall.ACTION_MAP,
         register_quota=True)
开发者ID:openstack,项目名称:neutron-fwaas,代码行数:8,代码来源:firewall.py


示例9: get_resources

 def get_resources(cls):
     plural_mappings = resource_helper.build_plural_mappings(
         {}, RESOURCE_ATTRIBUTE_MAP)
     return resource_helper.build_resource_info(plural_mappings,
                                                RESOURCE_ATTRIBUTE_MAP,
                                                nconstants.VPN,
                                                register_quota=True,
                                                translate_name=True)
开发者ID:openstack,项目名称:neutron-vpnaas,代码行数:8,代码来源:vpn_endpoint_groups.py


示例10: get_resources

 def get_resources(cls):
     """Returns Ext Resources."""
     plural_mappings = resource_helper.build_plural_mappings(
         {}, l3_apidef.RESOURCE_ATTRIBUTE_MAP)
     return resource_helper.build_resource_info(
         plural_mappings, l3_apidef.RESOURCE_ATTRIBUTE_MAP,
         constants.L3, action_map=l3_apidef.ACTION_MAP,
         register_quota=True)
开发者ID:cubeek,项目名称:neutron,代码行数:8,代码来源:l3.py


示例11: get_resources

 def get_resources(cls):
     plural_mappings = resource_helper.build_plural_mappings(
         {}, RESOURCE_ATTRIBUTE_MAP)
     gbp_extensions.register_plurals(plural_mappings)
     return resource_helper.build_resource_info(plural_mappings,
                                                RESOURCE_ATTRIBUTE_MAP,
                                                constants.SERVICECHAIN,
                                                register_quota=True)
开发者ID:openstack,项目名称:group-based-policy,代码行数:8,代码来源:servicechain.py


示例12: get_resources

 def get_resources(cls):
     special_mappings = {"ikepolicies": "ikepolicy", "ipsecpolicies": "ipsecpolicy"}
     plural_mappings = resource_helper.build_plural_mappings(special_mappings, RESOURCE_ATTRIBUTE_MAP)
     plural_mappings["peer_cidrs"] = "peer_cidr"
     attr.PLURALS.update(plural_mappings)
     return resource_helper.build_resource_info(
         plural_mappings, RESOURCE_ATTRIBUTE_MAP, constants.VPN, register_quota=True, translate_name=True
     )
开发者ID:CiscoSystems,项目名称:neutron,代码行数:8,代码来源:vpnaas.py


示例13: get_resources

 def get_resources(cls):
     """Returns Ext Resources."""
     plural_mappings = resource_helper.build_plural_mappings(
         {}, RESOURCE_ATTRIBUTE_MAP)
     attr.PLURALS.update(plural_mappings)
     return resource_helper.build_resource_info(plural_mappings,
                                                RESOURCE_ATTRIBUTE_MAP,
                                                constants.L3_ROUTER_NAT)
开发者ID:CiscoKorea,项目名称:networking-cisco,代码行数:8,代码来源:routertype.py


示例14: get_resources

 def get_resources(cls):
     """Returns Ext Resources."""
     plural_mappings = resource_helper.build_plural_mappings(
         {}, RESOURCE_ATTRIBUTE_MAP)
     # attr.PLURALS.update(plural_mappings)
     return resource_helper.build_resource_info(plural_mappings,
                                                RESOURCE_ATTRIBUTE_MAP,
                                                None,
                                                register_quota=True)
开发者ID:openstack,项目名称:quark,代码行数:9,代码来源:scalingip.py


示例15: get_resources

 def get_resources(cls):
     plural_mappings = resource_helper.build_plural_mappings(
         {}, RESOURCE_ATTRIBUTE_MAP)
     plural_mappings['service_graphs'] = 'service_graph'
     return resource_helper.build_resource_info(
         plural_mappings,
         RESOURCE_ATTRIBUTE_MAP,
         ext_sfc.SFC_EXT,
         register_quota=True)
开发者ID:openstack,项目名称:networking-sfc,代码行数:9,代码来源:servicegraph.py


示例16: get_resources

 def get_resources(cls):
     """Returns Ext Resources."""
     plural_mappings = resource_helper.build_plural_mappings({}, RESOURCE_ATTRIBUTE_MAP)
     plural_mappings["external_fixed_ips"] = "external_fixed_ip"
     attr.PLURALS.update(plural_mappings)
     action_map = {"router": {"add_router_interface": "PUT", "remove_router_interface": "PUT"}}
     return resource_helper.build_resource_info(
         plural_mappings, RESOURCE_ATTRIBUTE_MAP, constants.L3_ROUTER_NAT, action_map=action_map, register_quota=True
     )
开发者ID:sebrandon1,项目名称:neutron,代码行数:9,代码来源:l3.py


示例17: get_resources

 def get_resources(cls):
     """Returns Ext Resources."""
     plural_mappings = resource_helper.build_plural_mappings(
         {}, metering_apidef.RESOURCE_ATTRIBUTE_MAP)
     # PCM: Metering sets pagination and sorting to True. Do we have cfg
     # entries for these so can be read? Else, must pass in.
     return resource_helper.build_resource_info(
         plural_mappings, metering_apidef.RESOURCE_ATTRIBUTE_MAP,
         constants.METERING, translate_name=True, allow_bulk=True)
开发者ID:cubeek,项目名称:neutron,代码行数:9,代码来源:metering.py


示例18: get_resources

    def get_resources(cls):
        """Returns Ext Resources."""
        plural_mappings = resource_helper.build_plural_mappings(
            {}, RESOURCE_ATTRIBUTE_MAP)
        resources = resource_helper.build_resource_info(plural_mappings,
                                                        RESOURCE_ATTRIBUTE_MAP,
                                                        constants.L2GW)

        return resources
开发者ID:openstack,项目名称:networking-l2gw,代码行数:9,代码来源:l2gateway.py


示例19: get_resources

 def get_resources(cls):
     special_mappings = {
         'l2_policies': 'l2_policy', 'l3_policies': 'l3_policy',
         'network_service_policies': 'network_service_policy'}
     plural_mappings = resource_helper.build_plural_mappings(
         special_mappings, RESOURCE_ATTRIBUTE_MAP)
     attr.PLURALS.update(plural_mappings)
     return resource_helper.build_resource_info(plural_mappings,
                                                RESOURCE_ATTRIBUTE_MAP,
                                                constants.GROUP_POLICY)
开发者ID:yapengwu,项目名称:group-based-policy,代码行数:10,代码来源:group_policy.py


示例20: get_resources

 def get_resources(cls):
     """Returns Ext Resources."""
     plural_mappings = resource_helper.build_plural_mappings(
         {}, RESOURCE_ATTRIBUTE_MAP)
     attr.PLURALS.update(plural_mappings)
     return resource_helper.build_resource_info(plural_mappings,
                                                RESOURCE_ATTRIBUTE_MAP,
                                                constants.INSTANTVPN,
                                                translate_name=True,
                                                allow_bulk=True)    
开发者ID:VikramChoudhary,项目名称:instantvpn,代码行数:10,代码来源:instantvpn.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python resource_helper.build_resource_info函数代码示例发布时间:2022-05-27
下一篇:
Python base.create_resource函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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