Debian Codegraph @

neutron_lib/api/definitions/_dummy.py

raw
1 # 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 # A declaration of a dummy neutron extension: this may have a number of
16 # constants being defined, and their aim is to document as much about
17 # the extension as possible.
18
19 # The alias of the extension.
20 ALIAS = 'dummy'
21
22 # Whether or not this extension is simply signaling behavior to the user
23 # or it actively modifies the attribute map (mandatory).
24 IS_SHIM_EXTENSION = False
25
26 # Whether the extension is marking the adoption of standardattr model for
27 # legacy resources, or introducing new standardattr attributes. False or
28 # None if the standardattr model is adopted since the introduction of
29 # resource extension (mandatory).
30 # If this is True, the alias for the extension should be prefixed with
31 # 'standard-attr-'.
32 IS_STANDARD_ATTR_EXTENSION = False
33
34 # The name of the extension (mandatory).
35 NAME = 'Foo Extension'
36
37 # A prefix for API resources. An empty prefix means that the API is going
38 # to be exposed at the v2/ level as any other core resource (mandatory).
39 API_PREFIX = ''
40
41 # The description of the extension (mandatory).
42 DESCRIPTION = "Provides support for foo"
43
44 # A timestamp of when the extension was introduced (mandatory).
45 UPDATED_TIMESTAMP = "2000-00-01T00:00:00-00:00"
46
47 # The specific resources and/or attributes for the extension (optional).
48 # In case of simple extensions, with single resource, the string constants
49 # RESOURCE_NAME and COLLECTION_NAME can be used, otherwise string literals
50 # can be used instead.
51
52 # The name of the resource introduced or being extended
53 # (in case it is defined by another extension, or it is
54 # a core resource).
55 RESOURCE_NAME = 'foo'
56
57 # The plural for the resource introduced or being extended
58 # (in case it is defined by another extension, or it is a
59 # core resource).
60 COLLECTION_NAME = 'fooes'
61
62 # The resource attribute map for the extension. It is effectively the
63 # bulk of the API contract alongside ACTION_MAP (mandatory).
64 RESOURCE_ATTRIBUTE_MAP = {
65 COLLECTION_NAME: {
66 'id': {'allow_post': False, 'allow_put': False,
67 'validate': {'type:uuid': None},
68 'is_visible': True, 'primary_key': True},
69 }
70 }
71
72 # The subresource attribute map for the extension. It adds child resources
73 # to main extension's resource. The subresource map must have a parent and
74 # a parameters entry. If an extension does not need such a map, None can
75 # be specified (mandatory).
76 # Note that if an existing sub-resource is being extended, the
77 # existing resources to extend the new extension attributes must be
78 # defined under the 'parameters' key.
79 SUB_RESOURCE_ATTRIBUTE_MAP = {
80 'subfoo': {
81 'parent': {
82 'collection_name': COLLECTION_NAME,
83 'member_name': RESOURCE_NAME},
84 'parameters': {
85 'id': {'allow_post': False, 'allow_put': False,
86 'validate': {'type:uuid': None},
87 'is_visible': True,
88 'primary_key': True},
89 },
90 },
91 }
92
93 # The action map: it associates verbs with methods to be performed on
94 # the API resource (mandatory). For example:
95 #
96 # ACTION_MAP = {
97 # RESOURCE_NAME: {
98 # 'add_my_foo_bars': 'PUT',
99 # 'remove_my_foo_bars': 'PUT',
100 # 'get_my_foo_bars': 'GET'
101 # }
102 # }
103 ACTION_MAP = {
104 }
105
106 # The action status: it associates response statuses with methods to be
107 # performed on the API resource (mandatory). For example:
108 #
109 # ACTION_STATUS = {
110 # 'create': 201,
111 # 'delete': 204
112 # }
113 ACTION_STATUS = {
114 }
115
116 # The list of required extensions (mandatory).
117 REQUIRED_EXTENSIONS = [
118 ]
119
120 # The list of optional extensions (mandatory).
121 OPTIONAL_EXTENSIONS = [
122 ]
123
124 # TODO(armax): add support for modeling custom queries