本文整理汇总了Python中nova.api.openstack.compute.views.versions.get_view_builder函数的典型用法代码示例。如果您正苦于以下问题:Python get_view_builder函数的具体用法?Python get_view_builder怎么用?Python get_view_builder使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_view_builder函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: show
def show(self, req, id='v2.1'):
builder = views_versions.get_view_builder(req)
if req.is_legacy_v2():
id = 'v2.0'
if id not in versions.VERSIONS:
raise webob.exc.HTTPNotFound()
return builder.build_version(versions.VERSIONS[id])
示例2: show
def show(self, req):
builder = views_versions.get_view_builder(req)
return builder.build_version(VERSIONS['v2.0'])
示例3: multi
def multi(self, req, body=None):
"""Return multiple choices."""
builder = views_versions.get_view_builder(req)
return builder.build_choices(VERSIONS, req)
示例4: index
def index(self, req, body=None):
"""Return all versions."""
builder = views_versions.get_view_builder(req)
return builder.build_versions(VERSIONS)