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

Python common.quote_user_host函数代码示例

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

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



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

示例1: get

    def get(self, instance, username, hostname=None):
        """Get a single User from the instance's Database.

        :rtype: :class:`User`.
        """
        user = common.quote_user_host(username, hostname)
        url = "/instances/%s/users/%s" % (base.getid(instance), user)
        return self._get(url, "user")
开发者ID:Hopebaytech,项目名称:python-troveclient,代码行数:8,代码来源:users.py


示例2: revoke

 def revoke(self, instance, username, database, hostname=None):
     """Revoke from an existing user access permissions to a database."""
     instance_id = base.getid(instance)
     user = quote_user_host(username, hostname)
     url = "/instances/%(instance_id)s/users/%(user)s/" "databases/%(database)s"
     local_vars = locals()
     resp, body = self.api.client.delete(url % local_vars)
     check_for_exceptions(resp, body)
开发者ID:hub-cap,项目名称:python-troveclient,代码行数:8,代码来源:users.py


示例3: grant

 def grant(self, instance, username, databases, hostname=None):
     """Allow an existing user permissions to access a database."""
     instance_id = base.getid(instance)
     user = quote_user_host(username, hostname)
     url = "/instances/%(instance_id)s/users/%(user)s/databases"
     dbs = {'databases': [{'name': db} for db in databases]}
     resp, body = self.api.client.put(url % locals(), body=dbs)
     check_for_exceptions(resp, body)
开发者ID:krast,项目名称:python-troveclient,代码行数:8,代码来源:users.py


示例4: list_access

 def list_access(self, instance, username, hostname=None):
     """Show all databases the given user has access to. """
     instance_id = base.getid(instance)
     user = quote_user_host(username, hostname)
     url = "/instances/%(instance_id)s/users/%(user)s/databases"
     resp, body = self.api.client.get(url % locals())
     check_for_exceptions(resp, body)
     if not body:
         raise Exception("Call to %s did not return to a body" % url)
     return [databases.Database(self, db) for db in body['databases']]
开发者ID:krast,项目名称:python-troveclient,代码行数:10,代码来源:users.py


示例5: update_attributes

    def update_attributes(self, instance, username, newuserattr=None,
                          hostname=None):
        """Update attributes of a single User in an instance.

        :rtype: :class:`User`.
        """
        if not newuserattr:
            raise Exception("No updates specified for user %s" % username)
        instance_id = base.getid(instance)
        user = common.quote_user_host(username, hostname)
        user_dict = {}
        user_dict['user'] = newuserattr
        url = "/instances/%s/users/%s" % (instance_id, user)
        resp, body = self.api.client.put(url, body=user_dict)
        common.check_for_exceptions(resp, body, url)
开发者ID:balagopalraj,项目名称:clearlinux,代码行数:15,代码来源:users.py


示例6: update_attributes

    def update_attributes(self, instance, username, newuserattr=None, hostname=None):
        """
        Update attributes of a single User in an instance.

        :rtype: :class:`User`.
        """
        instance_id = base.getid(instance)
        user = quote_user_host(username, hostname)
        user_dict = {}
        if not newuserattr:
            newuserattr = {}
        else:
            user_dict["user"] = newuserattr
        url = "/instances/%s/users/%s" % (instance_id, user)
        resp, body = self.api.client.put(url, body=user_dict)
        check_for_exceptions(resp, body)
开发者ID:hub-cap,项目名称:python-troveclient,代码行数:16,代码来源:users.py


示例7: delete

 def delete(self, instance, username, hostname=None):
     """Delete an existing user in the specified instance."""
     user = common.quote_user_host(username, hostname)
     url = "/instances/%s/users/%s" % (base.getid(instance), user)
     resp, body = self.api.client.delete(url)
     common.check_for_exceptions(resp, body, url)
开发者ID:Hopebaytech,项目名称:python-troveclient,代码行数:6,代码来源:users.py


示例8: delete

 def delete(self, instance_id, username, hostname=None):
     """Delete an existing user in the specified instance"""
     user = quote_user_host(username, hostname)
     url = "/instances/%s/users/%s" % (instance_id, user)
     resp, body = self.api.client.delete(url)
     check_for_exceptions(resp, body)
开发者ID:cp16net,项目名称:python-troveclient,代码行数:6,代码来源:users.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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