SECURITYGROUPS: { 'allow_post': True, 'allow_put': True, 'is_visible': True, 'is_filter': True, 'convert_to': converters.convert_none_to_empty_list, 'validate': { 'type:uuid_list': None }, 'default': const.ATTR_NOT_SPECIFIED } } } # Register the configuration options quota.register_quota_opts(quota.security_group_quota_opts) class Securitygroup(api_extensions.ExtensionDescriptor): """Security group extension.""" @classmethod def get_name(cls): return "security-group" @classmethod def get_alias(cls): return "security-group" @classmethod def get_description(cls): return "The security groups extension."
} } EXTENDED_ATTRIBUTES_2_0 = { 'ports': {SECURITYGROUPS: {'allow_post': True, 'allow_put': True, 'is_visible': True, 'is_filter': True, 'convert_to': converters.convert_none_to_empty_list, 'validate': {'type:uuid_list': None}, 'default': const.ATTR_NOT_SPECIFIED}}} # Register the configuration options quota.register_quota_opts(quota.security_group_quota_opts) class Securitygroup(api_extensions.ExtensionDescriptor): """Security group extension.""" @classmethod def get_name(cls): return "security-group" @classmethod def get_alias(cls): return "security-group" @classmethod def get_description(cls):
# action depends on type so validation has to occur in # the extension 'validate': { 'type:string': attr.DESCRIPTION_MAX_LEN }, # we set enforce_policy so operators can define policies # that restrict actions 'is_visible': True, 'enforce_policy': True, 'default': None }, } } # Register the configuration options quota.register_quota_opts(quota.rbac_quota_opts) class Rbac(extensions.ExtensionDescriptor): """RBAC policy support.""" @classmethod def get_name(cls): return "RBAC Policies" @classmethod def get_alias(cls): return 'rbac-policies' @classmethod def get_description(cls): return ("Allows creation and modification of policies that control "
'required_by_policy': True, 'validate': { 'type:string': db_const.PROJECT_ID_FIELD_SIZE }, 'is_visible': True }, 'status': { 'allow_post': False, 'allow_put': False, 'is_visible': True }, }, } # Register the configuration options quota.register_quota_opts(quota.l3_quota_opts) class L3(extensions.ExtensionDescriptor): @classmethod def get_name(cls): return "Neutron L3 Router" @classmethod def get_alias(cls): return "router" @classmethod def get_description(cls): return ("Router abstraction for basic L3 forwarding" " between L2 Neutron networks and access to external"
import webob from neutron._i18n import _, _LI, _LW from neutron.common import exceptions from neutron.conf import quota from neutron.db.quota import api as quota_api from neutron.quota import resource_registry LOG = logging.getLogger(__name__) QUOTA_DB_MODULE = quota.QUOTA_DB_MODULE QUOTA_DB_DRIVER = quota.QUOTA_DB_DRIVER QUOTA_CONF_DRIVER = quota.QUOTA_CONF_DRIVER # Register the configuration options quota.register_quota_opts(quota.core_quota_opts) class ConfDriver(object): """Configuration driver. Driver to perform necessary checks to enforce quotas and obtain quota information. The default driver utilizes the default values in neutron.conf. """ def _get_quotas(self, context, resources): """Get quotas. A helper method which retrieves the quotas for the specific resources identified by keys, and which apply to the current
# under the License. from neutron_lib import exceptions from oslo_config import cfg from oslo_log import log as logging from oslo_utils import importutils from neutron.conf import quota from neutron.quota import resource_registry LOG = logging.getLogger(__name__) QUOTA_DB_MODULE = quota.QUOTA_DB_MODULE QUOTA_DB_DRIVER = quota.QUOTA_DB_DRIVER # Register the configuration options quota.register_quota_opts(quota.core_quota_opts) class QuotaEngine(object): """Represent the set of recognized quotas.""" _instance = None @classmethod def get_instance(cls): if not cls._instance: cls._instance = cls() return cls._instance def __init__(self, quota_driver_class=None): """Initialize a Quota object."""
'required_by_policy': True}, 'fixed_ip_address': {'allow_post': True, 'allow_put': True, 'validate': {'type:ip_address_or_none': None}, 'is_visible': True, 'default': None}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'validate': { 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, 'is_visible': True}, 'status': {'allow_post': False, 'allow_put': False, 'is_visible': True}, }, } # Register the configuration options quota.register_quota_opts(quota.l3_quota_opts) class L3(extensions.ExtensionDescriptor): @classmethod def get_name(cls): return "Neutron L3 Router" @classmethod def get_alias(cls): return "router" @classmethod def get_description(cls): return ("Router abstraction for basic L3 forwarding"
"allow_post": True, "allow_put": False, # action depends on type so validation has to occur in # the extension "validate": {"type:string": attr.DESCRIPTION_MAX_LEN}, # we set enforce_policy so operators can define policies # that restrict actions "is_visible": True, "enforce_policy": True, "default": None, }, } } # Register the configuration options quota.register_quota_opts(quota.rbac_quota_opts) class Rbac(extensions.ExtensionDescriptor): """RBAC policy support.""" @classmethod def get_name(cls): return "RBAC Policies" @classmethod def get_alias(cls): return "rbac-policies" @classmethod def get_description(cls):