Flavors access (flavors, os-flavor-access)
flavor访问权限控制
访问权限控制只针对私有的flavor, 管理员可以访问私有flavor
openstack api access定义如下:
Lists tenants who have access to a private flavor and adds private flavor access to and
removes private flavor access from tenants. By default, only administrators can manage private flavor access. A private flavor has is_public set to false while a public flavor has is_public set to true.
一. url及命令
涉及url:
/flavors/{flavor_id}/os-flavor-access
/flavors/{flavor_id}/action
涉及cmd功能列表
flavor-access-add Add flavor access for the given tenant.
flavor-access-list Print access information about the given
flavor.
flavor-access-remove Remove flavor access for the given tenant.
二. 源码分析
在setup.cfg 中找到对应处理类
flavor_access = nova.api.openstack.compute.flavor_access:FlavorAccess
找到对应文件,FlavorAccess源码定义如下:
class FlavorAccess(extensions.V21APIExtensionBase):
"""Flavor access support."""
name = "FlavorAccess"
alias = ALIAS
version = 1
def get_resources(self):
res = extensions.ResourceExtension(
ALIAS,
controller=FlavorAccessController(),
parent=dict(member_name='flavor', collection_name='fl