Debian Codegraph @

neutron_vpnaas/extensions/vpn_endpoint_groups.py

raw
1 # (c) Copyright 2015 NEC Corporation, All Rights Reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); you may
4 # not use this file except in compliance with the License. You may obtain
5 # a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 # License for the specific language governing permissions and limitations
13 # under the License.
14
15 import abc
16
17 from neutron_lib.api.definitions import vpn_endpoint_groups
18 from neutron_lib.api import extensions
19 from neutron_lib.plugins import constants as nconstants
20
21 from neutron.api.v2 import resource_helper
22
23
24 class Vpn_endpoint_groups(extensions.APIExtensionDescriptor):
25 api_definition = vpn_endpoint_groups
26
27 @classmethod
28 def get_resources(cls):
29 plural_mappings = resource_helper.build_plural_mappings(
30 {}, vpn_endpoint_groups.RESOURCE_ATTRIBUTE_MAP)
31 return resource_helper.build_resource_info(
32 plural_mappings,
33 vpn_endpoint_groups.RESOURCE_ATTRIBUTE_MAP,
34 nconstants.VPN,
35 register_quota=True,
36 translate_name=True)
37
38
39 class VPNEndpointGroupsPluginBase(metaclass=abc.ABCMeta):
40
41 @abc.abstractmethod
42 def create_endpoint_group(self, context, endpoint_group):
43 pass
44
45 @abc.abstractmethod
46 def update_endpoint_group(self, context, endpoint_group_id,
47 endpoint_group):
48 pass
49
50 @abc.abstractmethod
51 def delete_endpoint_group(self, context, endpoint_group_id):
52 pass
53
54 @abc.abstractmethod
55 def get_endpoint_group(self, context, endpoint_group_id, fields=None):
56 pass
57
58 @abc.abstractmethod
59 def get_endpoint_groups(self, context, filters=None, fields=None):
60 pass