Set lock_path correctly.
[openstack-build/neutron-build.git] / neutron / extensions / routerservicetype.py
1 # Copyright 2013 VMware, Inc.  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 from neutron.api import extensions
16
17 SERVICE_TYPE_ID = 'service_type_id'
18 EXTENDED_ATTRIBUTES_2_0 = {
19     'routers': {
20         SERVICE_TYPE_ID: {'allow_post': True, 'allow_put': False,
21                           'validate': {'type:uuid_or_none': None},
22                           'default': None, 'is_visible': True},
23     }
24 }
25
26
27 class Routerservicetype(extensions.ExtensionDescriptor):
28     """Extension class supporting router service type."""
29
30     @classmethod
31     def get_name(cls):
32         return "Router Service Type"
33
34     @classmethod
35     def get_alias(cls):
36         return "router-service-type"
37
38     @classmethod
39     def get_description(cls):
40         return "Provides router service type"
41
42     @classmethod
43     def get_updated(cls):
44         return "2013-01-29T00:00:00-00:00"
45
46     def get_extended_resources(self, version):
47         if version == "2.0":
48             return EXTENDED_ATTRIBUTES_2_0
49         else:
50             return {}