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

Python v2_0.update_dict函数代码示例

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

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



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

示例1: args2body

 def args2body(self, parsed_args):
     _policy_id = neutronv20.find_resourceid_by_name_or_id(
         self.get_client(), "firewall_policy", parsed_args.firewall_policy_id
     )
     body = {self.resource: {"firewall_policy_id": _policy_id, "admin_state_up": parsed_args.admin_state}}
     neutronv20.update_dict(parsed_args, body[self.resource], ["name", "description", "shared", "tenant_id"])
     return body
开发者ID:neumerance,项目名称:cloudcapped,代码行数:7,代码来源:firewall.py


示例2: args2body

 def args2body(self, parsed_args):
     body = {}
     if hasattr(parsed_args, 'admin_state'):
         body['admin_state_up'] = parsed_args.admin_state
     neutronV20.update_dict(parsed_args, body,
                            ['name', 'distributed'])
     return {self.resource: body}
开发者ID:Gvkrishna,项目名称:python-neutronclient,代码行数:7,代码来源:router.py


示例3: args2body

 def args2body(self, parsed_args):
     _subnet_id = neutronV20.find_resourceid_by_name_or_id(self.get_client(), "subnet", parsed_args.subnet_id)
     body = {"admin_state_up": parsed_args.admin_state, "subnet_id": _subnet_id}
     neutronV20.update_dict(
         parsed_args, body, ["description", "lb_method", "name", "protocol", "tenant_id", "provider"]
     )
     return {self.resource: body}
开发者ID:rjain-iitr,项目名称:python-neutronclient,代码行数:7,代码来源:pool.py


示例4: args2body

 def args2body(self, parsed_args):
     body = {}
     validate_peer_attributes(parsed_args)
     neutronv20.update_dict(parsed_args, body,
                            ['name', 'peer_ip',
                             'remote_as', 'auth_type', 'password'])
     return {self.resource: body}
开发者ID:ChameleonCloud,项目名称:python-neutronclient,代码行数:7,代码来源:peer.py


示例5: args2body

 def args2body(self, parsed_args):
     body = {
         self.resource: {}
     }
     neutronV20.update_dict(parsed_args, body[self.resource],
                            ['name','description','certificate_content','private_key'])
     return body
开发者ID:CingHu,项目名称:neutronclient-ustack,代码行数:7,代码来源:tlscertificate.py


示例6: args2body

    def args2body(self, parsed_args):
        if parsed_args.loadbalancer:
            parsed_args.loadbalancer = _get_loadbalancer_id(self.get_client(), parsed_args.loadbalancer)
        body = {
            self.resource: {
                "loadbalancer_id": parsed_args.loadbalancer,
                "protocol": parsed_args.protocol,
                "protocol_port": parsed_args.protocol_port,
                "admin_state_up": parsed_args.admin_state,
            }
        }

        neutronV20.update_dict(
            parsed_args,
            body[self.resource],
            [
                "connection-limit",
                "description",
                "loadbalancer_id",
                "name",
                "default_tls_container_id",
                "sni_container_ids",
                "tenant_id",
            ],
        )
        return body
开发者ID:mmasaki,项目名称:python-neutronclient,代码行数:26,代码来源:listener.py


示例7: args2body

 def args2body(self, parsed_args):
     body = {'admin_state_up': parsed_args.admin_state}
     neutronV20.update_dict(parsed_args, body,
                            ['name', 'tenant_id', 'distributed', 'ha',
                             'description'])
     availability_zone.args2body_az_hint(parsed_args, body)
     return {self.resource: body}
开发者ID:eayunstack,项目名称:python-neutronclient,代码行数:7,代码来源:router.py


示例8: updatable_args2body

def updatable_args2body(parsed_args, body, for_create=True, ip_version=None):
    if parsed_args.disable_dhcp and parsed_args.enable_dhcp:
        raise exceptions.CommandError(_(
            "You cannot enable and disable DHCP at the same time."))

    neutronV20.update_dict(parsed_args, body,
                           ['name', 'allocation_pools',
                            'host_routes', 'dns_nameservers',
                            'description'])
    if parsed_args.no_gateway:
        body['gateway_ip'] = None
    elif parsed_args.gateway:
        body['gateway_ip'] = parsed_args.gateway
    if parsed_args.disable_dhcp:
        body['enable_dhcp'] = False
    if parsed_args.enable_dhcp:
        body['enable_dhcp'] = True
    if for_create and parsed_args.ipv6_ra_mode:
        if ip_version == 4:
            raise exceptions.CommandError(_("--ipv6-ra-mode is invalid "
                                            "when --ip-version is 4"))
        body['ipv6_ra_mode'] = parsed_args.ipv6_ra_mode
    if for_create and parsed_args.ipv6_address_mode:
        if ip_version == 4:
            raise exceptions.CommandError(_("--ipv6-address-mode is "
                                            "invalid when --ip-version "
                                            "is 4"))
        body['ipv6_address_mode'] = parsed_args.ipv6_address_mode
开发者ID:ChameleonCloud,项目名称:python-neutronclient,代码行数:28,代码来源:subnet.py


示例9: args2body

 def args2body(self, parsed_args):
     body = {'network': {
         'name': parsed_args.name,
         'admin_state_up': parsed_args.admin_state}, }
     neutronV20.update_dict(parsed_args, body['network'],
                            ['shared', 'tenant_id'])
     return body
开发者ID:cboling,项目名称:SDNdbg,代码行数:7,代码来源:network.py


示例10: args2body

 def args2body(self, parsed_args):
     body = {
         self.resource: {
             'admin_state_up': parsed_args.admin_state, }, }
     neutronV20.update_dict(parsed_args, body[self.resource],
                            ['description'])
     return body
开发者ID:Dynavisor,项目名称:python-neutronclient,代码行数:7,代码来源:agent.py


示例11: _common_args2body

def _common_args2body(client, parsed_args, is_create=True):
    if parsed_args.redirect_url:
        if parsed_args.action != 'REDIRECT_TO_URL':
            raise exceptions.CommandError(_('Action must be REDIRECT_TO_URL'))
    if parsed_args.redirect_pool:
        if parsed_args.action != 'REDIRECT_TO_POOL':
            raise exceptions.CommandError(_('Action must be REDIRECT_TO_POOL'))
        parsed_args.redirect_pool_id = _get_pool_id(
            client, parsed_args.redirect_pool)
    if (parsed_args.action == 'REDIRECT_TO_URL' and
            not parsed_args.redirect_url):
        raise exceptions.CommandError(_('Redirect URL must be specified'))
    if (parsed_args.action == 'REDIRECT_TO_POOL' and
            not parsed_args.redirect_pool):
        raise exceptions.CommandError(_('Redirect pool must be specified'))

    attributes = ['name', 'description',
                  'action', 'redirect_pool_id', 'redirect_url',
                  'position', 'admin_state_up']
    if is_create:
        parsed_args.listener_id = _get_listener_id(
            client, parsed_args.listener)
        attributes.extend(['listener_id', 'tenant_id'])
    body = {}
    neutronV20.update_dict(parsed_args, body, attributes)
    return {'l7policy': body}
开发者ID:ChameleonCloud,项目名称:python-neutronclient,代码行数:26,代码来源:l7policy.py


示例12: args2body

 def args2body(self, parsed_args):
     body = {'name': parsed_args.name}
     neutronV20.update_dict(parsed_args, body,
                            ['segment_type', 'sub_type', 'segment_range',
                             'physical_network', 'multicast_ip_range',
                             'add_tenants'])
     return {'network_profile': body}
开发者ID:kimcharli,项目名称:python-neutronclient,代码行数:7,代码来源:networkprofile.py


示例13: args2body

    def args2body(self, parsed_args, body=None):
        """Add in conditional args and then return all conn info."""

        if body is None:
            body = {}
        if parsed_args.dpd:
            vpn_utils.validate_dpd_dict(parsed_args.dpd)
            body['dpd'] = parsed_args.dpd
        if parsed_args.local_ep_group:
            _local_epg = neutronv20.find_resourceid_by_name_or_id(
                self.get_client(), 'endpoint_group',
                parsed_args.local_ep_group)
            body['local_ep_group_id'] = _local_epg
        if parsed_args.peer_ep_group:
            _peer_epg = neutronv20.find_resourceid_by_name_or_id(
                self.get_client(), 'endpoint_group',
                parsed_args.peer_ep_group)
            body['peer_ep_group_id'] = _peer_epg
        if hasattr(parsed_args, 'mtu') and int(parsed_args.mtu) < 68:
            message = _("Invalid MTU value: MTU must be "
                        "greater than or equal to 68.")
            raise exceptions.CommandError(message)
        # ToDo (Reedip) : Remove below check when peer-cidr is removed
        if parsed_args.peer_cidrs and parsed_args.local_ep_group:
            message = _("You cannot specify both endpoint groups and peer "
                        "CIDR(s).")
            raise exceptions.CommandError(message)
        neutronv20.update_dict(parsed_args, body,
                               ['peer_id', 'mtu', 'initiator', 'psk',
                                'peer_address', 'name', 'description',
                                'peer_cidrs'])
        return {self.resource: body}
开发者ID:Juniper,项目名称:python-neutronclient,代码行数:32,代码来源:ipsec_site_connection.py


示例14: comman_args2body

def comman_args2body(parsed_args):
    body = {'ovsvapp_cluster': {
            'vcenter_id': parsed_args.vcenter_id,
            'clusters': parsed_args.clusters}, }
    neutronV20.update_dict(parsed_args, body['ovsvapp_cluster'],
                           ['vcenter_id', 'clusters'])
    return body
开发者ID:hp-networking,项目名称:networking-vsphere,代码行数:7,代码来源:_ovsvapp_cluster.py


示例15: args2body

 def args2body(self, parsed_args):
     body = {
         self.resource: {}
     }
     neutronV20.update_dict(parsed_args, body[self.resource],
                            ['key','value'])
     return body
开发者ID:CingHu,项目名称:neutronclient-ustack,代码行数:7,代码来源:l7rule.py


示例16: _parse_common_args

def _parse_common_args(body, parsed_args, client):
    neutronV20.update_dict(parsed_args, body,
                           ['name', 'description', 'connection_limit'])
    if parsed_args.default_pool:
        default_pool_id = _get_pool_id(
            client, parsed_args.default_pool)
        body['default_pool_id'] = default_pool_id
开发者ID:ChameleonCloud,项目名称:python-neutronclient,代码行数:7,代码来源:listener.py


示例17: args2body

 def args2body(self, parsed_args):
     body = {'name': parsed_args.name,
             'ip_version': parsed_args.ip_version}
     if parsed_args.shared:
         body['shared'] = True
     neutronV20.update_dict(parsed_args, body, ['tenant_id'])
     return {self.resource: body}
开发者ID:Juniper,项目名称:python-neutronclient,代码行数:7,代码来源:address_scope.py


示例18: args2body

 def args2body(self, parsed_args):
     body = {}
     client = self.get_client()
     if parsed_args.logical_source_port:
         body["logical_source_port"] = pp.get_port_id(client, parsed_args.logical_source_port)
     if parsed_args.logical_destination_port:
         body["logical_destination_port"] = pp.get_port_id(client, parsed_args.logical_destination_port)
     if parsed_args.source_port:
         self._fill_protocol_port_info(body, "source", parsed_args.source_port)
     if parsed_args.destination_port:
         self._fill_protocol_port_info(body, "destination", parsed_args.destination_port)
     neutronv20.update_dict(
         parsed_args,
         body,
         [
             "name",
             "description",
             "protocol",
             "source_ip_prefix",
             "destination_ip_prefix",
             "ethertype",
             "l7_parameters",
         ],
     )
     return {self.resource: body}
开发者ID:igordcard,项目名称:networking-sfc,代码行数:25,代码来源:flow_classifier.py


示例19: args2body

 def args2body(self, parsed_args):
     body = {self.resource: {}, }
     neutronV20.update_dict(parsed_args, body[self.resource],
                            ['name', 'description', 'shared', 'vendor',
                             'insertion_mode', 'service_type',
                             'service_flavor'])
     return body
开发者ID:openstack,项目名称:python-group-based-policy-client,代码行数:7,代码来源:servicechain.py


示例20: args2body

 def args2body(self, parsed_args):
     body = {
         self.resource: {
         },
     }
     neutronV20.update_dict(parsed_args, body[self.resource],
                            ['name','securitygroup_id', 'description'])
     return body
开发者ID:CingHu,项目名称:neutronclient-ustack,代码行数:8,代码来源:loadbalancer.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python securitygroup._get_protocol_port函数代码示例发布时间:2022-05-27
下一篇:
Python v2_0.parse_args_to_dict函数代码示例发布时间: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